I created a Search API view to search for products and nodes.

Unpublished nodes are hidden, but unpublished products are not hidden.

How to hide unpublished products in the Search API view ?

Comments

zenimagine created an issue. See original summary.

drunken monkey’s picture

Category: Bug report » Support request
Status: Active » Fixed

I'm not terribly familiar with Commerce, so can't say for sure, but if products are a different entity type, not normal nodes, then the "Content access" processor won't work on them.
To exclude unpublished products, add the "Published" field of products to the index and then filter on it. For also displaying nodes, you can either use an "OR" filter group to do "Datasource: Node OR Product published: Yes", or add an aggregated field for "Published" of both products and nodes and filter on that. (In the latter case, even admins won't be able to find unpublished nodes, though, which should currently be the case.)

zenimagine’s picture

@drunken monkey thank you

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.