HTML class is not adding as per I want

haseebJoiya
Shopify Partner
38 1 0

I have store URL https://quieromac.com/products/iphone-6s-reacondicionado?variant=43142806044927

 

I want here a class the variants which are out of stock should have class  out-of-stock in li tag. 

{%- for value in option.values -%}
                                                <li {% if variant.available == false %}class="out-of-stock"{% endif %}>
                                                 
                                                    <input type="radio"
                                                           id="option-{{ section.id }}-{{ forloop.parentloop.index0 }}-{{ forloop.index0 }}"
                                                           value="{{ value | escape }}"
                                                           name="options[{{ section.id }}-{{ option.name | escape }}]"
                                                           title="{{ value }}"
                                                           {% if option.selected_value == value %}checked{% endif %}
                                                           data-url="{{ product.url }}"
                                                           data-template="{{ section.id }}"
                                                        {% if show_images == false and is_color %}data-change=".data-change-to-option-{{ section.id }}-{{ forloop.parentloop.index0 }}"{% endif %}
                                                           form="{{ form_id }}"
                                                    >
                                                    <label for="option-{{ section.id }}-{{ forloop.parentloop.index0 }}-{{ forloop.index0 }}" >
                                                        {% if option_int -%}
                                                            {% assign option_variant = product.variants | where: option_int, value | first -%}
                                                            <picture>
                                                                <img class="no-pl-px" data-src="{{ option_variant.image | image_url: width: image_width_small, height: image_height_small }}" alt="{{ value }}" width="30" height="23">
                                                            </picture>
                                                        {% elsif is_color %}
                                                            <i aria-hidden="true" class="icon-circle swatch-custom-color-{{ value | handleize }}" style="background-color: {{ value | split: ' ' | last }};"></i>
                                                        {% endif %}
                                                    
                                                    
                                                        <span class="{% if option.variant.first.inventory_quantity == 0 %} outstock {% endif %}">{{ value }} </span>
                                                    </label>
                                                    
                                                </li>
                                                {%- endfor -%}

 

Please help me here how can I add this.

Haseeb Aqdas
Replies 3 (3)
JosephK
Shopify Partner
596 74 86

Hey,

That will difficult to check with that code because cannot imagine the context in this case it's also depend to your theme you are using. 

So to handle still need to go to code file and check directly.

You can please Like and Accepted Solution if my suggestion helpful. And if you want to customize or develop new feature on Theme or App => Contact to us via Email or Skype.
- Contact Support : Gmail | Skype: live:.cid.309f2fbaceec513
haseebJoiya
Shopify Partner
38 1 0

Send me Private message with your email so that I can add you as team member in partner account

 

Haseeb Aqdas
JosephK
Shopify Partner
596 74 86

Hi,

I sent the message to you. Please you can check it. Thanks!

You can please Like and Accepted Solution if my suggestion helpful. And if you want to customize or develop new feature on Theme or App => Contact to us via Email or Skype.
- Contact Support : Gmail | Skype: live:.cid.309f2fbaceec513