-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clear category caches after product (mass)save #248
base: master
Are you sure you want to change the base?
Conversation
@@ -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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please do not load products in a loop.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestions? Use a collection before the loop and load all $productIds
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My suggestion is query directly to database for getting categories, catalog_category_product table is a good start.
I don't think it's superfluous. If I change a single product from the backend it would be nice if all category caches where the product is present will be cleaned. The same for a mass action from the backend product grid. |
See: #241