Sell by weight or length in CS-Cart.

Shoppers buy 1.25 kg of cheese or 2.6 m of rope. The price is per unit, the cart shows "1.250 kg × $12.99 / kg", and stock goes down by the exact amount. No core file is changed.

  • v1.0.0
  • CS-Cart 4.17.2 – 4.21.x, Multi-Vendor
  • 30-day refund on a first purchase
Cart: decimal quantity, unit price and exact line total.
Mini cart: 1.250 kg and the line total.
Checkout summary with the quantity and unit price.
Product editor: sale unit, step, minimum, maximum, default, presets, exact stock.

The problem

Why CS-Cart cannot sell 1.25 kg on its own

CS-Cart counts products in whole items. Stores that sell cheese, coffee, fabric, rope, cable or flooring end up creating "100 g" products, or rounding up and refunding the difference.

Both workarounds break something: the price per kilo is hidden, stock is counted in packs, and invoices do not show what was actually sold.

Three ways to sell by measure

ApproachHow it worksTrade-off
Pack-size productsOne product or option per pack: 100 g, 250 g, 1 kg.No free amounts, and stock is split across packs.
Round up and refundSell whole units and refund what was not delivered.Manual work on every order, and confusing for shoppers.
True decimal quantitiesWhat Sell by Weight & Length doesThe quantity itself becomes 1.250 kg, priced per unit, through cart, order, invoice and stock.Needs an add-on that also handles taxes, promotions and payment gateways correctly.

Sell by Weight & Length

How it works

  1. 01

    Choose a sale unit

    Open a product and choose its unit (kg, g, lb, m, ft, m², L and more), the step (down to 0.001), the minimum, the maximum and preset buttons.

  2. 02

    Shoppers pick an amount

    They type 1,25 or tap 250 g, 500 g or 1 kg. The price shows "/ kg" on product pages and lists.

  3. 03

    Everything follows the amount

    Cart, checkout, orders, invoices and e-mails show the real quantity; orders take exact stock and cancellations give it back.

What you get

Decimal quantity field

With unit, step, minimum and maximum; the cart merges and corrects quantities.

Preset buttons

Quick amounts such as 250 g, 500 g and 1 kg next to the field.

Price per unit

Lines priced to the cent, with taxes, promotions and quantity discounts.

Exact stock

Decimal remainders, restored on cancellation and return.

Gateways keep working

Payment line items are sent so gateways that accept whole quantities still work.

Import, API, vendors

Import/export columns, REST API fields, order editing, and vendors set units for their own products.

Made for

  • Cheese, meat and deli
  • Coffee, tea and spices
  • Fabric and ribbon
  • Rope, chain and cable
  • Flooring and tiles
  • Paint and liquids

Sell by Weight & Length

Screenshots

How to sell by weight or length in CS-Cart

CS-Cart counts products in whole items. The quantity field, the cart, the stock and the order lines are all integers, which is fine for shoes and awkward for cheese, coffee, fabric, rope, cable or flooring. Stores work around it in two ways: they create a "100 g" product and ask for 13 of them, or they round up and refund the difference.

Both show. The 100 g product confuses shoppers and makes the order sheet hard to read, and stock counts in units nobody weighs. Sell by Weight & Length keeps the real quantity on the order, in the stock and on every document: 1.250 kg of cheese, 3.5 m of rope, 2.4 m² of flooring, 0.75 L of olive oil.

Supported units: kg, g, lb, oz, m, cm, ft, yd, in, m², ft², L, ml, gal and fl oz. The short labels are language variables you can rename.

What the shopper sees

  1. The product page shows the price per unit ("$12.99 / kg") and a quantity field that takes decimals with a dot or a comma.
  2. Plus and minus buttons follow your step, and preset buttons fill in common amounts such as 250 g, 500 g and 1 kg. The line total updates while the shopper types.
  3. A quantity outside the step or the limits is corrected with a short notice, for example to 1.235 kg.
  4. The cart shows one line, "1.250 kg × $12.99 / kg". Adding the same product again adds to that line (1.25 kg + 0.5 kg = 1.75 kg).
  5. If less is in stock than requested, the quantity is reduced to what is left, with a notice.

Customer pages, invoices, packing slips and order e-mails show the measure in the quantity column. On Nova (4.21) the add-to-cart stepper is replaced by the decimal field for these products. On product lists, Add to cart adds the default quantity.

Setting up a product sold by the kilo or metre

Open the product, General tab, section Sell by weight, length, area or volume:

Product fields for a measured product
FieldExampleMeaning
Sale unitKilogramWhole items keeps the product as it is. Any unit switches on decimals; the price becomes the price of 1 unit.
Quantity step0.005Smallest change, up to 4 decimals. It also sets the decimals shown.
Minimum / maximum0.1 / 5Per line, in the sale unit.
Default quantity0.5Pre-filled on the page and used by Add to cart in lists.
Preset quantities0.25, 0.5, 1Up to 8 buttons. Below 1 kg they read 250 g.
Exact stock8.750The real stock in the sale unit.

For shipping by weight, set the product’s Weight to the weight of one sale unit (1 for kg). Quantity discounts work in the sale unit, so a discount from 5 applies from 5 kg.

For large catalogs, seven import and export columns set the same fields, and the REST API reads and writes them. Vendors can set units on their own products while the setting allows it.

How prices and payments stay exact

The line price is the unit price times the quantity, rounded once: 12.99 × 1.25 = 16.2375, so $16.24. Taxes, cart promotions, coupons and currencies all work from that line. Payment services receive each line as "1 × line total", because PayPal, Stripe and similar gateways only accept whole quantities. The order total does not change.

Known limits, so nothing surprises you later

  • In the admin order list, a measured product is one line with quantity 1. The exact amount appears under the product name, as "Quantity: 1.250 kg × $12.99 / kg". Shipments count lines too.
  • Core reports that count items count lines: 1.250 kg is one item. Amounts such as revenue, tax and discounts are exact.
  • A product has one sale unit. To sell by weight and in fixed packs, use two products or variations.
  • The core In stock field holds whole numbers, so it shows the exact stock rounded up (8.750 kg shows 9). Changing it by hand sets the exact stock to that whole number; use Exact stock for fractions.
  • Warehouses in 4.21 Multi-Vendor keep counting whole units for these products. Stock tracking must be by product.
  • The core minimum, maximum and step fields are not used for measured products; the add-on’s own fields are.

Options compared: pack products, variations or real decimals

Ways to sell loose goods in CS-Cart
"100 g" productVariationsDecimals
Any amountMultiples onlyFixed sizes onlyYes, to your step
Stock in real unitsNoPer variationYes, shared
Invoice shows real quantityNoPartlyYes
Setup per productLowHighLow
Item-count reportsAccurate in packsAccurateCount lines

If you only ever sell 250 g and 500 g bags, variations are fine and you do not need this add-on. It pays off when customers order what they need rather than what you packed: deli counters, fabric, cable, flooring, bulk foods.

Our guide to selling by weight on each platform compares the options in more detail. For custom-cut prices based on two dimensions, look at Advanced Product Options & Price Formulas. Min/Max Order & Quantity Rules applies its rules in the sale unit, and EU e-Invoicing carries the measured quantities and units. Get Sell by Weight & Length on the store.

Versions, themes and editions

CS-Cart and Multi-Vendor 4.17.2 to 4.21.x, PHP 7.2.5 to 8.3 as your version supports. Works with Responsive, Bright, Nova and themes based on them, including the Kavio Labs themes. The 4.21 full page cache is supported, because product pages are the same for every visitor. On Ultimate, product settings are shared like the product, and settings are per storefront.

CS-Cart

Sell by Weight & Length at a glance

Sell products by weight, length, area or volume: decimal quantities such as 1.250 kg with step, minimum, maximum and preset amounts, priced to the cent and tracked in stock.

Price
CS-Cart $129 · Multi-Vendor $169 (one-time)
Version
1.0.0
Compatible with
CS-Cart 4.17.2 – 4.21.x, Multi-Vendor
Licence
One production store, perpetual, 12 months of updates and support
Refund
30-day refund on a first purchase

CS-Cart

The CS-Cart 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 CS-Cart on our sales site

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

cs-cart.kaviolabs.com · 98 add-ons · 29 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

Does it work with Multi-Vendor?

Yes. Vendors set the units of their own products, and it is tested on CS-Cart and Multi-Vendor.

Do promotions and quantity discounts still work?

Yes. Lines are priced to the cent with taxes, promotions and quantity discounts.

Will my payment gateway accept 1.25 kg?

Yes. Payment line items are sent in a form that gateways accepting only whole quantities can process.

Does it work with full page cache?

Yes. It works with full page cache, the Nova theme stepper and our Min/Max Order & Quantity Rules add-on.

Why does the admin order page show quantity 1?

CS-Cart stores whole quantities only, so a measured product is one order line that holds the exact amount. The line shows it under the product name, and customer pages, invoices and e-mails show it in the quantity column.

Does it work with product options and variations?

Yes. Option modifiers are added to the unit price, and each variation has its own sale unit and stock settings.

Can one product be sold by weight and in packs?

Not as one product, because a product has one sale unit. Use two products or variations, one with a sale unit and one sold in whole items.

What happens when an order is cancelled or returned?

Cancelled or declined orders and core RMA returns give back the exact quantity of each line.

Do sales reports show kilograms?

Core reports that count items count order lines, so 1.250 kg is one item. Revenue, tax and discount amounts are exact.

Start selling by the kilo or the metre

The product page has the full documentation, screenshots and the changelog.

Kavio Labs

Also by Kavio Labs

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