WooCommerce 按長度、重量及面積銷售商品(2027)
Selling Products by Length, Weight and Area in WooCommerce in 2027
WooCommerce 可透過合適的擴充功能或自訂計算,按長度、重量、面積等單位銷售商品;商店須先界定售價單位、客戶輸入的數量及庫存單位。按整箱出售時,應根據所需覆蓋面積計算整箱數量,並按整箱數量計價;庫存亦須反映實際可供應的長度或整箱數量。
A customer needs 2.4 metres of cable, 750 grams of coffee or enough flooring to cover a room measuring 12 square metres. These purchases look similar in a shopping cart, yet their underlying business rules are very different. One product is cut from a roll, another is weighed, and the third is supplied in complete cartons. Designing the website around a conventional count of items can lead to incorrect prices and inventory. WooCommerce can accommodate measurement-based products with suitable extensions or custom calculations, provided the store's operational requirements are defined first.
Identify the unit of sale
- Length: fabrics, rope, cable, tubing and trim.
- Area: flooring, tiles, sheet materials and glass.
- Weight: coffee, loose ingredients and industrial supplies.
- Volume: liquids, soil, mulch and aggregates.
- Pack quantities: materials supplied in predefined cartons or bundles.
Determine the price unit, the quantity a customer requests and the inventory unit. These need not be identical. A flooring retailer might display a price per square metre while selling entire cartons and maintaining stock in cartons. A cable supplier might price per metre, accept centimetre increments and manage total stock in metres. For international markets, establish the measurement system used in each catalogue and avoid confusing metres with yards or kilograms with pounds.
Direct measurement-based pricing
In its simplest form, measurement pricing multiplies the requested quantity by the unit price. An illustrative product costing 15 EUR per metre will cost 36 EUR for 2.4 metres before delivery or additional services. This example is not a market price quotation.
If coffee is priced per kilogram but customers enter grams, convert their input before calculating the total. A request for 750 grams represents 0.75 kilograms. Define acceptable measurement precision and minimum increments. A fabric store might allow increments of 0.1 metres, while a specialist component supplier may require centimetres or millimetres.

Pricing by area, dimensions or volume
For an area-based product, customers might enter the desired area directly or specify length and width. A glass panel measuring 1.2 by 0.8 metres has an area of 0.96 square metres. If the business charges a minimum area of one square metre, explain this rule and calculate the price accordingly. The requested dimensions should remain available for manufacturing even when the charged measurement differs.
For soil or another product priced by volume, the calculator might multiply length, width and depth. Convert all three inputs to the same measurement system before multiplying. Converting weight into volume requires a reliable material-specific density; a universal conversion between kilograms and litres would be misleading.
Flooring and tiles sold in complete packs
Suppose a customer wants to cover 12 square metres and chooses an illustrative 10% allowance for cuts and waste. The required area becomes 13.2 square metres. If one carton covers 1.44 square metres, dividing 13.2 by 1.44 gives approximately 9.17 cartons. Rounding up to a whole number gives 10 cartons, covering 14.4 square metres.
The waste allowance depends on the installation pattern, room shape and manufacturer's recommendations. It is not a universal instruction to add 10%. Let customers adjust the allowance when appropriate. Show the original area, allowance, quantity of cartons and total area supplied. Calculate the actual order price from the number of full cartons, rather than the requested area.

Choose a WooCommerce implementation
Standard product variations may be sufficient when the merchant sells coffee in fixed 250 g, 500 g and 1 kg packages. Each option can have a distinct SKU and price if required. Standard whole-number quantities also work well for cartons when the customer already knows how many to order.
For custom measurements, consider the WooCommerce Measurement Price Calculator. Its documentation distinguishes calculations that determine the number of predefined packages from calculations in which customers enter the measurements of a custom item. It also describes options for measuring inventory. Simpler decimal quantity scenarios may be handled using an extension such as Product Quantity.
WooCommerce's standard measurement settings for product dimensions and weight are not, by themselves, a complete measurement pricing system. More complicated requirements, such as production formulas, cut optimisation and stock management for individual rolls, might justify a custom extension. Test the actual workflow using representative products rather than selecting software solely by its advertised feature list.
Inventory needs to reflect physical availability
If 2.4 metres of cable are sold from a 100-metre roll, 97.6 metres remain before any cutting loss. However, total inventory does not necessarily describe the lengths physically available. Two rolls with remaining lengths of four and six metres cannot supply a single continuous eight-metre piece.
A merchant selling long or precisely cut materials may need to track individual rolls, batches and unusable remnants. For carton-based products, deduct whole cartons from stock. Establish when stock is reserved and how unpaid cancellations, completed cuts and returns are handled. Do not automatically return physically altered material to the available inventory.
When connecting warehouse software, ERP or a bulk product feed, verify that the receiving system understands decimal measurements and product-specific units. Our guide to WooCommerce product imports covers broader preparation of product records and imports.
Product page, cart and checkout
The buyer needs to see precisely what will be delivered. Two pieces measuring 2.4 metres each are not the same physical order as one 4.8-metre piece. Keep the requested dimensions in the cart line, order confirmation and warehouse instructions. Ensure that changing the number of pieces does not accidentally replace the required dimensions or alter the calculation.
For cut-to-size products, identify any machining, cutting or finishing fee separately. A glass supplier might apply a minimum charge and an additional cost per processed edge. Validate all required inputs, including minimum and maximum dimensions, before accepting orders. Use server-side calculations to ensure that altered browser data cannot override the real product price.
Shipping measured goods
The measurement used to calculate the product price is not always the measurement used to calculate shipping. A long section of lightweight tubing might be expensive to deliver because it exceeds the carrier's parcel dimensions. Tiles may need pallet delivery based on weight and fragility rather than an ordinary parcel.
Work with the carriers used for the actual destinations. US merchants may need to consider carrier rules using imperial measurements; European shipments often use metric dimensions. Determine the packed weight, largest parcel dimension and suitable shipping services. Test what the customer sees when an order cannot be shipped by the usual method.
Search, product feeds and unit prices
Display units clearly on product cards, detail pages and the checkout. A product advertised at 15 EUR per metre should not be mistaken for a complete package costing 15 EUR. Google's merchant listing structured data documentation discusses unit pricing measures. Ensure the advertised offer represents a genuinely purchasable configuration and that price information remains consistent on the destination page.
Test the complete workflow
- Enter minimum, maximum, fractional and invalid measurements.
- Confirm conversion, rounding and pack calculations.
- Check several differently measured cart lines.
- Try ordering more than the actual stock permits.
- Verify order details, payment totals, delivery and stock deductions.
- Test cancelled orders and refunds against warehouse procedures.
Repeat the tests after changes to the calculator, checkout, product import or payment integration. Include mobile devices and both guest checkout and registered customer scenarios if the store supports them.
Frequently asked questions
Can WooCommerce sell a fraction of a kilogram?
Yes, with an appropriate decimal-quantity or measurement-based pricing implementation. Check that connected stock and fulfilment systems support the same precision.
Can the store charge for custom cutting or finishing?
Yes. A calculator can incorporate specific charges and minimum prices. Explain these costs to customers before they add products to the basket.
Can one store sell both measured and countable products?
Yes. Select the correct selling model for each product or category and test mixed carts.
Conclusion
Measurement-based ecommerce requires a coordinated approach to pricing, physical stock and order fulfilment. CianBay Studio develops WooCommerce online stores with measurement calculators and specialist product workflows for clients in Ukraine and internationally.
Originally published at CianBay Studio.
Disclosure: This article was prepared with AI assistance.
來源:DEV Community · dev.to