Configuration
Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.
Minimum is configured entirely from WooCommerce → Minimum. Everything is stored in one option, minimum_settings (a single array): the enforcement switch, the list of rules, the minimum order total and the four notice messages. The screen requires the manage_woocommerce capability.
Enforcement switch
Section titled “Enforcement switch”A master on/off checkbox, labelled Enforcement and on by default (enabled in the option). Turn it off to keep every rule and the order-total saved but stop applying them at the cart and checkout, useful for a temporary sale or while you reorganise rules. With it off, Minimum adds no notices and blocks nothing.
Quantity rules
Section titled “Quantity rules”Each rule row has a scope, a target ID, and the three quantity constraints.
- All products (global), applies to every product. The target ID is ignored and forced to 0.
- Specific product, applies to one product, matched by product ID or, for a variation, its parent product ID.
- Product category, applies to products in the chosen
product_catterm.
You can run rules at more than one scope at once; see How rules combine.
Min, max and step
Section titled “Min, max and step”- Min, require at least N units.
0= no minimum. - Max, cap units per order.
0= no maximum. - Step, quantity must be a multiple of this number (e.g.
6allows 6, 12, 18).0or1= no step.
Rules are sanitised on save: a row that constrains nothing (min 0, max 0, step 0 or 1) is dropped, a non-global row with no valid target ID is dropped, and if the maximum is below the minimum the maximum is discarded so the minimum wins. Each value is stored as a non-negative integer.
Minimum order total
Section titled “Minimum order total”A separate, store-wide rule (min_order_total): the cart subtotal must reach this amount before checkout is allowed. It is independent of the quantity rules, a floor on small orders regardless of which products are in the cart. Set it to 0 to disable. The amount is normalised through WooCommerce’s wc_format_decimal, so it follows your store’s decimal settings.
Notice messages
Section titled “Notice messages”Four editable notices, each shown when its rule is unmet. The {token} placeholders are replaced with live values at validation time. Leave a field blank to fall back to the built-in default.
| Setting key | Default wording | Tokens |
|---|---|---|
msg_min_qty | You must buy at least {min} of "{product}". | {min}, {product} |
msg_max_qty | You can buy at most {max} of "{product}". | {max}, {product} |
msg_step_qty | "{product}" must be bought in multiples of {step}. | {step}, {product} |
msg_min_total | Your order total must be at least {min} (currently {total}). | {min}, {total} |
In the order-total notice, {min} is the required minimum and {total} is the shopper’s current subtotal, both rendered as formatted prices in your store currency. {product} is the product (or variation) name. Tokens that do not apply to a given notice are left untouched, so only the tokens listed above are substituted per message.
How rules combine
Section titled “How rules combine”For each constraint, min, max and step, the most specific matching rule wins, resolved independently:
- A product rule (weight 3) beats
- a category rule (weight 2), which beats
- the global rule (weight 1).
Because each constraint resolves on its own, one product can take its minimum from a product rule and its step from a category rule if that is how your rules are arranged. A field left at 0 in the winning rule does not block a less specific rule from supplying that value. The minimum order total is always evaluated against the cart subtotal, separately from the quantity rules.
Where rules are enforced
Section titled “Where rules are enforced”Validation runs at three WooCommerce points, so a rule cannot be slipped past:
woocommerce_add_to_cart_validation, adding a quantity that breaks a rule is rejected. The minimum check counts what is already in the cart for that product, so two adds that together fall short are still caught.woocommerce_check_cart_items, the cart page re-validates every line and surfaces notices; duplicate notices for the same product are de-duplicated.woocommerce_after_checkout_validation, a hard block on the classic checkout.
All three read the live cart, so the same rules hold in the classic and the block-based cart and checkout. Minimum is declared compatible with HPOS and the Cart and Checkout blocks.
Developer filter
Section titled “Developer filter”minimum/product_constraints lets add-ons override the resolved constraints for a product after the global/category/product rules have been merged. Minimum Pro uses it to layer per-product overrides. Return the same array{min, max, step} shape:
add_filter( 'minimum/product_constraints', function ( array $constraints, int $product_id ): array { // Force a step of 12 on product 1234, keep its other constraints. if ( 1234 === $product_id ) { $constraints['step'] = 12; } return $constraints; }, 10, 2);The $product_id passed is the variation ID when a variation is in play, otherwise the product ID.
Storage and cleanup
Section titled “Storage and cleanup”All settings are in the single minimum_settings option; a minimum_db_version option tracks the schema version for first-run seeding. There are no custom database tables and no external services. Deleting the plugin runs the uninstall routine, which removes both options and leaves your database exactly as it was.