Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hey there,
I would like to increase the quantity for ordering using decimal numbers (0.1, 0.2, 0.3...), not integers. That would apply only for products that use a default template (in the code below it's the first IF condition).
I hope you can give me a hand.
Regards,
Renko
{%- if template.suffix == nil -%}
<quantity-input class="quantity">
<button class="quantity__button no-js-hidden" name="minus" type="button">
<span class="visually-hidden">{{ 'products.product.quantity.decrease' | t: product: product.title | escape }}</span>
{% render 'icon-minus' %}
</button>
<input class="quantity__input"
type="number"
name="quantity"
id="Quantity-{{ section.id }}"
min="2"
value="2"
form="{{ product_form_id }}"
oninput="changeMaxQuantity(this, 24)"
>
<button class="quantity__button no-js-hidden" name="plus" type="button">
<span class="visually-hidden">{{ 'products.product.quantity.increase' | t: product: product.title | escape }}</span>
{% render 'icon-plus' %}
</button>
</quantity-input>
<script>
function changeMaxQuantity(_this, max) {
if (_this.value > max) _this.value = max;
return;
}
</script>
{%- else -%}
<quantity-input class="quantity">
<button class="quantity__button no-js-hidden" name="minus" type="button">
<span class="visually-hidden">{{ 'products.product.quantity.decrease' | t: product: product.title | escape }}</span>
{% render 'icon-minus' %}
</button>
<input class="quantity__input"
type="number"
name="quantity"
id="Quantity-{{ section.id }}"
min="1"
value="1"
form="{{ product_form_id }}"
>
<button class="quantity__button no-js-hidden" name="plus" type="button">
<span class="visually-hidden">{{ 'products.product.quantity.increase' | t: product: product.title | escape }}</span>
{% render 'icon-plus' %}
</button>
</quantity-input>
{%- endif -%}
Solved! Go to the solution
This is an accepted solution.
Hi @Renko2022,
Shopify does not support you entering Quantity as Decimal Numbers. Refer https://shopify.dev/themes/architecture/templates/product#the-quantity-input
So this is not possible.
Hope it is clear to you.
This is an accepted solution.
Hi @Renko2022,
Shopify does not support you entering Quantity as Decimal Numbers. Refer https://shopify.dev/themes/architecture/templates/product#the-quantity-input
So this is not possible.
Hope it is clear to you.
Hi @Renko2022,
I saw you liked my answer. If it helped you solve your issue, please mark it as a solution. Thank you and good luck.
Hi,
Did we resolve this issue of getting quantity in Decimal Numbers as this is what i needs also.
Please do let me know how can that be done?
Thanks,
Amar
While Shopify does not support decimal order quantities, there is a workaround which is being used by most fabric stores. For example
The way it works is that the lowest fraction is considered a unit and quantities are manipulated for ordering the correct number. So 1.5 becomes 3 quantity of half unit.
how is it done? by app?
is this something that you helped implement? if so, we may need your services
I can do it for you
aatif6325@gmail.com
Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025Discover opportunities to improve SEO with new guidance available from Shopify’s growth...
By Jacqui May 1, 2025