
Originally Posted by
gandalfsmith
In an earlier thread in this post I uploaded a zip file with all the settings that I used to configure the taxes for Canadian Store in Quebec - mine works as this was on version 1.5. If you read my notes (text file) - there were 2 fixes that I had to apply for version 1.5
FIXES
4A - Compound tax was not working correctly so I applied the following changes to includes/classes/order.php
REMEMBER TO ALWAYS MAKE A BACKUP OF YOUR FILES BEFORE APPLYING ANY CHANGES!
- open includes/classes/order.php and uncomment the if statement on line 523:
Before = if ($taxDescription == $products_tax_description)...
After = //if ($taxDescription == $products_tax_description)...
- and replace:
Code:
$taxAdd = zen_calculate_tax($this->products[$index]['final_price'], $this->products[$index]['tax']) * $this->products[$index]['qty']
+ zen_round(zen_calculate_tax($this->products[$index]['onetime_charges'], $this->products[$index]['tax']), $decimals);
with this taken from v1.39:
Code:
$taxAdd = zen_calculate_tax($this->products[$index]['final_price']*$this->products[$index]['qty'], $taxRate)
+ zen_calculate_tax($this->products[$index]['onetime_charges'], $taxRate);
FIXES
5A - Split Tax Shipping and descriptions were not working properly for Compound tax so I applied the following changes to includes/module/order_total/ot_shipping.php
REMEMBER TO ALWAYS MAKE A BACKUP OF YOUR FILES BEFORE APPLYING ANY CHANGES!
- open include/module/order_total/ot_shipping.php and uncomment the following code on line 21:
Before = unset($_SESSION['shipping_tax_description']);
After = //unset($_SESSION['shipping_tax_description']);
- on about LINE 54 look for if ($shipping_tax_basis == 'Billing') {.....
ADD THE FOLLOWING JUST ABOVE THIS - at about line 50
//Begin SplitTaxLines modification
//--------------------------------
if (SHOW_SPLIT_TAX_CHECKOUT == 'false')
{
- on about LINE 78 look for if (DISPLAY_PRICE_WITH_TAX == 'true') $order->info['shipping_cost'] += zen_calculate_tax($order->info['shipping_cost'], $shipping_tax);
ADD THE FOLLOWING JUST BELOW THIS - at about line 79
} else {
//split the taxes
if ($shipping_tax_basis == 'Billing') {
$shipping_tax = zen_get_multiple_tax_rates($GLOBALS[$module]->tax_class, $order->billing['country']['id'], $order->billing['zone_id']);
$shipping_tax_description = zen_get_multiple_tax_rates($GLOBALS[$module]->tax_class, $order->billing['country']['id'], $order->billing['zone_id']);
} elseif ($shipping_tax_basis == 'Shipping') {
$shipping_tax = zen_get_multiple_tax_rates($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
$shipping_tax_description = zen_get_multiple_tax_rates($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
} else {
if (STORE_ZONE == $order->billing['zone_id']) {
$shipping_tax = zen_get_multiple_tax_rates($GLOBALS[$module]->tax_class, $order->billing['country']['id'], $order->billing['zone_id']);
$shipping_tax_description = zen_get_multiple_tax_rates($GLOBALS[$module]->tax_class, $order->billing['country']['id'], $order->billing['zone_id']);
} elseif (STORE_ZONE == $order->delivery['zone_id']) {
$shipping_tax = zen_get_multiple_tax_rates($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
$shipping_tax_description = zen_get_multiple_tax_rates($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
} else {
$shipping_tax = 0;
}
}
//accumulate taxes from array
foreach ($shipping_tax as $tax_entry_index=>$tax_entry_value)
{
$this_shipping_tax_amount = zen_calculate_tax($order->info['shipping_cost'], $tax_entry_value);
$aggregate_shipping_tax_amount += $this_shipping_tax_amount;
$aggregate_shipping_tax_description += " + " . $shipping_tax_description[$tax_entry_index];
$order->info['tax_groups'][$tax_entry_index] += zen_calculate_tax($order->info['shipping_cost'], $tax_entry_value);
$order->info['total'] += zen_calculate_tax($order->info['shipping_cost'], $tax_entry_value);
if (DISPLAY_PRICE_WITH_TAX == 'true') $order->info['shipping_cost'] += zen_calculate_tax($order->info['shipping_cost'], $tax_entry_value);
}
$order->info['shipping_tax'] += $aggregate_shipping_tax_amount;
$order->info['tax'] += $aggregate_shipping_tax_amount;
//preserve aggregate tax descriptions and amounts for session variables
$_SESSION['shipping_tax_description'] = $aggregate_shipping_tax_description;
$_SESSION['shipping_tax_amount'] = $aggregate_shipping_tax_amount;
}
Bookmarks