Hi,
I input below the code in my main.product.liquid for make sold out variant to be disable.
{%- for variant in product.variants -%}
{% if value == variant.title %}
{% if variant.available == false %}disabled{% endif %}
{% endif %}
{%- endfor -%}
But I use “Notify me when back in stock”, So I want to make this sold out variant be clickable.
Is it possible to change? Here is my preview below :
https://okua9emvlihu3f7f-61683237082.shopifypreview.com
1 Like
@Ianlee221
oh sorry for any issue can you please share sold out product url
Hello @KetanKumar
Thank you for your reply!
Here is the link below :
https://itsdcode.jp/products/am1224fl004
Hi @Ianlee221 ,
Search for file product-variant-options.liquid and edit code like below
This will add a class named enable-notify class to label when the variant is out of stock. Now add the below SCRIPT at the end of the file.
This will bind the script to fire action. Attaching a screenshot for your reference.
Hope it helps…
Hi @gr_trading Thank you for your response!
I’ve tried to find “product-variant-options.liquid” you mentioned but unfortunately I cannot find it in my edit code section…
Seems you are not using DAWN 8.0 if it is then your code will be in main-product.liquid
Oh Yes your are right! Now I can see the product-variant-options.liquid and it works well.
Thank you!
I impemented this code but still it doesnt work
Hi @Christelle12 ,
Which theme you are working on?