View Categories

Cart or Order Page Fails with Decimal Quantity Products

If a decimal quantity such as 1.5 breaks the cart or an order, switch your Cart and Checkout pages to the classic shortcodes and make sure Decimal quantities is on at WPFactory > Quantity Manager > General in Min Max Step Quantity Limits Manager for WooCommerce. Block carts do not support decimals yet.

Common symptoms #

  • The cart or order page errors, or the order refuses to move to another status.
  • Decimal quantities revert to whole numbers when the cart recalculates.
  • A payment gateway rejects or mishandles the decimal quantity.
  • You cannot enter a decimal quantity when editing an order in the dashboard.

Cause #

The block-based Cart and Checkout, and some gateways, expect whole-number quantities. When a decimal reaches them, normalization can fail or silently round the value. Quantity Manager’s own Decimal quantities option notes that decimal quantities are not supported yet in the Cart and Checkout blocks.

Fix #

  1. Use the classic Cart and Checkout. Set your Cart and Checkout pages to the [woocommerce_cart] and [woocommerce_checkout] shortcodes.
  2. Leave block compatibility off. In Advanced, Woocommerce block compatibility casts minimum, maximum and step to whole numbers for block carts. It helps whole-number stores, but it removes decimals.
  3. Turn off rounding. In Advanced > Rounding Options, set Round on add to cart and Round with JavaScript to Do not round.
  4. Match your step to your decimals. In the Quantity Step section, use a step that produces the decimals you intend (for example 0.5), so quantities are always valid multiples.
  5. Enable admin decimals if you edit orders by hand: tick General > Decimal quantities in admin order.
  6. Check gateway compatibility. Test with a simple gateway (such as cash on delivery) to confirm whether a specific gateway is the cause.
  7. Update WooCommerce, Quantity Manager and the gateway to their latest versions.

Gateways and decimal quantities #

For PayPal Standard, Quantity Manager sends a decimal line as quantity 1 with the full line amount, because PayPal accepts only whole quantities. Other gateways receive the order as WooCommerce stores it. If one fails only on decimal orders, contact that gateway’s developer with a test order.

FAQ #

Will decimals ever work with the Cart block? #

That depends on WooCommerce adding decimal support to the Cart and Checkout blocks. Until then, the classic pages are the reliable option.

Do customers see the decimal quantity in emails and the order? #

Yes, the order stores the decimal quantity. To also keep a copy in a separate field, enable Advanced > Save quantity in order item meta.

Why does a valid-looking quantity fail the step check? #

Steps count from the minimum quantity. With a minimum of 0.3 and a step of 0.5, valid quantities are 0.3, 0.8, 1.3. Set the minimum to a multiple of the step.

Related: How to enable decimal quantities and Stock update fails with decimal quantities.

Still stuck? Our team answers every ticket on the Quantity Manager support forum.

 

Min Max Default Quantity for WooCommerce