Product pages - Stay on the product page after adding products to the cart

Highlighted
Shopify Expert
150 0 29

there was a simple error in my code. This should work:

 

var cartTotal = cart.total_price;
              var cartGoal = 3500; // your number times 100 
              if (cartTotal >= cartGoal) {
                $('.announcement-bar__message').html('Your order qualifies for free shipping!');
              } else {
                var cartDiff = cartGoal - cartTotal ;
                $('.announcement-bar__message').html('Add just '+Shopify.formatMoney(cartDiff, "${{amount}}")+'to your cart to receive free shipping!');
              }
0 Likes
Highlighted
New Member
1 0 0

Hi there,

Thanks for sharing the updated code. I'm now however having the issue that I'm taken to the product page whenever I want to select the quantity prior to adding to cart on the shop/collection page. My site url is flwr-co-cookies.myshopify.com (password: veganisthefuture). I'm completely new to coding so if anyone has a solution for this, please let me know ASAP!

0 Likes
Highlighted
Tourist
14 0 0

Hello, do you mind posting a simpler version of this, so when someone adds a product to cart, the text on the add to cart button changes to "Added to cart!" momentarily instead of "Thank you!"?  I'd prefer it if an extra line didn't show up below the button, and I don't need the view cart or the continue shopping functions.

I'm using the Debut theme.

Thanks so much!

0 Likes
Highlighted
Tourist
14 0 0

Sorry, my previous post was supposed to be directed at @TyW, but if anyone else here knows how to do this, please share!  Thank you.

0 Likes
Highlighted
Excursionist
13 1 4

Hi

I've followed all the instructions and added the script code but it still has a short lag before taking me to the cart. Does anyone have a fix for this?

0 Likes
Highlighted
Shopify Expert
150 0 29

with this code implemented correctly, it should not take you to the cart anymore. There is probably an error somewhere in the implementation of the code. 

0 Likes
Highlighted
New Member
7 0 0

Could you tell me where to implement the code once more?

0 Likes
Highlighted
New Member
1 0 0

HI,

when I try to convert web language to English ( shop domain/en )

but it is not working and will redirect to  ./cart

0 Likes
Highlighted
New Member
4 0 0

Hi There! I added the <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> and Ajaxify cart works now. However the Cart icon on the top right corner of my theme is broken and does not go to the cart page. When hovered on it shows javascript&colon;void(0). As anyone experienced the same thing and knows how to fix this?

0 Likes
Highlighted
New Member
4 0 0

Need Help with broken Cart icon on my theme.

After adding <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script > as suggested in previous posts, the ajaxify-cart is functioning correctly but the cart link on theme is broken. When hovering on the icon is shows javascript&colon;void(0). How to fix this? Thanks.

0 Likes