From cc0a8cda99e3f74fbe9170088541ec424b300a1e Mon Sep 17 00:00:00 2001 From: Michele Imperato Date: Thu, 21 Jan 2021 11:23:58 +0100 Subject: [PATCH 1/2] Invalidate parent product cache on child stock item save --- app/code/local/MSP/LTS2/Model/Cache.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/code/local/MSP/LTS2/Model/Cache.php b/app/code/local/MSP/LTS2/Model/Cache.php index 1832889..56c7d5c 100644 --- a/app/code/local/MSP/LTS2/Model/Cache.php +++ b/app/code/local/MSP/LTS2/Model/Cache.php @@ -382,7 +382,15 @@ public function invalidateOnModelSave($modelInstance) { $invalidations = Mage::getSingleton('msp_ltsr2/cache')->getBlocksModelInvalidation($modelInstance); $tags = array(); - + + if ($modelInstance instanceof Mage_CatalogInventory_Model_Stock_Item) { + $parentIds = Mage::getSingleton('catalog/product_type_configurable') + ->getParentIdsByChild($modelInstance->getProductId()); + foreach($parentIds as $parentId) { + $tags[] = 'CATALOG_PRODUCT_' . $parentId; + } + } + foreach ($invalidations['global'] as $blockName) { $tags[] = 'MSP_BLOCK_NAME_'.$blockName; } From 50fb470e08667cb7b87dd772c592ee27317707a4 Mon Sep 17 00:00:00 2001 From: Michele Imperato Date: Thu, 21 Jan 2021 11:32:31 +0100 Subject: [PATCH 2/2] Update module version --- app/code/local/MSP/LTS2/etc/config.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/local/MSP/LTS2/etc/config.xml b/app/code/local/MSP/LTS2/etc/config.xml index cdc9010..61d2667 100644 --- a/app/code/local/MSP/LTS2/etc/config.xml +++ b/app/code/local/MSP/LTS2/etc/config.xml @@ -19,7 +19,7 @@ - 1.0.1 + 1.0.2