Hide quick add button from product grid in dawn theme for items with a specific tag

Topic summary

Goal: Hide the “Quick add” button in Dawn’s product grid for products marked as store-only, initially via a product tag “noshow,” and show an alternative message (“Buy in store only”).

Key area to edit: snippets/card-product.liquid, specifically within the quick add logic between:

  • {% if quick_add == ‘standard’ %}
  • {% elsif quick_add == ‘bulk’ %}

Suggested approach (tags): Wrap the quick add button code with:

  • {%- unless product.tags contains ‘noshow’ -%} … {%- else -%} Buy in store only {%- endunless -%}

Issues encountered: The OP struggled to locate the exact button markup and found the tag-based condition didn’t take effect (button still showed, no fallback text). Questions arose about whether product tags needed to be referenced earlier in the loop.

Resolution: The OP achieved the desired behavior using a custom product metafield instead of tags:

  • {%- unless card_product.metafields.custom.in_store_only -%} … {%- else -%} Buy in store only {%- endunless -%}

Notes:

  • “Metafield” = custom product field in Shopify.
  • Code snippets are central to understanding the solution.

Status: Resolved by using a custom metafield condition rather than product tags.

Summarized with AI on December 21. AI used: gpt-5.

Hello,

I have added a tag to some products as “noshow” which I am looking to hide the quick add to cart button in the product grid in the dawn theme. I have found some code that might work.

{%- unless product.tags contain ‘noshow’ -%}

?

{%- else -%}

Buy in store only

{%- endunless -%}

I assume I would need to add this code somewhere in snippets/card-product.liquid but I don’t know where

Any help would be much apricated

Hello @Ashley_83_1 ,

Code available in snippet → card-product.liquid
b/w these 2 line
{% if quick_add == ‘standard’ %}

// whole the coed which is here belong to collection product gridadd to cart button

{% elsif quick_add == ‘bulk’ %}

Thanks

Hi @Ashley_83_1 ,

I haved checked your requirement, you can try this way to solved this problem:

To hide the quick add button for products tagged with “noshow” in the Dawn theme, you can modify the snippets/card-product.liquid file as you suggested. 1. Locate the Button Code:

First, find the code that generates the quick add button. In card-product.liquid, this might be a button or a form with an Add to cart or Quick add label.

2. Wrap the Button Code with Your Logic: Use the {%- unless product.tags contains ‘noshow’ -%} condition to hide the button for products with the “noshow” tag.

{%- unless product.tags contains 'noshow' -%}
  
    
  

{%- else -%}
  
    Buy in store only
  

{%- endunless -%}
  1. Save the File: Once you’ve added the condition, save the changes to the card-product.liquid file.

This code checks if the product does not have the “noshow” tag before displaying the quick add button. If the product does have the “noshow” tag, you can either hide the button entirely or display an alternative message like “Buy in store only.”

Hope it helps!

If they are helpful, please give us likes and mark as the solution.

Have a nice day sir!

Thank you for your reply @Guleria , I still have not managed to solve it using your reply so far, would it be possible for you to explain this example in more detail. Would I be correct in thinking I should have the code something like this?

{%- unless product.tags contain ‘noshow’ -%}

{% if quick_add == ‘standard’ %}

and all of the other code lines until

{% elsif quick_add == ‘bulk’ %}

{%- else -%}

Buy in store only

{%- endunless -%}

Thank you @BSSCommerce-B2B for your help so far. I am struggling to find the button code to apply your code example to as I can’t seem to find the div tags

If I comment out the code below on the page it appears to correctly hide the button, how would I apply the code to your example?


Dear my friend @Ashley_83_1 ,

To apply the conditional logic to the code you found, you can wrap the element with the {%- unless product.tags contains ‘noshow’ -%} condition.

If you want to show an alternative message when the button is hidden (like “Buy in store only”), you can use the {%- else -%} part.

You can try this code below:

{%- unless product.tags contains 'noshow' -%}
  
{%- else -%}
  
Buy in store only

{%- endunless -%}

I hope these instructions will help you. If they are helpful, please give us likes and mark as the solution.

This can be greatly motivate us to contribute to our community.

Thanks in advance.

Thank you for your help so far @BSSCommerce-B2B when your latest code is added, the page displays the quick add button as it did before I changed any code but it does not hide the button or output the alternative message text, either I am starting or ending the button code on the wrong lines or would the “tag” variable need to be called earlier in the code the same way as the image or product text would have to be called to loop the results to the product grid?

{% if quick_add == 'standard' %}

{%- unless product.tags contain 'noshow' -%}
// the existing code
{%- else -%}
// Buy in store only
{%- endunless -%}

{% elsif quick_add == 'bulk' %}

I was unable to resolve the issue using tags but was able to resolve it using a custom metafield named in_store_only

{%- unless card_product.metafields.custom.in_store_only -%}
  
{%- else -%}
  
Buy in store only

{%- endunless -%}
   
{%- endform -%}

{%- endif -%}