11th October 2026

Selling fabric by the centimetre on Shopify


Bjarki Snorasson - Graphic Designer.

Written By Bjarki Snorrason

11th October 2026

The problem

Shopify sells whole units. A product has variants, each variant has a price, and customers add one, two or ten of them to the cart. That works for a jacket or a bag. It does not work for fabric, which makers buy by length, in whatever amount their project needs.

We recently built a Shopify store for a cloth retailer that sells fabric three ways: any length the customer chooses, set pre-cut sizes and samples. Custom length was the main challenge. Price, stock and shipping weight all have to follow the length the customer entered, and all three had to reach Shopify as standard order data so fulfilment, reporting and discounts kept working.

What we built

We used the cart quantity as the length. The custom length variant is priced per centimetre, so a customer buying 1 metre adds a quantity of 100. Shopify multiplies price by quantity as it does for any product, and the order total is correct without a pricing app or a checkout script.

Customers never see that number. On the product page they enter a length between 25cm and 5,000cm in a single field. The page converts it to metres and updates the price as they type. The cart confirms the order in metres and hides the quantity selector on custom length lines, where plus and minus buttons would change the length one centimetre at a time.

Stock and shipping use the same unit. Inventory is counted in centimetres, so 92 in stock means 92cm, and the stock message on the product page converts it back to metres. Shipping weight is set per centimetre to 4 decimal places: cloth weighing 0.57kg per metre is 0.0057kg per centimetre, so Shopify calculates the right parcel weight and delivery rate for any length. Custom length keeps selling beyond tracked stock, while pre-cut sizes stay limited to what is cut and on the shelf.

How we improved it

The product page shows custom length, pre-cut and sample as tabs. Customers who selected a pre-cut size first and then switched to custom length carried the pre-cut quantity across. A quantity of 1 became a length of 1cm, and a handful of live orders went through for 1cm of cloth before the client spotted them.

The fix has two parts. Every tab change resets custom length to the 25cm minimum, and add to cart checks the length again before the item reaches the basket. When a hidden value drives price and stock, the minimum on the visible field is not enough on its own.

Selling by length on Shopify

Using the cart quantity as the unit lets Shopify's own checkout, discounts and reporting do the work. The care goes into making price, stock and shipping weight agree on one unit, and checking the real quantity everywhere it can change.

Selling by length, weight or volume? We build Shopify stores around the way your products are actually sold. Tell us about your project.