I I have an error:
[21-Feb-2010 20:24:10] PHP Fatal error: Unsupported operand types in /home/converti/public_html/estore/includes/functions/functions_taxes.php on line 176
Here are the codes:
////
// Add tax to a products price based on whether we are displaying tax "in" the price
function zen_add_tax($price, $tax) {
global $currencies;
if ( (DISPLAY_PRICE_WITH_TAX == 'true') && ($tax > 0) ) {
return zen_round($price, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places']) + zen_calculate_tax($price, $tax);
} else {
return zen_round($price, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places']);
}
}
// Calculates Tax rounding the result
function zen_calculate_tax($price, $tax) {
global $currencies;
// $result = bcmul($price, $tax, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places']);
// $result = bcdiv($result, 100, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places']);
// return $result;
return zen_round($price * $tax / 100, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places']);
}
I dont understand why because the calling function is checking if $ tax > 0
When I replace $tax by 1 in the next sentence I have no error
return zen_round($price * 1 / 100, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places']);
Please help me . I try a lot of combination with no success.
Thanks.
Bookmarks