Have your say in Community Polls: What was/is your greatest motivation to start your own business?

Hide size variant buttons for non-stock variants

Solved

Hide size variant buttons for non-stock variants

Iceman3
New Member
21 0 0

Does anybody know how to hide the buttons of the non-stock variants in DAWN 13?

Thanks in advance for your help.

Regards,

 

screenshot1.jpeg

Accepted Solution (1)

Kyle_liu
Shopify Partner
285 38 51

This is an accepted solution.

1、Edit theme code

2、find the file: "product-variant-options.liquid" and edit it.

3、Find: "<input
type="radio"
id="{{ input_id }}"
name="{{ option.name }}"
value="{{ value | escape }}"
form="{{ product_form_id }}"
{% if option.selected_value == value %}
checked
{% endif %}
{% if option_disabled %}
class="disabled"
{% endif %}
>
<label for="{{ input_id }}">
{{ value -}}
{{ label_unavailable }}
</label>" is modified as follows

"

<input
type="radio"
id="{{ input_id }}"
name="{{ option.name }}"
value="{{ value | escape }}"
form="{{ product_form_id }}"
{% if option.selected_value == value %}
checked
{% endif %}
{% if option_disabled %}
class="disabled" style="display:none"
{% endif %}
>
{% if option_disabled == false %}
<label for="{{ input_id }}">
{{ value -}}
{{ label_unavailable }}
</label>
{% endif %}

"

 

 

If this is helpful, please Like and Accept the solution.
Want to modify or custom changes on store? Let me help.
- Feel free to contact me Email Me Buy Me A Coffee

View solution in original post

Replies 3 (3)

Kyle_liu
Shopify Partner
285 38 51

This is an accepted solution.

1、Edit theme code

2、find the file: "product-variant-options.liquid" and edit it.

3、Find: "<input
type="radio"
id="{{ input_id }}"
name="{{ option.name }}"
value="{{ value | escape }}"
form="{{ product_form_id }}"
{% if option.selected_value == value %}
checked
{% endif %}
{% if option_disabled %}
class="disabled"
{% endif %}
>
<label for="{{ input_id }}">
{{ value -}}
{{ label_unavailable }}
</label>" is modified as follows

"

<input
type="radio"
id="{{ input_id }}"
name="{{ option.name }}"
value="{{ value | escape }}"
form="{{ product_form_id }}"
{% if option.selected_value == value %}
checked
{% endif %}
{% if option_disabled %}
class="disabled" style="display:none"
{% endif %}
>
{% if option_disabled == false %}
<label for="{{ input_id }}">
{{ value -}}
{{ label_unavailable }}
</label>
{% endif %}

"

 

 

If this is helpful, please Like and Accept the solution.
Want to modify or custom changes on store? Let me help.
- Feel free to contact me Email Me Buy Me A Coffee
Iceman3
New Member
21 0 0

Works perfectly. I mark anwer as 'Accepted solution'

Thanks for your help!

LutzOtto
Visitor
1 0 0

It does not work on the empire theme. I tried every solution in the community for two days. Do you know how to hide sold out variants in the Empire theme? 

 

I would be grateful for a tip.