Customise "Buy it Now" button using theme app extension

mezdev
Shopify Partner
1 0 0

Screenshot 2024-02-22 at 4.18.00 PM.png

 

Is there a method to customize the redirection URL of the default Buy it now button, allowing for the addition of query parameters via theme app extension?  I want to add cart attributes. 

I am creating a Shopify app that uses a theme app extension.

Reply 1 (1)

Liam
Shopify Staff
2731 302 777

Hi Mezdev,

 

You should be able to use JS in your theme app extension to target another element on the page and make a change to it, eg: by using querySelector() and targeting the buy it now on the page. 

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog