Surcharges are the converse of discounts. They're used to add miscellaneous charges to an order. This document discusses how to apply your own custom surcharges. Be sure you've read the rules documentation before proceeding.
If documentation bores you, just take a look at the sample surcharge.rules file. It assigns a COD charge to orders whose payment method is "COD".
The total calculated surcharge can be accessed in your templates via the HZML token
Surcharge rules are defined in the surcharge.rules file under the rules directory in your catalog root.
It's worthy of noting that surcharge rules have no unique headers. Those listed below are available in all rules files.
|[Header]||Type||Description||number below is the numeric part of the rule's action.|
|Any HZML token and its evaluation type, separated by a semi-colon.||add number to total||multiple total by number|
|NUM||Any numeric HZML token. Same syntax as above, but numeric types have different actions.||add number to total||add header value multiplied by number to total|
|WEEKDAY||WDAY||The day of the week. ||add number to total||multiple total by number|
|DATE||DATE||The date. Eg. ||add number to total||multiple total by number|
|TIME||TIME||The time of day. Eg. ||add number to total||multiple total by number|
HZML & HAM
CGI and You