How do you hide "disabled" products from the search results?
I'm trying to figure out a way to hide "disabled" products from the Commerce KickStart 2 search results.
Any ideas?
I'm trying to figure out a way to hide "disabled" products from the Commerce KickStart 2 search results.
Any ideas?
So... after creating a video for this answer, it's clear that the default view hides disabled products using some form of Drupal magic. But I will still go through how to make the status get indexed so you can filter it on Views. Maybe you need this for a non-magical Views implementation?
STEP BY STEP
1) Go here admin/config/search/search_api/index/product_display/fields and check "field_product:status"
2) Go here admin/config/search/search_api/index/product_display/status and re-index
3) Go here admin/config/development/performance and Clear Cache
4) Go here admin/structure/views/view/display_products/edit and a filter for "Product variations: Status (indexed)"
Comments
Josh, thanks for your help with this. You probably saved me several hours of digging to figure it out.
The Drupal Community rocks!
Well, you know, we had to celebrate Question 9000 somehow :D
Josh
@Josh Miller hi, I want to hide a product display from search page only when all of its product variations are disable not just one, how can we achieve this?