How to set quantity rules (min, max, step)

Shoppers buy on the merchant’s WooCommerce store. Quantity Rules are enforced on the storefront by the WooDonkey Companion plugin.

What it is

Quantity Rules is a WooDonkey feature that enforces how many units a shopper can buy. It does not set prices. You manage Quantity Rules in the WooDonkey dashboard by navigating to the sidebar Advanced Tools, then selecting Quantity Rules. The page title is Quantity Rules, with the subtitle ‘Enforce allowed purchase quantities (minimum / maximum / step) – managed in our system.’ The panel intro states: ‘Set minimum, maximum, and step quantities for purchase. For example: selling cups in sets of 6 – set minimum 6 and step 6. The most specific rule (product) overrides category, and category overrides All products.’ There are no tabs on this page.

This feature allows you to set Minimum, Maximum, Step (multiples), and Default quantities. These same four fields are also available when editing a single product in WooDonkey, under the Advanced Options tab, within the Quantity Rules subsection. The WooDonkey Companion plugin applies these rules on your storefront.

How it helps you

Quantity Rules helps merchants control product sales by enforcing specific purchase quantities, such as selling items in sets (e.g., cups in sets of 6), setting a minimum order quantity for bulk items, or capping the maximum number of units a shopper can buy. This ensures that shoppers’ quantity inputs on the storefront automatically respect your defined rules.

What is included

Quantity Rules provides the following capabilities:

  • Rule name: An optional label for your rule, up to 120 characters. If left empty, it shows as ‘(No name)’ in the list.
  • Applies to: Defines the scope of the rule. Options are Selected products, Categories, or All products. Changing this scope clears any previously selected targets.
  • Products picker: Appears when Selected products is chosen. Allows searching for products by name or SKU (requires 2 or more characters). Selected products appear as chips that can be removed. Up to 2000 targets are supported.
  • Categories picker: Appears when Categories is chosen. Allows searching or selecting categories.
  • Minimum: The lowest quantity a shopper can buy. Empty means no minimum. Minimum value is 0.
  • Maximum: The highest quantity a shopper can buy. Empty means no maximum. The field accepts 0 or higher.
  • Step (multiples): The quantity increment for purchases. Shoppers must buy in multiples of this number. Empty means no step. Minimum step value is 1.
  • Default: The pre-filled quantity on the product page. Empty means no default.
  • Priority: A numerical value (0-1000) where higher numbers win in case of conflicting rules within the same scope. Empty becomes 0.
  • Active switch: Toggles whether the rule is enabled or disabled. New rules start as Active. Only active rules are pushed to the Companion plugin.
  • List badges: Rules in the list display ‘Disabled’ if not active, and a scope badge (‘All products’, ‘Categories’, or ‘Selected products’).
  • List meta: Shows ‘Applies to all products’ or the number of targets, along with Min / Max / Step / Default values, and Priority when it is greater than 0.
  • Buttons: New rule (to create a new rule), Edit (aria-label Edit) and Delete (aria-label Delete) for existing rules, and Cancel and Save within the rule form.
  • Empty states: ‘Select a store to manage quantity rules’ (if no store is selected), ‘Loading…’ (while data loads), and ‘No quantity rules yet. Click New rule to get started.’ (for an empty rule list).
  • Product editor Quantity Rules: On a single product’s Advanced Options tab, a Quantity Rules subsection provides Minimum, Maximum, Step, and Default fields. These create a product-scoped rule for that product, active, with priority 0.
  • Price per unit: On the same Advanced Options tab, a separate section for Price per unit allows setting a unit of measure (None, 1 liter, 1 kg, 1 meter) and quantity in product. This is for display only and does not enforce quantities.
  • Storefront enforcement: The Companion plugin applies rules to classic quantity inputs, block Store API, add to cart actions, cart updates, and checkout cart checks. If a step is set and the minimum is below the step, the minimum becomes the step. The default quantity is clamped to the minimum/maximum and rounded up to the step on the product page.
  • Validation messages: Storefront validation errors are hardcoded in Hebrew, even if the store language is English: ‘כמות מינימלית להזמנה של “%s” היא %d.’ (Minimum quantity), ‘כמות מקסימלית להזמנה של “%s” היא %d.’ (Maximum quantity), ‘יש להזמין את “%s” במכפלות של %d.’ (Step multiple).

How to turn on and manage each capability

Open Quantity Rules

  1. Log in to your WooDonkey dashboard at app.woodonkey.com.
  2. In the sidebar, click Advanced Tools.
  3. Select Quantity Rules.

Create a rule

  1. On the Quantity Rules page, click the New rule button.
  2. Enter a descriptive name for your rule in the Rule name field (e.g., ‘Cups – sets of 6’). This is optional.

Choose who it applies to

  1. In the ‘Applies to’ section, select one of the following options:
    • Selected products: To apply the rule to specific products. Use the ‘Search for a product by name or SKU…’ field to find and add products.
    • Categories: To apply the rule to all products within selected categories. Use the ‘Search or select a category…’ field to find and add categories.
    • All products: To apply the rule to every product in your store.

Set minimum, maximum, step, and default

  1. Enter a number in the Minimum field for the lowest allowed purchase quantity. Leave empty for no minimum.
  2. Enter a number in the Maximum field for the highest allowed purchase quantity. Leave empty for no maximum.
  3. Enter a number in the Step (multiples) field for the required purchase increment. Shoppers must buy in multiples of this number. Leave empty for no step.
  4. Enter a number in the Default field to pre-fill the quantity input on the product page. Leave empty for no default.

Set priority and Active

  1. Enter a number in the Priority field. A higher number means the rule takes precedence over other rules within the same scope (e.g., two category rules). If left empty, priority defaults to 0.
  2. Ensure the Active switch is turned on if you want the rule to be enforced immediately. New rules are active by default.

Save, edit, or delete a rule

  1. After configuring your rule, click Save. A Rule saved toast appears. This action pushes the configuration to the Companion plugin on your storefront.
  2. To edit an existing rule, click the Edit button (aria-label Edit) next to its entry in the list. Make your changes and click Save.
  3. To delete a rule, click the Delete button (aria-label Delete) next to its entry. There is no confirmation dialog. The rule is deleted immediately. A Rule deleted toast appears, and the configuration is pushed to Companion.

Set Quantity Rules on a single product

  1. In WooDonkey, open the product you wish to edit.
  2. Navigate to the Advanced Options tab.
  3. Under the ‘Quantity Rules’ subsection, enter values for Minimum, Maximum, Step (multiples), and Default.
  4. Click the product’s Save button. A Saved successfully toast appears. This action creates a product-scoped rule for that product, active, with priority 0. Clearing all four fields deletes this product-only rule. Note that saving the product does not immediately push the configuration to the Companion plugin. The storefront will see the changes after the next config push (e.g., when you save any rule on the Quantity Rules page).

Show price per unit on a product

  1. In WooDonkey, open the product you wish to edit.
  2. Navigate to the Advanced Options tab.
  3. Under the ‘Price per unit’ section, select a Unit of measure (e.g., ‘1 liter’, ‘1 kg’, ‘1 meter’).
  4. Enter the Quantity in product (in units).
  5. Click the product’s Save button. This setting is for display only and does not enforce quantities.

Tell Quantity Rules apart from a Quantity Discount

  1. Quantity Rules (this product) enforces how many units a shopper can buy (minimum, maximum, step, default). It does not affect pricing.
  2. Quantity Discount (a different product, ‘Promotions type Quantity Discount (Tiers)’) sets quantity-based pricing, offering discounts for buying more units. Use a Quantity Discount promotion for quantity-based pricing. See Related reading.

What to know before you start

  • New rules start with Active on, scope Selected products, Priority 0, and empty Minimum, Maximum, Step (multiples), and Default.
  • The New rule button is hidden while the form is open.
  • Delete removes a rule immediately. There is no confirmation dialog.
  • Save or Delete on this page pushes the configuration to Companion.
  • Saving Quantity Rules on a product in the WooDonkey product editor does not push Companion by itself. The storefront updates after the next config push, for example after you Save a rule on the Quantity Rules page.
  • Quantity Rules enforces quantities. It does not set prices. Quantity-based pricing is a Quantity Discount promotion.
  • There is no CSV import or export on this page, and no Barn2 import button.
  • There is no schedule and no customer-role targeting.
  • A rule name can be up to 120 characters. A rule can target up to 2000 products or categories.
  • Quantity values range from 0 to 100000. Step (multiples) must be at least 1.
  • Priority ranges from 0 to 1000. The list is ordered by Priority descending, then oldest first.
  • A product-scoped rule overrides a category rule. A category rule overrides All products. Within the same scope, the higher Priority wins.
  • Only Active rules are pushed to Companion. Variations use the parent product.
  • Price per unit on the product editor Advanced Options tab is display only. It is not on the Quantity Rules page.
  • Storefront quantity error messages from Companion are hardcoded in Hebrew, even on an English store.

Problems you may hit, and how to fix them

  • Symptom: A rule I created is not being enforced on my storefront. Fix: Check if the rule’s Active switch is turned on. Only active rules are pushed to the Companion plugin.
  • Symptom: The Quantity Rules fields (Minimum, Maximum, Step, Default) are empty when I open a product in the WooDonkey product editor, even though I have a rule for it. Fix: The product editor fields only display rules that are specifically scoped to that single product, are active, and have priority 0. If your rule is multi-target (e.g., applies to a category or ‘All products’) or is disabled, these fields will appear empty.
  • Symptom: I saved Quantity Rules for a product in the WooDonkey product editor, but the storefront isn’t updated. Fix: Saving a product in the WooDonkey product editor does not immediately push the configuration to the Companion plugin. The storefront will reflect the changes after the next configuration push from the WooDonkey Quantity Rules page (e.g., when you save any rule there).
  • Symptom: My English-language store shows Hebrew error messages when a shopper enters an invalid quantity. Fix: The validation error strings from the WooDonkey Companion plugin are currently hardcoded in Hebrew.
  • Symptom: I cannot save a rule because ‘Maximum must be greater than or equal to minimum’. Fix: Ensure the value in the Maximum field is equal to or higher than the value in the Minimum field.
  • Symptom: I cannot save a rule because ‘Set at least one value (minimum/maximum/step/default)’. Fix: You must define at least one quantity constraint (Minimum, Maximum, Step, or Default) for the rule to be valid.
  • Symptom: I cannot save a rule because ‘Select at least one target (product/category)’. Fix: If your rule’s scope is Selected products or Categories, you must add at least one product or category to the target list.
  • Symptom: Shoppers can still add incorrect quantities to their cart, even with rules set. Fix: Ensure the WooDonkey Companion plugin is installed and activated on your WooCommerce store, and that it is current on this store.
  • Symptom: I expected Quantity Rules to offer discounts for buying in bulk. Fix: Quantity Rules enforces purchase quantities but does not set prices or offer discounts. For quantity-based pricing, use the separate WooDonkey product: Promotions type Quantity Discount (Tiers).
  • Symptom: I cannot find the ‘Price per unit’ settings on the Quantity Rules page. Fix: Price per unit settings are located on the Advanced Options tab when editing a single product in WooDonkey, not on the Quantity Rules page.
  • Symptom: I accidentally deleted a rule and there was no confirmation. Fix: The Delete button on the Quantity Rules page performs an immediate deletion without a confirmation dialog.

Related reading