diff --git a/app/code/community/Lesti/Fpc/Model/Observer/Save.php b/app/code/community/Lesti/Fpc/Model/Observer/Save.php index c07a0d0..ae5c357 100644 --- a/app/code/community/Lesti/Fpc/Model/Observer/Save.php +++ b/app/code/community/Lesti/Fpc/Model/Observer/Save.php @@ -28,16 +28,11 @@ public function catalogProductSaveAfter($observer) if ($product->getId()) { $this->_getFpc()->clean(sha1('product_' . $product->getId())); - $origData = $product->getOrigData(); - if (empty($origData) - || (!empty($origData) && $product->dataHasChangedFor('status')) - ) { - $categories = $product->getCategoryIds(); - foreach ($categories as $categoryId) { - $this->_getFpc()->clean( - sha1('category_' . $categoryId) - ); - } + $categories = $product->getCategoryIds(); + foreach ($categories as $categoryId) { + $this->_getFpc()->clean( + sha1('category_' . $categoryId) + ); } } } @@ -152,6 +147,14 @@ protected function _catalogProductSaveAfterMassAction(array $productIds) $tags = array(); foreach ($productIds as $productId) { $tags[] = sha1('product_' . $productId); + + $product = Mage::getModel('catalog/product')->load($productId); + $categories = $product->getCategoryIds(); + foreach ($categories as $categoryId) { + $this->_getFpc()->clean( + sha1('category_' . $categoryId) + ); + } } $this->_getFpc()->clean($tags); }