Whenever I want to click on a product, the size is automatically pre-selected. How can I fix this? Do you have any Idea?
https://bymo.ro/products/colanti-modelatori-tarix-negru-si-albastru
I’m using the dawn theme, version 14.0.0
Issue: On a Dawn 14.0.0 product page, a size variant is automatically pre-selected. The requester wants to prevent any variant from being selected by default.
What was tried: One reply suggested removing the “checked” logic in product-variant-options.liquid (lines 101–103):
Latest guidance: Another participant clarified that disabling preselection requires changes in both Liquid and JavaScript. Without JS changes, the theme still selects/submits a default variant, causing Add to cart to proceed with an unchosen size. An illustrative screenshot was shared; no exact JS file/code was provided.
Current status: The requester asked where exactly to implement the JS changes. No concrete file paths or full solution were given beyond the Liquid edit; screenshots are supportive but not essential to understand the issue.
Outcome: No resolution yet. Next step is to modify the theme’s JS to prevent default variant selection and block Add to cart until a size is chosen.
Whenever I want to click on a product, the size is automatically pre-selected. How can I fix this? Do you have any Idea?
https://bymo.ro/products/colanti-modelatori-tarix-negru-si-albastru
I’m using the dawn theme, version 14.0.0
Hello @robertsolcan
Go to Online store----------> Theme-----------> Edit code --------------------> find this file “product-variant-options.liquid” go to line number 101 to 103
you will see this code
{% if option.selected_value == value %}
checked
{% endif %}
remove this code and save it.
check screen short
Please let me know
it is half good, I mean that when I click on “Add to cart” , even though I haven’t chosen yet any size, it gives me the preselected size. Although, it doesn’t show that on the page.
Hello @robertsolcan
Welcome to Shopify Community.
You have to disable the preselected variants from the code and the JS. It needs some customization. Here’s an example of how it will look like :
Thanks
Ok, but can you help me do this? Please? Where should I do the changes? In which file?