It's always nice to re-vistit old threads with solutions, so here goes.....
If you want to display -
SubTotal $100.00
Shipping: $10.00
GST: $5.50
PST: $8.00
Total $123.50
You need to do the following.
1 - Setup all your taxes as discribed at teh top of this thread, BUT ensure that the Descriptions match for those you wish to group together. So if you have GST on Shipping, and GST, the DESCRIPTION field MUST be the same - so GST (5%)
2 - BACKUP includes/modules/order_totals/ot_tax.php
3 - REPLACE the function process() { and all code down to function check() { with the following code (Leave the function check() { line intact.)
Code:
function process() {
global $order, $currencies;
reset($order->info['tax_groups']);
$tax_values = array();
while (list($key, $value) = each($order->info['tax_groups'])) {
if ($value > 0 or STORE_TAX_DISPLAY_STATUS == 1) {
if (strstr($key, ' + ')) {
$tax_rates = array();
$tax_descriptions = explode(' + ', $key);
foreach($tax_descriptions as $tax_description) {
$tax_rate = zen_get_tax_rate_from_desc($tax_description);
$tax_rates[$tax_description] = $tax_rate;
$total_tax_rate += $tax_rate;
}
foreach($tax_rates as $description => $rate) {
$tax_values[$description] += ($value / $total_tax_rate) * $rate;
}
} else {
$tax_values[$key] += $value;
}
}
}
foreach($tax_values as $description => $tax_value) {
$this->output[] = array('title' => $description . ':',
'text' => $currencies->format($tax_value, true, $order->info['currency'], $order->info['currency_value']),
'value' => $tax_value);
}
}
That's it. It re-works all your taxes, so that rather than showing tax A + Tax B = $xxx.xx, it now shows Tax A = xx.xx and Tax B = xx.xx. No alterations have been made to how the tax is actually calculated, so this should work with any tax rates, and with any modules you have installed.
Absolute
Bookmarks