Stock quantity display in product page not showing for some product.

Solved
Highlighted
New Member
6 0 0

hi, 

i am using supply theme and have enable quantity selection and to have quantity available balance messages displayed in product page.
the problem is some item displayed and some are not .

the code are in line 161 Section>product-template-liquid

<!--- Rosdi Quantity Selector --->
{% if section.settings.product_quantity_enable %}
<label for="quantity" class="quantity-selector quantity-selector-{{ section.id }}">{{ 'products.product.quantity' | t }}</label>
<input type="number" id="quantity" name="quantity" value="1" min="1" class="quantity-selector">
{% endif %}
<!--- Rosdi Quantity Selector End --->
<!--- Rosdi balance Display --->
{% if section.settings.product_quantity_message %}
<div id="variantQuantity-{{ section.id }}" class="variant-quantity {% if variant.inventory_management and variant.inventory_quantity < 10 and variant.inventory_quantity > 0 %} is-visible{% endif %}">
{% include 'svg-definitions' with 'stock-icon' %}
{% assign qty = variant.inventory_quantity %}
<span id="variantQuantity-{{ section.id }}__message">{{ 'products.product.only_left' | t: count: qty }}</span>
</div>
{% endif %}
<!--- Rosdi balance Display End--->

attached are the sample output of the product page.

not-avao.jpgavailable.jpg

 

0 Likes
Highlighted
Shopify Expert
154 17 21

This is an accepted solution.

Your if statement is checking if the inventory is less than 10 and greater than 0. Any amount outside of this will not show the message.

variant.inventory_quantity < 10 and variant.inventory_quantity > 0
W3trends is one of the leading app developers in the Shopify ecosystem. We can handle anything E-commerce or App related for your business. Feel free to message me if you need any work done!
0 Likes
Highlighted
New Member
6 0 0

cool and thanks.. 

0 Likes