HIDE ADD TO CART BUTTON ON SELECTED PRODUCTS ONLY ON STILETTO THEME

Hi,

I am trying to hide the “buy button” on selected products on my site, however, I do want the buy button on other products.

I understand I need to create a new product template within the edit code section of the selected online store theme.

This is the buy button code however I do not know what I need to input and where to remove the buy button for products that I am going to add to this theme

},
“buy_buttons”: {
“type”: “buy_buttons”,
“settings”: {
“show_dynamic_checkout”: true,
“enable_sticky_atc_bar_desktop”: false,
“enable_sticky_atc_bar_mobile”: false,
“divider_width”: “none”
}

Does anyone know

You don’t need to edit anything on this code nor do you have to make a template.

This will need some editing on the code editor of your theme. By checking for the product title we can show or hide buttons respectively.

I will need collaborator access to your store though since you are on a paid theme and I try and test these stuffs on my development store which does not allow to edit code in paid themes.

Thanks

Hi @jessicarobinson :waving_hand: JSON templates are not where conditional logic would live in current themes.

I understand I need to create a new product template within the edit code section of the selected online store theme.

No coding needed unless you are omitting critical detail , you don’t even need to be in the code editor to do this:

Reread the manual for alternate templates: https://help.shopify.com/en/manual/online-store/themes/os20/theme-structure/templates#create-a-new-template

Apply that template to those products in the products admin, then in the visual theme editor just remove/disable the buy buttons bocks, or disable the buy-buttons setting(s).

Most reasonable themes will have one or the other and sometimes a separate setting for showing/hiding either the add-cart-button OR accelerated payment buttons.

Read: https://xyproblem.info/ , self diagnose leads to wrong prescriptions, when you don’t know a technology focus on describing goals to avoid wasting time.