How can I exclude a specific product from an automated collection?

Hello,

I have 3 tshirts A, B, C. I have created an automation collection and all 3 tshirts have the tag “t-shirt”

My automated collection pulls in all tshirts with the tag and has been added as a “featured collection” section on each product page.

When viewing the product page for tshirt (A), how do I exlcude it from the collection so that I only see tshirt B & C?

Does anyone know the code to edit to obtain this result?

1 Like

Varies wildly by theme, always communicate in concrete terms.

Theme names, reference urls,etc

https://community.shopify.com/c/blog/how-to-get-support-from-the-community/ba-p/2254458

Roughly f the section is javascript based, you would need to find the featured collections product forloop

then use some liquid logic similar to the following though the variable names may be different.

{% if current_product.handle == product.handle %} {% continue %} {% endif %}

Good Hunting.

If you need this customization done for you then contact me by email for services.
Contact info in forum signature.
ALWAYS please provide context, examples: store url, theme name, post url(s) , or any further detail in ALL correspondence.

Hi, could you share your store link?

https://retrolinksgolf.com/products/ex_mock3

Go to your Online store > Themes > Edit code > open card-product.liquid file, find this line of code

{%- if card_product and card_product != empty -%}

Add this code before

{% unless card_product.id == product.id %}

And then go to the very bottom of the file, add this code at the bottom

{% endunless %}

hi @thanksagain

Add an additional “class” to “LI” of the featured collection liquid file, please refer to the below screenshot.

Write the below CSS in main-product.liquid file


Please refer to the below screenshot for reference.

Hope this will help…

thank you. will try this and get back to you

this did not work. it aligns the collection vertically and doesnt remove the featured product

Can you share the preview theme URL

this worked! thank you

1 Like

You are very welcome