I need help with this, I have this code in a liquid file:
<select name="id" class="original-selector" aria-label="{{ 'products.product.selector_label' | t | escape }}">
{% for variant in product.variants %}
<option value="{{ variant.id }}"
{% if variant == product.selected_or_first_available_variant %} selected="selected"{% endif %}
{% if section.settings.show_inventory_notice and variant.inventory_management == 'shopify' and variant.inventory_quantity > 0 %}
{% if section.settings.inventory_notice_threshold == 0 or variant.inventory_quantity <= section.settings.inventory_notice_threshold %}
data-inventory="{{ variant.inventory_quantity }}"
{% endif %}
{% endif %}
**data-stock="{% if variant.inventory_management == 'shopify' and variant.inventory_quantity <= 0 %}out1{% endif %}"**>{{ variant.title | escape }}</option>
<div class="container-inventory_quantity">
<p class="intem-inventory_quantity">{% if variant.inventory_management == 'shopify' and variant.inventory_quantity <= 0 %}out1{% endif %}</p>
</div>
{% endfor %}
</select>
When changing swatch(variant) the select is rebuilt and therefore:
data-stock=“{% if variant.inventory_management == ‘shopify’ and variant.inventory_quantity <= 0 %}out1{% endif %}”
When doing this process it does not get inventory_quantity and I need this to validate and add the out1, any idea how to do it?