posted on 1:17 PM, January 4, 2012
A surcharge is an adjustment to the total of an invoice, whether positive (add-on cost) or negative (discount). Examples of surcharges include:
The cost fields are used to calculate the actual amount of the surcharge.
A percent value is multiplied by the line-item subtotal. For exmaple, if a line item has a subtotal of $20.00, and a 5% tax surcharge applies to that item, then a surcharge of 20.00 * 0.05 = $1.00 will be added to the invoice.
A per item value is a dollar amount that is multiplied by the line-item quantity. For example, if a product has a shipping charge of $2 per item, and 5 items are purchased, a surcharge of 5 * 2.00 = $10.00 will be added to the invoice.
A per unit size value is a dollar amount that is multiplied by the line-item size (which might be a weight, length, or other quantity that indicates the size of the item). For example, if a user buys 4 of an item that weighs 1.5 kgs each, and the shipping cost is $5 per kg, a surcharge of 4 * 1.5 * 5.00 = $30.00 will be added to the invoice.
A per product value is a dollar amount that is only applied once for a given product (technically, once per line item), no matter what quantity is purchased.
A per order value is a dollar amount that is only applied once for a given invoice, no matter how many items on that order qualify for the surcharge.
You can specify more than one of these, and the costs will be added together to get the sucharge subtotal.
When configuring discounts, enter negative values in the cost adjustment fields. For example:
Surcharges can be region-specific. This is commonly used for handling different sales tax jursidictions, and for calculating shipping charges based on region being shipped to. The region is compared to the region of the buyer (as entered on the checkout screen).
Specify states and provinces using their standard 2-letter codes. You can combine multiple province/states into one region by separating them with a bar character, like this:
Countries can be specified and combined the same way. For example, to apply a surcharge to North American buyers, you can set the country to:
To specify an everywhere-except condition, put an exclamation point in front of the state/province or country. For example, to add a surchage for everywhere outside of Canada or the USA, use:
Surcharges can be set up to be valid only during certain dates and times. Set the start and end dates and times using the date selectors. If the start time is unset, then the surcharge is valid at any time up to the end time. If the end date is unset, then it is valid at any time after the start time. If both are unset, then it is always valid.
Surcharges can be configured to apply TO certain items only, and also to apply only IF certain other items exist on the invoice.
Set Treat as =
Multiple sales tax surcharges will have to be set up to cover the different Apply-to purchase categories that are taxable, as well as the different tax jurisdictions and rates in each of those jurisdictions.
Sales Tax Example
This configures the harmonized sales tax (HST) on all merchandise purchase made by buyers in ON, NS, NB, and NL:
Shipping & Handling
There are many different ways to use the surcharge system to automatically compute shipping costs. Here are some examples:
Fixed rate per item
For example, charge $1 per book when ordering books from an online bookstore:
Charge by size
For example, charge $5 per kg:
You must ensure that every shippable item has an accurate size associated with it, and that the sizes are in consistent units (eg. kg for this example).
Charge by size with minimum charge
For example, charge $5 plus $2 per kg
Charge by distance
For example, charge $5 per kg to Canada, $10 per kg to USA, and $15 per kg worldwide:
Discounts and Sales
One-day sale on all merchandise - 15% off everything in store:
Note that we treat the sale discount as a (negative) merchandise sale. This is to ensure that other surcharges such as taxes are correctly recalculated. For example, if an item costs $50, and there is 10% tax, the invoice will initially total 50.00 + 5.00 = $55.00. With this sale, we add an extra line item to the invoice called "Sale discount" worth -7.50 off the price of the original item. We then calculate sales tax on this new line item, resulting in another surcharge of -7.50 * 10% = -0.75, which is basically the correction to the original $5.00 sales tax.
A particular product is discontinued, and the remaining stock is 50% off:
The object type is set to catalog_product (this is the internal name of the database table that describes the products). The object ID is the product ID in this table.
The regular price is for up to 10 items. Over 10 items, the buyer gets $1 off each item. Over 100 items, the buyer gets $2 off each item.
Note that the second discount is also for $1, even though the over-100 discount is $2. This is because the buyer will get both discounts if they buy more than 100 items.
The buyer gets $50 off a conference registration if they also sign up as a member of the organization at the same time:
Here, the Apply if = "Membership Dues" condition means that this surcharge will be used only if the invoice includes a line item for membership dues. The surcharge gets applied to any other line item that is an event registration.
Promo Code Discount
The buyer gets $10 off a conference registration if they enter the promo code "FIREWORKS" at checkout:
best practices (5)
content management (12)
data handling (7)
graphic design (21)
html formatting (7)
plug-in modules (28)
visual tutorial (29)
web protocols (9)