quantity selector increement 0.5 in product page doesn't update in cart

Topic summary

A Shopify store owner selling fabric by the meter needs a quantity selector that accepts decimal increments (0.5m, 1m, 1.5m, etc.), but Shopify’s cart system only accepts integer quantities.

Core Issue:

  • Decimal quantity values (0.5, 1.5) entered via custom input fields don’t update in the cart
  • Prices fail to calculate correctly with non-integer quantities

Workaround Solution Provided:
DevoloperCZ implemented a dropdown menu approach:

  • Products are defined as 0.5m units with corresponding prices
  • A custom <select> element displays decimal values (0.5, 1, 1.5) to users
  • Backend processes integer quantities (1, 2, 3) that represent multiples of 0.5m
  • Code uses Liquid templating: {{ i|divided_by:2.0 }} to display halves while submitting whole numbers

Implementation:

  • Code placement varies by theme (main-product.liquid, product-quantity.liquid, or featured-product.liquid)
  • Requires replacing existing quantity input fields with the custom dropdown
  • One user shared their working implementation at antrikshstore.in

Alternative:
A third-party app (Measura: Sell by Weight & More) was suggested as a ready-made solution with configurable min/max values and increment steps.

Summarized with AI on October 29. AI used: claude-sonnet-4-5-20250929.

No sir

I have these files