Why does my cart automatically add a wrong size variant?

Hi guys,

Sorry if this has been asked but whenever someone adds a different size to cart XXS is automatically added. This has led to me having to make several refunds and stops people buying.

Below is my product.liquid. I know we had issues when a currency converter was added to the store, I had to have someone look at the code as suddenly all my images disappeared.

Show More
{%- if product.featured_image -%} {%- assign image_size = product.featured_image.width | append: 'x' -%} {%- endif -%} {%- if current_variant.sku != blank -%} {%- endif -%} {%- for variant in product.variants -%}
{%- if variant.sku != blank -%} {%- endif -%} 
{%- endfor -%} {% section 'product-template' %}
{% include "modal-video" %} {% render 'judgeme_widgets', widget_type: 'judgeme_review_widget', concierge_install: true, auto_install: true, product: product %} ```

Any help would be hugely appreciated!

  • S

When seeking theme help provide the name of that theme and/or inspectable publicly accessible urls so OTHER people can see and replicate an issue. We can’t see what you see.

Please don’t paste the entirety of a themes file as #1 you my not have distribution rights for doing that, and #2 it’s annoying to scan through hundreds of lines of code that may be irrelevant to the core problem.

https://community.shopify.com/c/blog/how-to-get-support-from-the-community/bc-p/1419945

If still able to edit your post please remove the code part. Nothing in there strongly indicates interference with the variant selectors, if it’s a script issue that could bear out by being able to inspect the actual page.

Here product.liquid may be irrelevant, the product form part of relevance that would be found through the contents of {% section ‘product-template’ %} , don’t paste the entirety of that either try to curate to the relevant part. Unless it’s from an open source theme like dawn.

A quick test is to disable javascript in your browser and try reproducing the issue to rule out html issues with the product form being rendered from liquid.

I can’t edit it thanks

That’s fine , do you have url where others can inspect the issue.

Goodluck

Yes it would be on the product page for example:

https://thebabybearboutique.com/collections/onesies/products/happy-bear-day-onesies

Thanks for your help so far