How can i add a custom code on Add to cart button in Dawn theme

Solved

How can i add a custom code on Add to cart button in Dawn theme

mediland_uk
Tourist
29 0 1

My store name as MEDILAND PHARMACY, created with Dawn theme. Now i  want to add a cutom code for popup from Getsite control app. 

 

  • Add a data-getsitecontrol attribute to the necessary button (or any other element) on your website.
<button data-getsitecontrol="id=344330">
show widget id=344330
</button>
  • Add an href attribute to a link:
<a href="#getsitecontrol?id=344330">
show widget id=344330
</a>
  • Link a hash address (as shown below):
/page.html#getsitecontrol?id=344330
 
After the page has loaded, the widget with ID 1740 will be displayed.
 
You can also use plain JavaScript API as suggested before:
 
gsc('show', 344330)
 
This is the code. 
This is the code. I tried to add this code from my site file Main-product.liquid file But i confused where to be added this.
 
Accepted Solution (1)
PaulMartin
Shopify Partner
443 52 106

This is an accepted solution.

Okay. 


To make the changes required by Getsitecontrol, you'll need to update your theme's code. Specifically, you should look for the file named buy-buttons.liquid rather than main-product.liquid. The buy-buttons.liquid file controls the "Add to Cart" and "Buy" buttons for the Dawn theme.

Getsitecontrol provides various methods for adding the widget, and I recommend following the instructions below as this would work best with your theme's current code. Edit the code that controls the Add to Cart button to include the data-getsitecontrol attribute, following their instructions and that should do it.

PaulMartin_1-1724924820676.png

 

If the process seems overwhelming, I’m here to assist! For just $15, I can take care of the modifications for you. Simply let me know in the comments or reach out through the contact links below.

Contact here for WhatsApp | Email
$20 start rate for theme fix & customization
Don't forget to like and mark as solution

View solution in original post

Replies 5 (5)

PaulMartin
Shopify Partner
443 52 106

Do you plan to add this code to everywhere in your store?

Contact here for WhatsApp | Email
$20 start rate for theme fix & customization
Don't forget to like and mark as solution
mediland_uk
Tourist
29 0 1

yes, to add "Add to cart button".

PaulMartin
Shopify Partner
443 52 106

This is an accepted solution.

Okay. 


To make the changes required by Getsitecontrol, you'll need to update your theme's code. Specifically, you should look for the file named buy-buttons.liquid rather than main-product.liquid. The buy-buttons.liquid file controls the "Add to Cart" and "Buy" buttons for the Dawn theme.

Getsitecontrol provides various methods for adding the widget, and I recommend following the instructions below as this would work best with your theme's current code. Edit the code that controls the Add to Cart button to include the data-getsitecontrol attribute, following their instructions and that should do it.

PaulMartin_1-1724924820676.png

 

If the process seems overwhelming, I’m here to assist! For just $15, I can take care of the modifications for you. Simply let me know in the comments or reach out through the contact links below.

Contact here for WhatsApp | Email
$20 start rate for theme fix & customization
Don't forget to like and mark as solution
mediland_uk
Tourist
29 0 1

added the code. thank you.

 

PaulMartin
Shopify Partner
443 52 106

You're welcome! 🙂

Contact here for WhatsApp | Email
$20 start rate for theme fix & customization
Don't forget to like and mark as solution