Press ESC to close

Or check our Popular Categories...

Discover the Latest Trends and Insights: Our Shopify Blog

S

Shopify Add ajax cart

1 Min Read
0 19
1 Min Read
0 19

<script> const form = document.querySelector(‘#product_form_7657105784993’); const btn = form.querySelector(‘[type=submit]’); form.addEventListener(‘submit’, (e) => { e.preventDefault(); btn.innerHTML = ‘<div class=”lds-ellipsis”><div></div><div></div><div></div><div></div></div>’; fetch(‘/cart/add.js’, { method: ‘POST’, headers: { ‘Content-Type’:…

Continue Reading