2.2. Price Maintenance with CommonAdjust

A flexible chained pricing scheme is available when the CommonAdjust directive is set.

NOTE: For compatibility with older carts, if both PriceAdjustment and CommonAdjust are set, and CommonAdjust contains a valid database identifier, the CommonAdjust value is used to set pricing adjustments based on item attributes. This is not discussed further in this section; all items below assume PriceAdjustment is not in use.

We talk below about a CommonAdjust string; it will be defined in due time.

A few rules about CommonAdjust, all assuming the PriceField directive is set to price:

1

2

3

4

5

6

Prices may be adjusted in several ways, and the individual actions are referred to below as atoms. Price atoms they may be final, chained, or fallback. A final price atom is always applied if it does not evaluate to zero. A chained price atom is subject to further adjustment. A fallback price atom is skipped if a previous chained price was not zero.

Atoms are separated by whitespace, and may be quoted (although there should not normally be whitespace in a setting). A chained item ends with a comma. A fallback item has a leading semi-colon. Final atoms have no comma appended or semi-colon prepended.

A settor is the means by which the price is set. There are There are eight different types of price settors. All settors can then yield another CommonAdjust string.

It is quite possible to create endless loops, so the maximum number of initial CommonAdjust strings is set to 16, and there may be only 20 iterations before the price will return zero on an error.

NOTE: Common needs are easily shown but not so easily explained; skip to the examples if the reference below if your vision starts to blur when reading the next section. 8-)

USAGE: Optional items below have asterisks appended. The asterisk should not be used in the actual string. Optional base or table always defaults to the active products database table. The optional key defaults to the item code except in a special case for the attribute-based lookup. The field name is not optional except in the case of an attribute lookup.

N.NN or -N.NN

N.NN%

table*:column:key*

table*:col1..col5,col10:key*

        pricing:p1,p2,p3,p4,p5,p10:
        pricing:p1..p5,p10:

==attribute:table*:column*:key*

& CODE

      $Vend::Interpolate::item          is the current item
      $Vend::Interpolate::item->{code}  gives key for current item
      $Vend::Interpolate::item->{size}  gives size for current item (if there)
      $Vend::Interpolate::item->{mv_ib} gives database ordered from

[valid Interchange tags]

$

>>word

word

( settor )