tax related bug in order.php class
ZenCart 1.5.0, fresh install.
Bug in order.php:523
http://zencart.svn.sourceforge.net/v...39&view=markup
PHP Code:
$totalTaxAdd = 0;
foreach ($taxRates as $taxDescription=>$taxRate)
{
$taxAdd = 0;
if ($taxDescription == $products_tax_description)
{
if (DISPLAY_PRICE_WITH_TAX == 'true')
{
$taxAdd = zen_round($shown_price / (100 + $this->products[$index]['tax']) * $this->products[$index]['tax'], $decimals);
} else
{
$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);
}
if (isset($this->info['tax_groups'][$taxDescription]))
{
$this->info['tax_groups'][$taxDescription] += $taxAdd;
} else
{
$this->info['tax_groups'][$taxDescription] = $taxAdd;
}
}
$totalTaxAdd += $taxAdd;
}
$this->info['tax'] += $totalTaxAdd;
/*********************************************
* END: Calculate taxes for this product
*********************************************/
$index++;
}
E.g.: Tax for each product array('VAT' => 7.25, 'Charity' => 1)
Thus we have $products_tax_description = 'VAT + Charity', but $taxDescription can be only VAT or Charity each iteration, so $taxDescription == $products_tax_description is always false, when more than 1 Tax rate applicable.
Best regards,
Vladimir.