The section of code that deals with Taxes is below and the part in red is where I think the problem lies. Can anyone take a look and see if you can make out what might be going on here?
Code:
/*********************************************
* Calculate taxes for this product
*********************************************/
$shown_price = (zen_add_tax($this->products[$index]['final_price'], $this->products[$index]['tax']) * $this->products[$index]['qty'])
+ zen_add_tax($this->products[$index]['onetime_charges'], $this->products[$index]['tax']);
$this->info['subtotal'] += $shown_price;
// find product's tax rate and description
$products_tax = $this->products[$index]['tax'];
$products_tax_description = $this->products[$index]['tax_description'];
// calculate the amount of tax "inc"luded in price (used if tax-in pricing is enabled)
$current_row_tax_inc = $shown_price - ($shown_price / (($products_tax < 10) ? "1.0" . str_replace('.', '', $products_tax) : "1." . str_replace('.', '', $products_tax)));
// calculate the amount of tax for this product (assuming tax is NOT included in the price)
$current_row_tax_exc = zen_round(($products_tax / 100) * $shown_price, $currencies->currencies[$this->info['currency']]['decimal_places']);
if (DISPLAY_PRICE_WITH_TAX == 'true') {
// calculate the amount of tax "inc"luded in price (used if tax-in pricing is enabled)
$tax_add = $shown_price - ($shown_price / (($products_tax < 10) ? "1.0" . str_replace('.', '', $products_tax) : "1." . str_replace('.', '', $products_tax)));
} else {
// calculate the amount of tax for this product (assuming tax is NOT included in the price)
$tax_add = zen_round(($products_tax / 100) * $shown_price, $currencies->currencies[$this->info['currency']]['decimal_places']);
}
$this->info['tax'] += $tax_add;
if (isset($this->info['tax_groups'][$products_tax_description])) {
$this->info['tax_groups'][$products_tax_description] += $tax_add;
} else {
// this adds the tax rate for cases where tax is NOT included in the product
$this->info['tax'] += $current_row_tax_exc;
if (isset($this->info['tax_groups']["$products_tax_description"])) {
$this->info['tax_groups']["$products_tax_description"] += $current_row_tax_exc;
} else {
$this->info['tax_groups']["$products_tax_description"] = $current_row_tax_exc;
}
}
/*********************************************
* END: Calculate taxes for this product
*********************************************/
Thanks
Bookmarks