Why does my store add the wrong variant to the cart?

Why does my store add the wrong variant to the cart?

stevo018
Visitor
2 0 0

I have 2x variant options available in my store but when someone selects a different variant from the second dropdown and clicks add to cart, the first/default variant is added.

 

www.ourtinyproject.co.nz

 

Could someone please let me know where to start to fix this?

 

Here are some screenshots:

stevo018_0-1673062423578.png

stevo018_1-1673062896288.png

 

 

Replies 3 (3)

Guleria
Shopify Partner
4088 801 1154

Hello @stevo018 ,

 

Seems you customized the code but forgot to wrap the variant selector html/code inside the form tag. Wrap variant code inside the form tag and it will start working.

 

Thanks

- Custom themes, UI/UX design, ongoing maintenance & support.
- Drop an email   if you are looking for quick fix or any customization
- Email: guleriathakur43@gmail.com Skype: live:navrocks1
- Try GEMPAGES a great page builder
stevo018
Visitor
2 0 0

Thank you, I'm going to start trying to fix it based on your advice. I've noticed that the quantities selected on the product page don't go through to the cart either. 

 

Will this be part of the same issue?

TobiasDalhof
Shopify Partner
32 5 13

Yes, this is most likely related.

 

To debug the issue, you can inspect the elements of your cart form to check if the hidden inputs are updating if you change the product variant.

 

It looks like your theme JavaScript is not listening for input changes, manually altering the hidden inputs works:

 

Sf35pPD.gif

— I'm building Delm Estimated Delivery Dates
— Was my reply helpful? Click Like to let me know.
— Was your question answered? Mark it as an Accepted Solution.