Lesti_Fpc icon indicating copy to clipboard operation
Lesti_Fpc copied to clipboard

Clean cache for a specific product after it has been purchased

Open Aquive opened this issue 10 years ago • 5 comments

We are showing delivery time on product pages based on inventory level. This is ofcourse cached. After a product is saved in backend the cache gets refreshed correctly so the data in frontend is correct.

But if the product is purchased the cache is not refreshed. Is there a way to force a refresh on productpages after they have been ordered? There is an method for clearing the cache allready.

catalogProductSaveAfter, this refreshes cache, it is fired trough this event: cataloginventory_stock_item_save_after

Aquive avatar Jun 27 '14 15:06 Aquive

After some research I came to the conclusion this feature is allready implemented. But it is only run if the stock changes AND the "stock availablity" changes. So if you allow Backorders the stock qty is changed but the "stock availablity" does not change. This makes sure the cache is not being refreshed but acually it should do a refresh right?

We are displaying delivery times on our website based on quantity. So when it hits 0 we display a longer delivery time, regardless of the "stock availablity" because the product just stays available.

Aquive avatar Jun 27 '14 23:06 Aquive

Maybe you can work around that by using the add to cart action to refresh, as in some installations this is already decreasing the stock-qty.

nhp avatar Jan 25 '15 11:01 nhp

Possibly related to https://github.com/GordonLesti/Lesti_Fpc/issues/112

peterjaap avatar Apr 14 '15 18:04 peterjaap

This might just be related to #112; the cache is only invalidated when the product goes out of stock automatically. If its set to out of stock manually or if the product doens't go out of stock after a purchase, the cache entity stays intact. See my comment for a solution; https://github.com/GordonLesti/Lesti_Fpc/issues/112#issuecomment-93239211

peterjaap avatar Apr 15 '15 07:04 peterjaap

That's why i don't use fpc on productpages. I use also Amasty Custom Stock Status but product don't change at the front-end. Look like you found something here.

Micha Op 15 apr. 2015 09:36 schreef "Peter Jaap Blaakmeer" < [email protected]>:

This might just be related to #112 https://github.com/GordonLesti/Lesti_Fpc/issues/112; the cache is only invalidated when the product goes out of stock automatically. If its set to out of stock manually or if the product doens't go out of stock after a purchase, the cache entity stays intact. See my comment for a solution; #112 (comment) https://github.com/GordonLesti/Lesti_Fpc/issues/112#issuecomment-93239211

— Reply to this email directly or view it on GitHub https://github.com/GordonLesti/Lesti_Fpc/issues/55#issuecomment-93241462 .

Mic2005 avatar Apr 15 '15 20:04 Mic2005