User Guide
Shopping Cart Reference 155
Adjustments Array
An array of Adjustment objects. Each adjustment object contains several
properties that allow the value of the adjustment to be calculated throughout the
application. Adjustments are added to the shopping cart using the
AddAddjustment method. Values of the adjustment are calculated based on the
adjustment object properties using the SetAdjustmentValue method. The
Adjustments array is updated when the cart contents are updated via the 'Update
Cart' contracts from the eStore Shopping Cart category. The 'Update Cart'
contracts first update the contents of the shopping cart on the shopping cart's
Server() event, the update the adjustments on the shopping cart's PostServer() via
the Update Adjustments method.
Adjustment object consist of the following properties:
Name name of the Adjustment. Many of the adjustment object properties can be
accessed and/or set via methods that reference the adjustment name.
Value the value of the adjustment. For flat adjustments, the value is equivalent to
the rate (see below). For percentage adjustments, the value is the product of the
shopping cart subtotal and the percentage.
DataType specifies the data on which the adjustment is based. This property is
used to retrieve a value that is compared against the threshold property to
determine if an adjustment value should be calculated. This can be the order
weight, order quantity, order subtotal, or the value of a session variable.
RateType specifies whether the adjustment will be a flat or percentage adjustment.
Allowed values are 'Flat' and 'Percentage.'
Rate specifies the adjustment rate. For flat adjustments, this will be a monetary
value; for percentage adjustments, this will be a percent string (that is, 10%). The
rate will be negative for discounts and positive for Fees. When an adjustment
object is created via the AddAdjustment method, the AdjType parameter to the
method specifies whether the adjustment is a discount or fee. The rate is then set
as positive or negative accordingly.
Threshold specifies the threshold for receiving an adjustment. Possible values are
numeric quantities of order weight, subtotal, or quantity, the value of a session
variable, or the empty string. The latter case corresponds to an adjustment that is
elective and independent of any order data criterion; for instance, a gift wrapping
charge that would be added via the 'Add adjustment when button is clicked'
contract. The value of the threshold is compared to the data retrieved from the
GetOrderData method, which passes the DataType property.
Comparison the comparison operator used to compare the order data against the
threshold in determining the adjustment value. This can be '>=', '<=', or '= =.'
For adjustments where there is no threshold, the comparison property would be
empty as well.