-- HikaShop version -- : 3.2.0
-- Joomla version -- : 3.8.0
-- PHP version -- : 7.1.9
-- Browser(s) name and version -- : All
-- Error-message(debug-mod must be tuned on) -- : Nil
I have an issue with editing the email content in relation to the value of the coupon.
The coupon value is 5%.
In the global configuration apply discounts is set to before taxes.
Detailed Tax display is selected.
Show taxed prices is set to both.
Tax is set to 20%
I have a requirement that the subtotal is shown excluding VAT, this has been easy to achieve by adjusting the various views, the last one being the email template.
I know I am using the correct template because I have been able to adjust it to show the subtotal without tax, below are the lines of code which I expected to adjust to display in the email the coupon calculated "before tax"
if(bccomp($data->cart->order_discount_price,0,5)) {
if($config->get('price_with_tax')) {
$t = $currencyHelper->format($data->cart->order_discount_price * -1, $data->cart->order_currency_id);
}else{
$t = $currencyHelper->format(($data->cart->order_discount_price - @$data->order_discount_tax) * -1, $data->order->order_currency_id);
}
$cartFooters[] = array(
'NAME' => JText::_('HIKASHOP_COUPON'),
'VALUE' => $t
);
}
I have tried adjusting the first line in the if statement but can't get the data to display the coupon value before tax. Below are some screen shots from the back end to show the issue.
The first 2 images are displaying the correct amounts for all the areas.
As can be seen in the email area the coupon value is incorrect.
I look forward to your response, as I am very happy with the software overall.
Regards,
Dave