I’m currently building a Shopify store for a client who sells fabric materials. The store needs to sell products by the meter, and often in decimal values like 1.5 meters, 2.25 meters, etc.
I need help understanding:
How can inventory be managed in decimal quantities?
For example, if a fabric roll has 50 meters in stock, and a customer purchases 2.5 meters, the inventory should reduce to 47.5.
How can customers enter/select decimal quantities on the product page and cart?
Shopify’s default quantity selector only allows whole numbers. Is there a way to allow decimal input like 1.5 or 2.75 directly?
Is there an app or custom solution that works well for this use case (fabric, flooring, ribbon, etc.)?
Any guidance, app suggestions, or examples from someone who has done this before would be much appreciated.
Shopify’s native inventory system only supports whole number quantities. The inventory fields and mutations (such as inventorySetQuantities) expect integer values for inventory. This means you cannot natively track inventory in decimals (e.g., 47.5 meters) using the standard inventory fields.
Workarounds:
Track inventory in the smallest sellable unit (e.g., centimeters instead of meters). For example, if you have 50 meters, store it as 5000 centimeters, and when a customer buys 2.5 meters, deduct 250 units.
Custom App/Metafields: Build a custom app to manage and display inventory in decimals, storing the value in a product or variant metafield. You can update this metafield using the metafieldsSet mutation.
Liam: your explanation about Shopify’s native limitations and the idea of tracking inventory in the smallest sellable unit (e.g., centimeters) makes a lot of sense. I think this workaround could definitely work for my client’s case, especially since we need to maintain decimal-level precision for fabric measurements. I’ll explore that route along with using metafields for more customized display and tracking.
Luke: thanks a lot for suggesting the Sew Much Commerce app. I wasn’t aware of it before, but it looks like a perfect fit for fabric and textile-based stores. I’ll definitely review its features and test it to see how well it integrates with our needs.