It now appears the Select Option as the preselected variant but when you try to add it to the basket it is linked with the first available variant, so the problem is not fixed yet.
I provide the preview URL so that you can understand the issue.
Also, Add the below code in the “product-form.js”.
// Check for 'variant' parameter in the URL
if (variant_size > 1) {
let url = window.location.href; console.log('url', url);
let params = new URLSearchParams(url.split('?')[1]); console.log('params', params);
if (!params.has('variant')) {
// If 'variant' parameter doesn't exist, show error and exit the handler
alert('Please select the variant');
return false; // Exit the handler
}
}
Hello there,
I also would like to thank you very much for your working solution!
But, I’m still facing two issues.
First, even if the variants are now saying “Select option”, the default thumbnail of the products remains the one assigned to the first listed option.
How can I change that and bring back my initial first image of the product as product cover?
And second, if a product has to different variants, let’s say color and size, if I pick a color, in order to show the corresponded picture, I also have to choose the size.
How can I fix that?
I have the same issues. And the reason I want to disable the default variants is to show my initial first image of the product as product cover. How to fix it ?
Hello Rishihuptech Can you tell me please how to do it on dawn theme old trick is not working..
product-templete.liquid is no more now on dawn latest version
and also {% if value.selected %}
checked
{% endif %} I remove this lines on product-variant-options.liquid this is not working in front no select the variant but backend the function is working.. how to fix it in dawn theme new version.. my dawn theme currently new version is 14 right now.. i Want to fix it please help me out