Documentation · Cartnorm B2B

Order rules

Cartnorm B2B is not on WordPress.org yet. These pages describe version 0.3.0, the version that will be published. Pro features are marked as planned.

Order rules make sure wholesale orders are worth shipping. They are set per customer group, so retail customers and guests are not affected unless you set rules for Retail too.

Rules per group

In WooCommerce › Settings › B2B › Customer groups & rules, each group (and Retail) has:

  • Minimum order value, for example “Wholesale customers order at least €100”. It is compared with the cart subtotal before coupons, excluding or including VAT the way the group sees prices: a net group needs the net subtotal, a gross group the gross subtotal. Leave empty for no minimum.
  • Minimum number of items: the total quantity of all products in the cart.

Rules per product and variation

In the product editor, Inventory tab, Order quantities (B2B), for each group:

  • Minimum quantity,
  • Maximum quantity,
  • Pack size: the product can only be ordered in multiples of this number, for example 24 for a case of 24.

For variable products, these rules apply to each variation unless the variation has its own. Empty fields mean no rule.

What customers see

  • Quantity fields on the product page and in the cart only offer valid quantities: they start at the minimum, step by the pack size and stop at the maximum. This works in the classic cart and in the cart block (through WooCommerce’s Store API quantity limits).
  • Add-to-cart buttons on shop pages add a full pack.
  • Clear, translatable messages in the classic cart, the mini cart and the cart block, for example:
    • “Minimum order for Wholesale customers is €100.00 — add €23.50 more.”
    • “Minimum order for Wholesale customers is 12 items — add 2 more.”
    • ““Mug” is sold in packs of 24. Please change the quantity to a multiple of 24.”
    • “You can order at most 50 of “Mug”.”

Enforced on the server

Checkout is blocked on the server until the rules are met, in the classic checkout and in the checkout block (Store API). Changing the quantity in the browser or calling the Store API directly does not get around it.

The rules are calculated without database queries per cart line, so large carts stay fast.

For developers

Filters: cartnorm_b2b_group_order_rules (rules of a group), cartnorm_b2b_product_quantity_rule (rule of a product for a group), cartnorm_b2b_min_order_cart_amount (the amount compared with the minimum), cartnorm_b2b_cart_rule_messages (the messages), cartnorm_b2b_classic_notice_type (error or notice in the classic cart). See Developers.

Something unclear or missing? Write to [email protected].