JavaScript Discount Example 1
|
||
Description:
The JavaScript on this page demonstrates how you can create your own JavaScripts - with your own custom discount logic - to implement discounts based on subtotal, quantity, etc. Note 1: In this example, the "checkDiscount()" JavaScript is called via the page's "onLoad" function. You can setup your script to be called at any time and via any JavaScript event. Note 2: Unlike the uShopDiscount1 applet, this JavaScript will only set the discount based the current subtotal or quantity. This means that if a customer modifies the cart contents, the function will need to be called again to check if the discount rate has changed. Thus, for this reason, it is recommended that any custom discount JavaScript that you make, be located on the same page as your uShopOrderButton applet. This will ensure that the discount rate is updated properly before the customer begins the ordering process. |
||
Example:
|
||
More Information:
For more information about creating and using your own JavaScripts with uShop, see uShop and Java Scripts. |
||
|