Debut Theme : Custom Product Page Layouts

CharCore
New Member
4 0 0

Hi

I'm using the Debut Theme.  I have some products in my store that are available in different marketplaces in different countries, and some products that you can buy directly from my store.  For the products available in different countries, I found code to create custom buttons that will link to the marketplaces in these countries (here) but I am unable to remove the default "Add to Cart" and "Buy Now" buttons for these products. 

I found code examples where the template is changed - affecting all products. But since I have products that will be using the default buttons, I can't remove it permanently. Does anyone know how to hide these buttons for some products, so that they don't affect the products that can be bought from my store? Is there code that I can add to the product page specifically to hide the default buttons for these products?

0 Likes
Quyen_Beo
Explorer
58 7 12

You can add a tag 'hide_atc' to product which need to remove the ATC button.
Then on the code, you can check 
{% if product.tags contains 'hide_atc' %}

// put your external link here

{% else %}

// put the default add to cart btn here

{% endif %}

Was my reply helpful? Please Like and ✔️ Accept Solution. This mean alot to me
0 Likes
JHKCreate
Shopify Partner
2481 426 581

Hi @CharCore 

This is certainly doable, let's first start by understanding what could be an identifier for said products so we can share with you the code to apply for this functionality. 

- Did we solve your issue? Like & Mark As Solution to help the community
- Should you need any direct help: contact@jhkcreate.com
0 Likes
CharCore
New Member
4 0 0

Hi @Quyen_Beo  - 

Would I put this code in the product.liquid? Not sure I understand how to use this code.

0 Likes
CharCore
New Member
4 0 0

Hi @JHKCreate -

I can't think of specific identifier.... Would it work if I included a hidden field in the product description? So if this product has the hidden field then I can hide those buttons, otherwise show them?

0 Likes
JHKCreate
Shopify Partner
2481 426 581

Best way to do this is through a global metafield on all products, if it's not filled for a specific product nothing will then show. 

- Did we solve your issue? Like & Mark As Solution to help the community
- Should you need any direct help: contact@jhkcreate.com
0 Likes
CharCore
New Member
4 0 0

@JHKCreate can you provide an example of what you mean by a "global metafield on all products" and how I'll use it?

0 Likes