Skip to content
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

Clean cache for categories on stock change for variants #281

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

kurtinge
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant