How can I selectively remove the 'Add to Cart' button in Debut Theme?

Hi there,

Hoping you can help :slightly_smiling_face:

I’m looking to remove the Add to Cart button for select products but for some reason when I edit out the cart using these instructions it breaks the pictures (when you click on the pictures it opens into a new page - instead of just the gallery on the same page):

https://help.shopify.com/en/manual/online-store/themes/themes-by-shopify/vintage-themes/customizing-vintage-themes/hide-add-to-cart-buttons

It’s basically the same issue as the person below but they wanted it gone for all products (in which the solution provided worked) but I need the cart removed for just some.

https://community.shopify.com/c/shopify-design/remove-add-to-cart-button-in-debut-theme/td-p/1107444

Sorry if this is a repeat post, my google skills failed me

Thanks!

Hello,

The code is probably expecting the button to exist and so removing it will cause the error.

The other solution just hides the button - you could do the same but wrap it in a conditional statement to determine if it should show or not.

What is the criteria to show the button or not? Example product has a specific tag?

@CarGray12

You can define a criterias of list that you want to apply it on the products you want to hide Add to Cart button? If yes, can you show it here? then I can review it

Hi there - thanks for your help!

The criteria to hide the button would be one linked to the nocart template but I don’t mind revamping and making it so it has a specific tag instead (for example a nocart tag).

I tried adding the below code to themes.css.liquid but nada (I kinda winged it so no surprise it didn’t work lol - I dont think “IF” is a thing for css, so that may be the case).

{% if product.tags contains ‘nocart’ %}
.product-form__controls-group–submit {
display: none;
}">
{%- endif -%}

I found a video last night that said you can put the following code into each of the products individually and it works but it’s kinda tedious. So if you have any other thoughts that would be appreciated.

.product-form__controls-group--submit {display:none}