Minimum and maximum order quantities

The minimum order quantity extension allows you to set a minimum order quantity on your products. A customer will not be able to add less than the minimum order quantity to their basket. A maximum order quantity can also be set.

The minimum/maximum order quantity can either be set for each individual product or globally (i.e. across all products on your website).

Once the extension is activated, you can follow the instructions below to set minimum order quantities.


On a per-product basis

When adding/editing a product scroll to the 'additional information' section. You'll see the minimum order quantity, and maximum order quantity, fields and be able to set them here (as indicated in the screenshot below).

In the example above we have set the minimum order quantity of 3 and a maximum order quantity of 10.

You don't have to set both a minimum and maximum, you can set just one.

For all products

Select 'settings' from the left menu and then 'products'.

Enter the minimum or maximum order quantity that you want to set into the field indicated in the above screenshot.

By default the minimum order quantity will be set as 0.

Please Note!

The minimum or maximum order quantity you set globally (on the product settings page) will override the quantity set per-product.


Customer restrictions

You can set which types of customers are restricted by minimum and maximum order quantities if you only want certain types of customers to be affected by them. By default, all customers will be affected.

Select 'settings' from the left menu and then 'products'.

Using the section shown highlighted in red below, select the customers that should be affected by minimum and maximum order quantities.


Installing the extension

Select 'apps and extensions' from the left menu and then 'available extensions'. Find the 'minimum order quantity' extension and click to activate it on your account.

Once the extension is activated you'll then need to add the relevant code to your website's files (described below). To add the relevant code you'll need to use the page editor, alternatively you can click the 'request installation' button and we'll install the code for you (a small charge will be made for the installation, which is listed on the extension page).

These instructions relate to displaying the minimum order quantity set for a product on the product page on your website.

Installation By Us

If you choose to have us install the extension for you, as part of the installation process we'll design how the minimum order quantity should be displayed, maybe with an icon etc. so it is more noticeable.

To do so you can use 4 Twig variables:

{{ product.minimum_order_quantity }} will output the minimum order quantity set at a per-product level

{{ global.minimum_product_quantity }} will output the minimum order quantity set globally for all products

{{ product.maximum_order_quantity }} will output the maximum order quantity set at a per-product level

{{ global.maximum_product_quantity }} will output the maximum order quantity set globally for all products

The product.minimum_order_quantity and product.maximum_order_quantity variables are also available on the checkout/basket page through the basket item object, i.e. item.product.minimum_order_quantity and item.product.maximum_order_quantity.

This should be installed on the product.twig file (located in /views/product pages/product.twig).

You may choose to write some simple text as shown in the example below to explain the variable as shown in the example below.

This product has a minimum order quantity of <strong>{{ product.minimum_order_quantity }}</strong>.

Javascript implementation

The extension prevents the customer adding less than the minimum order quantity at the platform level, which means that it is only once the product add to basket form is submitted and the page reloads that the user will be informed that they have not added sufficient quantity of the product.

A Javascript implementation is also possible which will work at the browser level (i.e. immediately alerting the user rather than waiting for the form to be submitted and the page to be reloaded).

For example attaching the minimum order quantity to the product add to basket form on the product page, e.g.

<form ... id="product-form" data-min-quantity="{{ global.minimum_product_quantity > 0 ? global.minimum_product_quantity : product.minimum_order_quantity }}">
    ...
</form>

Means you can then reference the minimum order quantity in your Javascript files, e.g.

var form = $('#product-form');
form.on('submit', function(event) {
    var quantity = parseInt(form.data('min-quantity'), 10);
    if(quantity > 0) {
        event.preventDefault();
        ...
    }
});