GordonLesti / Lesti_Fpc

Simple Magento Fullpagecache
https://gordonlesti.com/lesti-fpc-documentationversion-1-4-5/
Other
358 stars 159 forks source link

Clean cache for categories on stock change for variants #281

Open kurtinge opened 7 years ago

kurtinge commented 7 years ago

The problem: If is_in_stock on a simple product is changed. The category where the parent (configurable product) isn't cleaned. This will result in too many or too few products showing when filtering on the category pages, when layered navigation is enabled.

An example is: You sell shoes and have filter on size. The filter show that you have 2 left in size 39. If the simple product is set to not in stock. The categories cache will not be cleaned, and the filter will still show 2 left in size 39, but when you enter the product page the expected size is not available. The same seems to be the issue if you have a shoe in size 39 that is out of stock, and you get it back into stock. Then this will not show up in the filter until you have cleaned the cache.

This patch will fix both these scenarios by cleaning category cache for all categories where the parent product is located.