Sell by weight or by the metre in PrestaShop.

Customers enter the amount they need (1.25 kg, 2.40 m), tap a quick amount and see the total while they type. Cart, checkout, order, invoice, shipping weight and stock all follow the amount, on PrestaShop 8.2 and 9.x.

  • v1.0.3
  • PrestaShop 8.2 – 9.x
  • 30-day refund on a first licence
Velvet by the metre: amount field, quick amounts and the live total
Yarn by weight in kilograms with gram steps
Category page with prices per metre
Cart with the measured length and the price per metre

The problem

Why PrestaShop sells in whole pieces

PrestaShop stores quantities as whole numbers everywhere: cart, orders and stock. A fabric shop cannot sell 2.40 m, and a cheese shop cannot sell 1.25 kg.

The usual answers are combinations per length or weight, or customization fields that do not touch price, weight or stock.

Three ways to sell by measure

ApproachHow it worksTrade-off
One combination per amountCombinations such as 0.5 m, 1 m, 1.5 m.No free amounts, and stock is split across combinations.
Override the cartOverrides that make the cart accept decimals.Breaks on upgrades and clashes with other modules.
Measured line, no overridesWhat Sell by Weight & Length doesEach line is one piece of the measured amount, priced and weighed by the amount, with exact decimal stock next to PrestaShop’s.The line quantity is 1 with "Weight: 1.25 kg" on it, because PrestaShop stores whole numbers.

Sell by Weight & Length for PrestaShop

How it works

  1. 01

    Choose a unit

    On the product (Modules tab) or once per category: one of 15 units, step, minimum, maximum, default amount and up to 8 quick amounts.

  2. 02

    Customers pick an amount

    They type 1.25 or tap a quick amount and see the live total. The product price is the price of one unit.

  3. 03

    Everything follows

    "Weight: 1.25 kg" shows in cart, checkout (also the 9.2 one-page checkout), e-mails, PDF invoices and the back-office order; stock and shipping weight use the amount.

What you get

15 sale units

Weight, length, area and volume, per product or per category.

Live total

Amount field with quick amounts and the total as the customer types.

PrestaShop prices

Specific prices, catalog price rules, group discounts, taxes and currencies apply as usual.

Exact decimal stock

Kept by the module (8.75 kg); PrestaShop’s own stock shows it rounded up.

Real shipping weight

Weight of one unit × amount for every measured line.

No overrides

Hooks and module customizations only; Classic and Hummingbird themes.

Made for

  • Fabric and haberdashery
  • Yarn and wool
  • Cheese and deli
  • Flooring and tiles
  • Rope and cable
  • Paint and liquids

Sell by Weight & Length for PrestaShop

Screenshots

How to sell by weight or length in PrestaShop

PrestaShop counts in whole units. Common workarounds are combinations such as 250 g, 500 g and 1 kg, or a module that changes the price but leaves the quantity at 1. Combinations limit customers to fixed sizes and multiply your stock lines.

Sell by Weight & Length lets customers type the amount they need: 1.25 kg of coffee, 2.40 m of fabric, 3.5 m² of flooring, 0.75 L of paint. Prices go through PrestaShop’s own calculation, so specific prices, catalog price rules, group discounts, taxes and currencies keep working, with no overrides.

What customers see

  1. The product page shows the price with "/ kg", an amount field with − and + buttons, quick amounts such as 250 g and 1 kg, and the limits, such as "Min. 0.10 kg · max. 5.00 kg · steps of 0.05 kg". It replaces the theme’s quantity field.
  2. A live total shows "Total $14.88 (1.25 kg × $11.90 / kg)".
  3. Each amount is its own cart line, with "Weight: 1.25 kg" and "Price per kg: $11.90".
  4. The amount appears in checkout, order confirmation, order history, e-mails and PDF invoices, and on the back-office order page.

Adding the same amount again raises that line’s quantity, so 2 × 1.25 kg is two pieces of that amount. The cart quantity field counts pieces of an amount, and a different amount is a new line.

On product lists, "/ kg" shows after the price. Themes with an add-to-cart button in lists, such as Hummingbird, show See details instead, because an amount is needed.

Setting up a product or a whole category

In the product’s Modules tab, open Sell by Weight & Length and click Configure. The block saves on its own.

Product settings
FieldExampleMeaning
Sale unitKilogramPrice and weight become those of one unit.
Step0.05Up to 4 decimals. Empty means 0.01.
Minimum / maximum0.1 / 5Per cart line.
Default amount0.5Shown when the page opens.
Quick amounts0.25, 0.5, 1, 2Up to 8 buttons.
Exact stock12.35One field per combination.

There are 15 units: kg, g, lb, oz, m, cm, ft, yd, in, m², ft², L, ml, gal and fl oz.

For a department, set Category defaults on the module page. Products set to Use the category default take the rule of their default category, then its parents, then their other categories. Choose Whole items to exempt a product.

Combinations use the settings of their product, and each combination’s price and weight impact applies per unit. PrestaShop’s own Stocks quantity shows exact stock rounded up, so 12.35 shows as 13. Orders reduce stock exactly, and cancellations restore it. Weight-based carriers get the real shipping weight.

What to expect

  • PrestaShop stores whole quantities, so a measured line is one piece of 1.25 kg. The amount is part of the line, and two pieces of the same amount show quantity 2.
  • Packs and virtual products are not sold by measure.
  • A product has one sale unit, so sell a pre-packed and a loose version as separate products.
Ways to sell measured goods on PrestaShop
CombinationsPrice-by-size moduleThis module
Any amountNoYesYes, to your step
Uses core pricesYesVariesYes
Exact decimal stockPer combinationOften notYes
Amount on PDF invoiceCombination nameVariesYes
OverridesNoSometimesNo

If you only sell three pack sizes, combinations are free and simpler. Choose real amounts when customers order what they need.

Works well with

The Pantry theme shows Choose amount on cards and styles the amount field; the Pantry Store Kit bundles both. EU E-Invoicing carries measured quantities with their unit. Product Personalizer works on the same cart line. The Made-to-Order Pack is on the packages page. Our guide compares options across platforms. Get Sell by Weight & Length on the store.

Compatibility

One package for PrestaShop 8.2 and 9.x, on Classic and Hummingbird, tested with the 9.2 one-page checkout. One small script loads on product pages only. No overrides.

Example setups by product type

Suggested starting values
ProductUnitStepQuick amounts
Coffee or teag50250, 500, 1000
Cheese or delikg0.050.25, 0.5, 1
Fabricm0.11, 2, 5
Rope or cablem0.55, 10, 25
Flooringm²0.015, 10, 20

Match the step to how you actually weigh and cut. A step of 0.001 kg promises what your scales may not deliver. Before launch, order one product on your live payment method, change the amount, cancel the order, and check that stock returns. Then check the PDF invoice, which is the document your customer keeps.

PrestaShop

Sell by Weight & Length for PrestaShop at a glance

Sell by weight, length, area or volume on PrestaShop 8.2 and 9.x: amount field with quick amounts and live total, exact decimal stock and real shipping weight. No overrides.

Price
$99 one-time
Version
1.0.3
Compatible with
PrestaShop 8.2 – 9.x
PHP
7.2.5 or newer (8.1+ for PrestaShop 9)
Licence
One store, no subscription, 12 months of updates
Refund
30-day refund on a first licence

PrestaShop

The PrestaShop products stores buy first

The most requested products on this platform. Each one has its own page, and you can buy it straight on the sales site.

Shop PrestaShop on our sales site

Prices, licences, full documentation and instant downloads are on the store.

prestashop.kaviolabs.com · 14 modules · 11 themes

Sell by weight

The same feature on other platforms

Built natively for each platform, not ported. Each version has its own product page, documentation and price.

Guide

Related guide

Guide

Selling by weight compared

How five platforms handle 1.25 kg or 2.5 m, the usual workarounds and what to check before you choose.

Read the guide

FAQ

Questions and answers

Why is the quantity of a measured line 1?

PrestaShop stores quantities as whole numbers. A measured line is one piece of 1.25 kg: the amount is part of the line and its price is the price of 1.25 kg. Two pieces of the same amount show quantity 2.

Do discounts work?

Yes. Specific prices, catalog price rules and group discounts apply to the unit price; cart rules work on the cart as usual. Quantity-based specific prices count pieces, not kilograms.

Which weight is used for shipping?

The product weight (plus the combination weight impact) is the weight of one unit; the line weight is that × the amount.

Does it use overrides?

No. It uses PrestaShop hooks and module customizations, so updates of PrestaShop and other modules are not affected.

Do specific prices and catalog rules still work?

Yes. Prices go through PrestaShop’s own calculation, so specific prices, catalog price rules, group discounts, taxes and currencies keep working.

Can I set this once per category?

Yes. Category defaults have the same fields, and products can inherit them or opt out.

Does it work with combinations?

Yes. Combinations use the settings of their product, and their price and weight impact applies per unit.

How does stock work?

Exact stock is held per combination. The Stocks quantity shows it rounded up, orders reduce it exactly, and cancellations restore it.

Sell by the metre and the kilo

See the product, category and cart screens and read the documentation on the product page.

Kavio Labs

Also by Kavio Labs

The same standards, the same support desk and one licence portal on every platform we build for.