[SOLVED] How to check if item in referenced collection is visible

Question:

I have a Product collection and a Brand collection. The Product collection has a reference field to the Brand collection. I have enabled ‘Control Item Visibility’ on both collections.

I have created a dynamic ProductSearch page and have joined to the Brand collection using the include() function.

How do I filter out products that belong to a Brand that has been set to Hidden (via the Status field in the Brand collection)?

thanks
David
Product:
[Which editor or feature is your question most relevant to? e.g. Wix Editor, Wix Studio Editor, Editor X.]

What are you trying to achieve:
If I set a brand to hidden (via the collection) then I do not want any products associated with that brand to appear on the ProductSearch page.

What have you already tried:
[Share resources, forum topics, articles, or tutorials you’ve already used to try and answer your question.]

Additional information:
[Include any other pertinent details or information that might be helpful for people to know when trying to answer your question.]

I figured it out myself. Just reference property ‘_publishStatus’. It will be set to “PUBLISHED” when the item has Status=Visible in the collection.

2 Likes