1and1 Help Centre Categories

print article

How to set a minimum order quantity for individual items

A minimum order quantity can be applied to a particular item (or items).

You will first have to create an attribute for the item, e.g. minquantity with the
value of minimum quantity you want(For e.g.:4). Please follow FAQ How to create attributes for item rulesThen you need to write a rule. (Items -> New/Edit -> Next -> Rule (valid PHP-
Scriptcode, double quotes are not permitted!) for this item. if (article_get_field('count') < article_get_field('minquantity'))
article_set_field('count', article_get_field('minquantity'));
Although the customer can now enter a lower quantity, the minimum quantity will
always be stored in the basket and displayed correctly.

There is a more elegant way of solving this problem (but note that it is only available on a Developer eShop):
For an item to have a minimum quantity already assigned, create a new template
under Shop Design. Make sure you name the the file with .template extension (For
eg: item3_quantity.template). Copy the source text of the template_detail.template
and into your newly created template file and modify the following line of code:

<input type=text name='article[Count]' value="1" size="2">to <input type=text name='article[Count]' value="$minquantity" size="2">Now go back to Items -> Edit -> Next -> and choose the newly created template for "Detail view template"

Create the attribute and the rule as per above instructions. Now when you try to
buy the item, the minimum quantity is already displayed and customers cannot order
less that that minimum quantity.