Quantity Rules (Min / Max / Step) on Product Page

Version 4.5.00 of B2BKing introduces a new feature: the ability to configure quantity rules (minimum, maximum, and quantity step) directly on the product page (it was previously already possible via dynamic rules):

Configuring Quantity Rules

Example:

Quantity Input on Frontend Product Page

What Is Quantity Step? #

"Quantity step" refers to a required multiple, such as a box or carton quantity. For example, if you sell a product that comes in boxes of 6, you can set the "Step" to 6 to prevent customers from purchasing different quantities. The plugin will force the quantity field to go from 6 to 12, 18, 24, and so on.

How Does It Work? #

To configure this, simply edit any product and go to the "B2BKing" sidebar panel, where you can enter your desired quantity values:

Quantity Rules Example

Note: There are separate rows for each group. The "regular" option applies to all users. If a group has a dedicated value, that value overrides the "regular" option for users in that group.

In the screenshot above, the minimum is 10 items and the step is 5. This will apply to all users (B2C, logged-out, and B2B).

Let's look at another example:

Quantity Rules Example 2

In this example, B2C and logged-out users will have a minimum of 10 items, while B2B users will have a minimum of 20 items.

When a user opens a product, the quantity is already set to the minimum.

In the case of variable products, the quantities will apply to each variation. If you need to set different values for different variations, that can be done via dynamic rules.

How Can I ... ? #

B2BKing has a powerful dynamic rules system through which you can configure much more complex rules and scenarios. Here are just a few examples of what you can do with rules:

  • Set a minimum of 5 for all products for B2B users
  • Configure minimums and discounts for each individual customer (by username)
  • Set different quantities for different variations of a product (e.g., red has a minimum of 5, blue has a minimum of 10)
  • Set a minimum order value for a category (e.g., customers must order at least $500 from the "Clothes" category)
  • Set a multiple by category (e.g., products in the "T-Shirts" category must be purchased in multiples of 8)
  • Set a minimum order value total for B2B users (e.g., B2B users must order at least $1,000)

Dynamic rules are very flexible. The purpose of the feature described in this article (quantity rules on product pages) is to help you configure these quantities faster and more easily, without needing to set up and manage rules.

Configuring Min / Max / Step via CSV Imports #

An advantage this feature introduces is the ability to set a unique minimum or step for each product directly by modifying that product's metadata or by using the WooCommerce importer.

If you go to Products -> Import, you can now find additional import options under "Quantity Rules":

Import Step, Min, Max Quantities via the WooCommerce Importer

You can use this to prepare a CSV file with products and quantities and then import it.

Alternatively, if you are a developer and prefer to edit the metadata directly, here are the meta keys you need to set:

  • b2bking_quantity_product_min_b2c (for "regular" fields)
  • b2bking_quantity_product_max_b2c
  • b2bking_quantity_product_step_b2c
  • b2bking_quantity_product_min_1234 (for the group with ID 1234)
  • b2bking_quantity_product_max_1234
  • b2bking_quantity_product_step_1234

Disabling / Enabling This Feature Completely #

If you need to enable or disable this feature—for example, to test its performance impact or resolve conflicts—you can do so via B2BKing -> Settings -> Other -> Components -> "Disable min / max / step on product page".

Powered by BetterDocs