1
Answers
Vote up!
0
Vote down!

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?

Asked by: Daniel.uww
on August 9, 2013

1 Answer

Vote up!
2
Vote down!

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)"

Josh Miller
Answer by: Josh Miller
Posted: Aug 9, 2013

Comments

Josh, thanks for your help with this. You probably saved me several hours of digging to figure it out.

The Drupal Community rocks!

- Daniel.uww on August 12, 2013

Well, you know, we had to celebrate Question 9000 somehow :D

Josh

- Josh Miller on August 12, 2013

@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?

- sepehrmm on June 29, 2014