Remove price, Paynow and add to cart when price = 0 in Debut theme

Hi all,

I used the below script to remove the price when it is equal to 0, it works fine, however, i want to hide the add to cart and pay now in Debut, can anyone help?

1 Like

Hey @JCJackie

Welcome to Shopify Community! Can you share your Store URL so I can have a look on it? Also, if you have password enabled then please share the password as well. Your cooperation would be greatly appreciated.

Best Regards,
Moeed

https://www.theukulelestore.hk/en/products/give-thanks-%E5%85%8D%E8%B2%BBukulele-chord%E8%AD%9C

thanks @Moeed i have removed the price, but also want to remove the “buy it now” and “add to cart” button

1 Like

Hey @JCJackie

Follow these Steps:

  1. Go to Online Store

  2. Edit Code

  3. Find theme.liquid file

  4. Add the following code in the bottom of the file above tag


RESULT:

If I managed to help you then, don’t forget to Like it and Mark it as Solution!

Best Regards,
Moeed

@Moeed i only want it to be hide when the price is 0 (which i already hide the price), and the button should be showing when the price is > 0

Hi @JCJackie

In order to fulfill your request, please follow these steps

Step 1: Go to Shopify Admin → Online Store ->Theme → Edit code
Step 2: Search file theme.liquid
Step 3: Insert this code above

{% if product.price == 0 %}
{% style %}
form.product-form.product-form-product-template.product-form--payment-button-no-variants {
    display: none !important;
}
{% endstyle %}
{% endif %}

I hope this helps

Best,

Daisy

thanks @DaisyVo , it works