I'm running ZenCart 1.5.1 and the latest version available of the TaxCloud plugin.
During checkout, I'm noticing a few things.
Firstly, the emails are being sent out with the tax showing one decimal even though my ZenCart is configured to show all prices as two decimals. (I wound fixing this by using the inherent number_format() as a temporary fix. as below:
BEFORE
Around line 1194
PHP Code:
$ot['text'] = '$' . $newValue;
Around line 1201
PHP Code:
$ot_tax['text'] = '$' . $taxcloudTaxTotal;
AFTER
PHP Code:
$ot['text'] = '$' . number_format($newValue, TAX_DECIMAL_PLACES);
...
$ot_tax['text'] = '$' . number_format($taxcloudTaxTotal,TAX_DECIMAL_PLACES);
Secondly, I noticed that the emails are being sent out with the sales tax line being sent out twice and calculated twice in the emails. Even though the credit card/paypal account/etc. is only being charged for it once:
Confirmation Email: (ignore the misformatting of the details, that's my own fault)
Super Orders view of the order, I can confirm from phpMyAdmin that this still holds to be true:
I found the relevant coding here to TaxCloud that MIGHT be causing this issue but am not sure. Any one mind taking any guess as I'm pulling out my hair over this:
PHP Code:
$TAXCLOUD_ENABLE = func_taxcloud_is_enabled($shippingAddress['country_id']);
if ($TAXCLOUD_ENABLE =='true') {
$taxcloudTaxTotal = $_SESSION['taxcloudTaxTotal'];
if ( isset($taxcloudTaxTotal) && $taxcloudTaxTotal > 0) {
$index = 0;
foreach ($order_totals as $ot) {
if ( $ot['code'] == 'ot_total' ) {
$newValue = $ot['value'] + $taxcloudTaxTotal;
$ot['value'] = $newValue;
$ot['text'] = '$' . number_format($newValue, TAX_DECIMAL_PLACES);
$order_totals[$index + 1] = $ot;
$ot_tax = Array();
$ot_tax['code'] = 'ot_tax';
$ot_tax['title'] = 'Sales Tax (to be collected):';
$ot_tax['text'] = '$' . number_format($taxcloudTaxTotal, TAX_DECIMAL_PLACES);
$ot_tax['value'] = $taxcloudTaxTotal;
$ot_tax['sort_order'] = 500;
$order_totals[$index] = $ot_tax;
}
$index++;
}
}
}
Bookmarks