1and1 Help Centre Categories

print article

How to calculate price of an item based on the quantity ordered

If you want the item price to be determined by the ordered quantity please follow these instructions:

You need to write a rule. (Items -> New/Edit -> Next -> Rule (valid PHP-
Scriptcode, double quotes are not permitted!) for this item. Check FAQ Where to enter Item Rules if (article_get_field('count') >= 10)
article_set_field('price', 48);
elseif (article_get_field('count') >= 5)
article_set_field('price', 49);
else
article_set_field('price', 50);

Please note:
Be extra careful with this rule. Make sure price in "article_set_field('price', 50);" has the original price assigned. For, eg. while creating the item, if you entered the price of the item as £50.00, then give the price in the rule as 50

In the above example, a customer ordering between 5 to 9 pieces will get be charged £49 and anything above/including 10 will be charged £48. And anything below 5 will have the original price.