Refresh "Add to cart" button after pressing on it

Solved
RomFarma
New Member
4 0 0

Hy guys!
I`m facing a problem and i hope you help me.
I`m using the free theme "Simple" and i wanted to add an "Add to cart" button to my collection list, because the theme support "Add to cart" button just in single product page.
After i followed the instructions from this thread " https://help.shopify.com/en/themes/customization/products/add-to-cart/stay-on-product-page-when-item... " from 1-9 instructions, i managed to add an "Add to cart" button on the products from the pages i wanted, but in the single product page i have the problem that when the customer clicks on "Add to cart", that button does not refresh (like the buttons that i added), and it cant add another product from that single product page, because it stays freeze saying "ADDED TO CART", until he manually refresh the page.
Can you help me to add the same button that refresh, or refresh the page itself, after a customer hit "Add to cart" from single product page?
Thank you!

0 Likes
Lixon_Louis
Shopify Partner
1186 35 239

It could be a js error.can you share the URL?

Get help at lixon@ecommercestudio.in
0 Likes
RomFarma
New Member
4 0 0

For example this is a single product page, and after you press "Add to cart (Adauga in cos)" it freezes and the customer needs to refresh the page if he wants to add again the same product to cart.

https://romfarma.com/products/kamagra-100-gold-pentru-erectie

0 Likes
Lixon_Louis
Shopify Partner
1186 35 239

This is an accepted solution.

Open the theme.js.liquid inside Assets folder. Go to line 1276 and add location.reload();

as a new line. See screenshot attached. This will reload the page after the product is added to cart.

 

Simple ~ Shopify 2019-08-12 21-20-13.png

Get help at lixon@ecommercestudio.in
RomFarma
New Member
4 0 0

Wow, man! You are the best! Thank you!!!!!

0 Likes
euklid
Tourist
7 0 6

I have the exact same problem but cannot find the location to dd this piece of code. Can someone help me please?

 

Product page does not refresh unless manually refreshed.



 

https://www.the-olivegrove.co.uk/


0 Likes
eliphino
New Member
1 0 0

thanks for this!

0 Likes
napoleantech
Tourist
4 0 2

help! I don't know where to put that line of code as I have the narrative theme. 

 

napoleantech.com

0 Likes