Hide buy button only on a specific theme template

Hide buy button only on a specific theme template

Hugobrunto
Excursionist
25 0 7

Hi, 

 

I have a hundreds of product that is assigned to a special template called "Special-order". 

I want to remove the "Buy It Now" button only from all products within this template.

I want to keep the other button "Beställ" and make it centered. 

 

Any specialist that could help me with this? 

 

Lots of love xx Skärmavbild 2024-09-24 kl. 16.45.31.png

Replies 5 (5)

KetanKumar
Shopify Partner
37095 3645 12054

@Hugobrunto 

Sorry for facing this issue, it's my pleasure to help us.

Welcome to the Shopify community!
and Thanks for your Good question. 😊

Please share your site URL,
So I will check and provide a solution here.

If helpful then please Like and Accept Solution.
Want to modify or custom changes on store Hire me.
- Feel free to contact me on bamaniyaketan.sky@gmail.com regarding any help
Shopify Partner | Skype : bamaniya.sky
PSD to Shopify | Shopify Design Changes | Shopify Custom Theme Development and Desing | Custom Modifications In to Shopify Theme | SEO & Digital Marketing
Hugobrunto
Excursionist
25 0 7

Hi! 

 

Sure, here it is: www.hugobrunto.se 🙂 

 

Thanks for your kindness so far 🙂 

namphan
Shopify Partner
1335 164 199

Hi @Hugobrunto,

Please go to Actions > Edit code > Layout >theme.liquid file and paste the below code before </head>:

{%- if template contains 'Special-order' -%}
      <style>
        .product-form__buttons .product-form__submit {
          width: 100%;
        }
        .product-form__buttons .shopify-payment-button {
          display: none;
        }
      </style>
    {%- endif -%}
Coffee tips fuels my dedication.
Shopify Development Service
Need help with your store? namphan992@gmail.com

Sangeetanahar
Explorer
541 36 69

hello @Hugobrunto 

Go to online store ----> themes ----> actions ----> edit code ---->assets ----> base.css

add the code end of the file

{%- if template contains 'Special-order' -%}
  <style>
    .product-form__buttons .product-form__submit {
      display: block;
      margin: 0 auto;
   width: 100%;

    }
    .product-form__buttons .shopify-payment-button {
      display: none;
    }
  </style>
{%- endif -%}


If this was helpful, hit the like button and accept the solution.
Thanks

Was I helpful?

Buy me a coffee



Want to modify or custom changes or bug fix on store . Or Need help with your store? Or -Want Complete Storefront
Email me -sangeetarahuldhiman@gmail.com - Skype: live:sangeetarahuldhiman -Whatsapp: +917009811712
Checkout Some Free Sections Here

Dan-From-Ryviu
Shopify Partner
9672 1936 1973

Hi @Hugobrunto 

You can do that by adding this CSS code to Custom CSS of product information section of that product template in theme's customize 

.shopify-payment-button { display: none; }

Screenshot 2024-09-25 at 14.07.10.png

- Helpful? Like and Accept solution! Support me! Buy me coffee
- Ryviu - Reviews & QA app: Collect product reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Shopee, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image: Easy and fast to create Photo Gallery, Lookbook, Shop The Look.
- Ryviu: Aliexpress Reviews - AliExpress Reviews Importer, one-click import aliexpress reviews, export reviews to CSV file.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.