Chapter 9
196
Add [percentage] adjustment [type] to [ShoppingCart] when
[button] is clicked (requires submit)
This is an interaction between the ShoppingCart and a button that adds a
percentage adjustment to the cart without any data criterion constraints. An
adjustment in this context represents a fee or discount on the total order and is set
using the 'AdjustmentType' parameter. Use this contract to provide an 'optional'
adjustment based on the user's selection. For instance, you could provide a variety
of optional fees such as gift wrapping. The user can then choose to apply the fee
by clicking the button. Be sure to use the companion contract "Remove
adjustment when button is clicked" to allow the user to change their mind.
This contract applies a percentage adjustment specified in the 'percentage'
parameter when the button is clicked. The actual adjustment is calculated using
the percentage value multiplied by the Cart's subtotal. A related contract is
available to apply flat adjustments in this manner. Note that these adjustments are
global to the order and are not relevant to specific line-items in the shopping cart.
Additional contracts are available to provide discounts at the product (that is,
line-item) level.
Parameters:
AdjustmentName is the name of the adjustment
AdjustmentType specifies whether the adjustment is a discount or a fee
Percentage is the percentage value used to calculate the adjustment based on
the shopping cart's subtotal.
Participants:
ShoppingCart
Button (form button, image, any object with an 'onClick' event)
Summary of Contents for DRUMBEAT 2000 ECOMMERCE EDITION
Page 1: ...Users Guide macromedia DRUMBEAT 2000 eCOMMERCE EDITION ...
Page 6: ...Contents 6 ...
Page 12: ...Introduction 12 ...
Page 90: ...Chapter 2 90 ...
Page 110: ...Chapter 3 110 ...
Page 124: ...Chapter 5 124 ...
Page 142: ...Chapter 7 142 ...
Page 152: ...Chapter 8 152 ...
Page 236: ...Chapter 10 236 ...