View Categories

How to Validate and Auto-Correct Cart Quantities

The “Add to cart” validation controls in the Min Max Step Quantity Limits Manager for WooCommerce decide what happens when a customer tries to add a quantity that breaks your rules: allow it, block it with a notice, or silently correct it. This is a free feature.

Add to cart validation options in the General section

Steps #

  1. Go to WPFactory > Quantity Manager > General (also reachable at WooCommerce > Settings > Product Quantity).
  2. Set “Add to cart” validation (wpfmmsq_add_to_cart_validation) to one of:
    • Do not validate: no check on add to cart.
    • Validate and add notices: block the invalid quantity and show a notice (recommended for most stores).
    • Validate and auto-correct quantities: adjust the quantity to the nearest valid value automatically.
  3. If you chose auto-correct, set Step auto-correct (wpfmmsq_add_to_cart_validation_step_auto_correct) to Round, Round up or Round down.
  4. Click Save changes.

Options reference #

Label Option ID Default Free/Pro
“Add to cart” validation wpfmmsq_add_to_cart_validation Do not validate Free
Step auto-correct wpfmmsq_add_to_cart_validation_step_auto_correct Round Free
Validate on checkout wpfmmsq_validate_on_checkout Yes Free

Tip: pair validation with Cart notices and Block checkout page (General section) so wrong quantities are caught on the cart too, not only at add to cart.

Get more control #

These controls are free. Min Max Step Quantity Limits Manager for WooCommerce Pro adds per-category and per-attribute rules to validate against. Per-product minimum, maximum and step are free. See what Pro unlocks.