Add to cart adding random quantities

Shopify Expert
6 0 0

Looking for some help from you Shopfiy coders out there.

This issue seems to have just cropped up, but in IE and Chrome only, our add to cart buttons are suddenly just adding random quantities to the cart. We have a pretty heavily customized theme, but the issue is new. We've tried stripping down the product.liquid and cart.liquid pages to bare bones and still the issue persists.

Complicating matters is the fact that we have the exact same code on the dev version of the store and it behaves differently - not necessarily correct, but differently. VERY frustrating. Any help would be much appreciated.

Here's the site so you can see the behavior:

http://www.salazonchoc.com/collections/chocolate

Try add to cart directly from the collection page or from the product detail page, both exhibit the behavior in Chrome and IE.

0 Likes
Shopify Expert
196 0 23

Hi Rob,

When I click the Add to Cart button there seems to be multiple requests sent to the add url which will add a product to the cart.

Noting in your form shows why this is. Perhaps some javascript code is messing with your submission. I tried to find the issue but can't track it down. You might want to have a developer dig into this.

-Ryan 

Stop Stressing About Shopify You’ve Got Better Things To Do => https://320ny.com/shopify/
0 Likes
Shopify Expert
6 0 0

Hi Ryan, thanks for the reply. We are the developers, and we're completely stumped. We've disabled everything we can think of, and still we're getting this behavior in Chrome and IE. Was hoping someone might have run into this before and could shed some light because we have tried just about everything to resolve this.

0 Likes
Highlighted
Shopify Expert
196 0 23

Hi Rob,

Have you tried starting with a seperate product template surrounded by a basic layout? You can then start to add stuff back in. Maybe that could help you discover the bug.

-Ryan

Stop Stressing About Shopify You’ve Got Better Things To Do => https://320ny.com/shopify/
0 Likes
Shopify Expert
6 0 0

Ryan-

We have tried EVERYTHING. Thought maybe it was javascript, but turning javascript completely off in Chrome and running the site still yields the same result. We've stripped out everything in the theme, product and cart files, short of what's necessary to add items to the cart, and still the same thing. The only thing that has worked is switching to a completely different theme, which is obviously not really helping. There's clearly something on one of the pages causing an issue, but we've literally tried everything we can think of to isolate it, and no joy.

0 Likes
Shopify Expert
9981 84 1492

On first glance it looks like the script from recurhub.com is the cause. You can track the source of the add calls back to their script.

I don't see the issue with js disabled.

To further that thought you can see your store has multiple instances of the recurhub code being added:

var urls = ["https:\/\/www.recurhub.com\/shopify.js?shop=salazon-chocolate-co.myshopify.com","https:\/\/www.recurhub.com\/s..."];

Multiple additions likely mean multiple instances in which their code will run. Time for you to talk to recurhub I think.

★ Winning Partner of the Build a Business competition. ★ http://freakdesign.com.au
0 Likes
Shopify Expert
6 0 0

Hi Jason, thanks for the reply. I initially thought it was resolved with javascript disabled, and while it does seem to improve, we're still seeing multiple quantities being added randomly. It seems to take a few more clicks, but it eventually still happens.

I'll definitely check into the recurhub script.

 

Thanks!

0 Likes
Shopify Expert
6 0 0

Jason-

You're a rock star! That appears to have been the culprit. We had the recur app pulled, and the issue seems to have resolved. Much appreciated, we've been banging our head against the wall trying ferret out the issue. It's odd though because when we were debugging the javascript in the console we weren't seeing the recurhub script on the add to cart listener - just missed it.

Thanks again!

0 Likes
Shopify Expert
196 0 23

Good stuff Rob, glad you found your issue. Jason is sort of an awesome magical wizard in these parts. 

Stop Stressing About Shopify You’ve Got Better Things To Do => https://320ny.com/shopify/
0 Likes