1and1 Help Centre Categories

print article

What do I need to observe with item rules?

You can define a rule for every item. This will enable you to access the current
item's attributes directly (price, item no., quantity, variants etc.) using the
functions article_get_field(fieldname) and article_set_field(fieldname,fieldvalue)

Item rules give you only a restricted PHP4 functionality, which means no functions,
file accesses etc.

The item rules are executed when ordering and whenever the shopping basket is
updated. Any changes to the item properties will be saved with the order.

Item rules must not contain double inverted commas as they
are transmitted using the HTML tag <input type="hidden" ...> which contains
the rule text in inverted commas.

Because the item rules are carried out whenever the shopping basket is displayed,
the command "article_set_field('price',article_get_field('price')* 0.95);" does not
work as expected. The price would drop by 5% whenever the shopping basket is
displayed and updated, which would mean that customers could "click" the price down
at random.