Why does the wrong product variant get added to the cart?

Hi all Shopify experts, hoping can get an answer to my problem. My problem is when I select a Large size on the product T-shirt then click add to cart. When I view a cart the product size shown was a small size which is the wrong size. (the image below is the error)

here’s the link to the store: https://greenerymarket.com/collections/clothing

I’m using the slate theme.

I used this code ajaxify-cart.liquid :


{% comment %}
  If you want to animate your feedback message.
{% endcomment %}

{% comment %}
{{ '//cdnjs.cloudflare.com/ajax/libs/animate.css/3.1.0/animate.min.css' | stylesheet_tag }}
{% endcomment %}

{{ '//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.0.3/css/font-awesome.css' | stylesheet_tag }}

Hi @Karen34 ,

I checked and there was no JS to change variant on select => it won’t work well. https://i.imgur.com/v19SbCB.png

Go to Assets > theme.scss.liquid and paste this at the bottom of the file:

.product-item [data-product-select]{
color: #797979;
font-size: 18px;
font-family: ‘Glacial Indifference’;
font-weight: normal;
font-style: normal;
width: 100%;
border: 1px solid #acacac;
padding: 1px 28px 1px 20px;
margin-bottom: 12px;
display: block !important;
}
.product-item .selector-wrapper select{
display: none !important;
}

Hope it helps!

If my answer can help you solve your issue, please mark it as a solution. Thank you and good luck.

1 Like

Wow, it works, Thank you so much, I really appreciated it.

Hi, I noticed that there is a default select option on the other product that has no variants like on the image. Thank you

@LitExtension I have a similar issue but I am using the Debut Theme. The size for the rings is always default (51) even when one selects a different size. Would you be able to help me? https://tartar-berlin.com/products/silberring-lift

Hi @Elisaw ,

You can create a question on the community and send me the link. I will check it.
Because this will help build a better community.
Thank you.