Hide the Buy Now Checkout Button with Product Options

Modified on Thu, 19 Oct, 2023 at 6:48 PM

Overview

Shopify allows you to offer an express checkout experience via Buy Now buttons on your product pages. This will take your customers directly to the checkout, completely bypassing the add to cart process.

All forms of express checkouts and Buy Now buttons are incompatible with Product Options 2.0.

We highly recommend completely removing this button from your product pages.


Remove the "Buy Now" Button from Your Store

Removing the dynamic checkout button will help ensure that Product Options, and other 3rd-party apps, function correctly on your store.

Most third-party applications that would depend on an add.js call will conflict with this button on product pages only.

  1. From the Shopify admin, select Online Store, then Customize.
  2. Select Customize.
  3. Select the dropdown menu at the top and select Product Pages.

    Select Product Pages Option

  4. Uncheck Show dynamic checkout button.

    Uncheck Show dynamic checkout button Option

  5. Select Save.

Hide the "Buy Now" Button from Products with Options

  1. From the Shopify admin, select Online Store, then select Actions > Edit code.
  2. Under Snippets, select product-template.liquid or product-form.liquid (the file where the Buy Now button is rendering)
  3. Paste the following code at the very end or just before {% schema %}  if available:
    {%- if template.name == “product” -%}
    <script>
    if (window.BOLD && BOLD.common && BOLD.common.eventEmitter){
     BOLD.common.eventEmitter.on('BOLD_OPTIONS_option_products_loaded', function(event){
     var optionsDiv = document.querySelector('.bold_options_loaded');
     if(optionsDiv.children.length != 0){
     var buyItNow = document.querySelector('.shopify-payment-button');
     if(buyItNow){ buyItNow.removeChild();
     }
     }
     });
     }
     </script>
     {% endif %}

    Note: With this code, your store will only display the Buy Now buttons on product pages that do not have options loaded.

  4. Select Save.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article