Show tagged products on a product page but excluding certain tags

Hello,

I have a need for my products page to cross-reference its own tags to then display similarly tagged products.

So for instance a page called cars, is tagged with CompanyReview, Cars and Info.

At the bottom of the page I would like to call in other products to be displayed that have either of the tags “cars” or “info”, excluding “CompanyReview”.

The tags excluding “CompanyReview” need to be dynamically read per page. There is not to be a set list.

Chat Gpt has enabled me to show everything that excludes CompanyReview and is tagged with both tag one and tag two, but not all products that contain one of tag one or tag two.

It now is going round in circles, presumably my brief. Effectively I have 200 products and 200 companies, all listed as products. 20 are tagged as “CompanyReview”, the other 200 tagged as “ProductReview”. There are then some 50-70 other tags used on these products, only 2 or 3 at a time. I do not wish to list all of these in the code, but have them dynamically picked up. As we do not want all of the products shown, we first remove anything tagged with CompanyReview and ProductReview but would then want to call back anything that uses one of the subsequent more specific tags.

Hello @tireddad

Welcome to Shopify Community.

Yes it is possible to create a settings where you can input all the excluded tags. And then in liquid code to where you are showing the products with tags add the condition to exclude all the tags that are added in the settings.

These will need liquid knowledge. Let me know if you need any assistance.

Thanks

Thank you, I have managed to achieve the IF logic, but am now limitted by the 50 product calls per page. Obviously with 200 products of which only 7 may show, i need to run through them all. Currently I have one product showing as this fell within the initial 50 that were loaded. Is there a way to query the whole lot, returning just the results that need to be shown or is the hard limit of 50 set in stone by Shopify?

Thank you