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

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

jessicarobinson
Visitor
1 0 0

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 

Replies 2 (2)

Shadab_dev
Shopify Partner
1255 64 132

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

Buy me Coffee, if you feel i was helpful. Email Me here or WhatsApp me with this link for any help with shopify theme customizations or any project in web dev. If this is helpful, please Like and Accept the solution.

PaulNewton
Shopify Partner
7722 678 1626

Hi @jessicarobinson 👋 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-t... 

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.

Contact paull.newton+shopifyforum@gmail.com for the solutions you need


Save time & money ,Ask Questions The Smart Way


Problem Solved? ✔Accept and Like solutions to help future merchants

Answers powered by coffee Thank Paul with a Coffee for more answers or donate to eff.org