Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
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 👋 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
Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025