-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Filter out-of-stock child items from configurable products in category view #4111
Comments
Okay I made a small test index with some sample products (sorry for the long post). The query (at the bottom) should only show items where the child is available or simple-products – this way we could achieve the desired behavior to filter products with out-of-stock super-attributes.
|
I added an optional But there are some pitfalls and minor changes needed:
It is working – I can now filter for only available products and its configurable child-products by availability too. This is a lot – I'm not sure if just us are in need of this feature – or this is good feature for others too. If so, I would could go on to create a more configurable and implemented approach. |
Hi @cewald I really appreciate the effort you took to make this feature happen - it's not anything simple. Some questions:
That's it from my side. After this generalization + applying the shema change to the indexers I'm OK with merging this in |
I've added |
What's the status on this? Is it merged? |
It's not – but there is a project in merging process which supports this kind of filter as an extension. There is a cookbook-recipe in the docs of this PR #4234 that describes how it works. So, once you are using the If it helps, this is how our custom stock-filter looks like (like described above): I think we can close this issue in favour of #4234 |
Current behavior
If you enable to hide out-of-stock products in category list with
products.listOutOfStockProducts
config value, it hides items that are out-of-stock. But its only working seriously for simple products. If I have a product with four configurable options which are all out of stock, the "parent" product will still be visible. Also the filter for super-attributes likesize
will work but not really fulfill it's purpose to show just items with an available size or whatever.This isn't really a bug, more a missing feature – but I think it's important for a consistent shopping experience.
I already did some research. It should be possible to query this in ES by using
nested
properties forconfigurable_children
andconfigurable_children.stock
inproduct
index. The problem is that they are both just array/object types yet. So, the indexer/data-pump had to be modified to create the correct mapping. Then it would be best to add a new property for stock-check in the VSF actions and extend theDivanteLtd/storefront-query-builder
to handle it (in first place for ES) at the API side.I will post an example index and query for ES below to explain my idea.
I think this #3780 is heading in the same direction – but I'm aiming especially at a stock filter feature.
Expected behavior
If I enable to hide out-of-stock items the filter in category-view for super-attributes like
size
should only show available items.Repository
Latest
develop
Can you handle fixing this bug by yourself?
Which Release Cycle state this refers to? Info for developer.
Pick one option.
develop
branch and create Pull Request2. Feature / Improvement
back todevelop
.release
branch and create Pull Request3. Stabilisation fix
back torelease
.hotfix
ormaster
branch and create Pull Request4. Hotfix
back tohotfix
.Environment details
DivanteLtd/magento1-vsbridge-indexer
The text was updated successfully, but these errors were encountered: