I wanna replace my buy button/Add to cart button with a custom link url (enquiry button)

Topic summary

A user wants to replace the default “Buy Now” or “Add to Cart” button on their Shopify Dawn theme product page with a custom enquiry button that redirects to a specific URL.

Solutions Provided:

Two community members offered similar step-by-step solutions:

  • Disable default buttons: Turn off “Show dynamic checkout buttons” in the product page customization settings
  • Add custom button: Use the “Custom Liquid” block feature in the theme editor
  • Insert code: Paste HTML/CSS code that creates a styled button linking to the desired URL
  • Position correctly: Drag the Custom Liquid block below the “Buy buttons” section

Both solutions include screenshots demonstrating each step and provide sample code for the custom button.

Current Status:

The original poster confirmed the solution worked successfully. However, follow-up questions emerged:

  • One user is experiencing 404 errors and asks where to insert the custom URL in the code
  • Another user (in Italian) asks how to apply this to collection pages instead of product pages, specifically replacing “Add to cart” with “Buy on WhatsApp”

These additional questions remain unanswered.

Summarized with AI on November 9. AI used: claude-sonnet-4-5-20250929.

I am using DAWN theme and i wanna replace the link for the buttons available on the product page (any one)
here is my store link : https://b58128-e6.myshopify.com/products/diamond-earring?variant=47798300967203

as you can see the make an enquiry button is redirecting to checkout can anyone please help me out

Hello @Yash234 ,

It’s good practice to create a copy of your theme and work on that to preview the changes before applying, especially if you are editing the raw code. Alternatively, you can also use the Shopify theme editor’s versions to revert to previous versions, but it is not recommended if you are making multiple changes.

Now to your specific question on replacing Shopify’s default ‘Buy Now’ button with a custom link. First, you will need to disable the “Buy Now” button from the customization settings of the product page, as shown in the screenshot below:

After disabling the checkbox, the Buy Now button will no longer appear in your store.

Now to add a custom link please follow the steps below:

  1. Open the code editor. (Referring to Dawn theme here)

  2. Open the “snippets/buy-buttons.liquid” file.

  3. Search for “{%- if show_dynamic_checkout -%}” and add your custom button code above it. It should look something like below:

  4. Done? Now save the file, and try previewing to confirm if the changes work for you. In the reference above, it looks something like below:

  5. You will need to add additional CSS if you want to match it according to your store’s theme/branding.

Hope this helps!

Regards,
Abhishek from Swym

@Yash234

Please follow below steps to add a button redirect to custom URL. Let me know whether it is helpful for you.

  1. From admin, go to “Online Store” → “Themes”.
  2. Click “Customize” button from the current theme.
  3. Go to the product page and select “Product information” section.

  1. Click “Buy buttons” and uncheck the “Show dynamic checkout buttons” checkbox

  1. Click “Add block” and select “</> Custom Liquid”.

  1. Click “Custom Liquid” and paste below code in the field as shown in the attached image below.
Make An Enquiry 
{% style %}
.custom_url {
    display: flex !important;
    width: 100%;
    margin: 0px !important;
}
.product__info-container .product-form {
    margin: 0px !important;
}
{% endstyle %}

  1. Drag the newly added “</> Custom Liquid” and place it below the “Buy buttons”, it will shown like below.

Please provide your support by click “Like” and “Accepted” if our solution works for you. Thanks for your support.

2 Likes

Thank you so much buddy!!! it worked…

Hi, I am attempting to use this. I keep getting a 404 error. I’m guessing you have to insert a custom url but I am wondering where in the code does it go and where can I get the url from? Thank in advance.

Ciao @Vinsinfo , e se invece volessi sostituire il collegamento per i pulsanti disponibili nella pagina del prodotto per una singola collezione da “aggiungi al carrello” ad “acquista su whats app”?