Originally Posted by
DrByte
Or just avoid the 0 vs 0.0 and change != 0.0 to > 0
I didn't chase back to see if it was allowed/possible, but I chose != 0.0 with consideration of a possible negative tax possibly used as some sort/form of price reduction. Though come to think of it I think much of the tax related code does a test similar to the suggested and seems to deal only with 0 or positive numbers.
Now something else Nick1973, the way I suggested this change doesn't fully align with your requested "identifier". Ie. You asked for the identifier to be present if there was no tax class assigned (-none-) as compared to having a zero tax (-none- and if the tax rate were set to 0). This was chosen out of immediate ease and relative likelihood of coming across a tax rate identified as 0%.
Having looked back at the entirety of the code section and the actions that get taken when calling zen_get_tax_rate, it would save processing (and database queries) if the added code for the "test" used data that was already available at that point.
So instead of adding this portion "zen_get_tax_rate(...)"
You could use the following and there would not be any issue(s) of floats, integers, etc...
Code:
($product_check->fields['products_tax_class_id'] !== 0 ? TEXT_PRODUCT_TAX : '')
Code:
$show_normal_price = '<br /><span class="productBasePrice">' . $currencies->display_price($display_normal_price, zen_get_tax_rate($product_check->fields['products_tax_class_id'])) . ($product_check->fields['products_tax_class_id'] !== 0 ? TEXT_PRICE_TAX : '') . '</span>';
This would be in line with your original request even if the previously provided code "worked".
Bookmarks