View Categories

Decimal Quantities Causing Errors in Cart/Checkout

Table of Contents

Problem Description #

When you enable decimal/min‑step quantity options (e.g. 0.5, 1.25) and your store uses the new block-based cart/checkout of WooCommerce, you might see fatal errors or the plugin simply stops working for decimals.

Common Symptoms – Error Messages:

Cause:

  • The plugin’s decimal‑quantity support conflicts with WooCommerce’s block-based Cart/Checkout system, which (as of writing) does not reliably support decimals. Plugin authors have confirmed this limitation. WordPress.org+1

  • Decimal math + quantity normalization routines may trigger a division/modulo error when WooCommerce attempts to normalize cart items , particularly when the code assumes integer quantities. WordPress.org+1

Solution (step-by-step)

  1. Switch your cart/checkout to classic (legacy) mode.

    • Edit your Cart and Checkout pages and ensure they use the shortcodes
      Your cart is currently empty.

      Return to shop

      and
      rather than block-based templates. Many reports show decimals work when using classic. WordPress.org+1

  2. Test with a default theme and only WooCommerce + Min Max plugin active.

    • This avoids conflicts with other plugins and custom theme templates.

  3. Ensure your Min Max plugin is updated to the latest version. Developers sometimes release patches to improve decimal handling. WordPress.org+1

  4. If you must use block-based cart/checkout, avoid decimal quantities for now , use integer-only quantities or postpone decimal orders until decimal support is stable.

  5. Report to plugin developers if decimals are essential , include WooCommerce version, PHP version, and whether you use block-based or classic cart.

Prerequisites

  • Min Max plugin latest version.

  • WooCommerce version compatible with plugin (check tested up to version in plugin changelog). WordPress.org+1

Additional Notes

  • Many users on the forum opted to revert to classic cart/checkout to restore decimal support , this remains the most reliable workaround as of now.

  • Decimal quantities inherently increase complexity (stock math, normalization, compatibility). Use them only when necessary and test thoroughly.

 

Min Max Default Quantity for WooCommerce