Ciovo wrote:
nicolas wrote: Regarding the storing of discounts in the orders, it's possible that in some cases, we might need to store the calculation without taxes.
Could you try with that line instead:
$discount_price=@$cart->coupon->total->prices[0]->price_value_without_discount-@$cart->coupon->total->prices[0]->price_value;
I'll try and I'll let your know if it works as expected.
Thanks again!
Calculations and order/invoice is now as expected and reflects what appear in the checkout, so this problem is solved with this change.
Anyway, after this I had to override the subtotal calculation in administrator/templates/bluestork/html/com_hikashop/order/form.php in order to take into account the different behaviour. From
<?php echo $this->currencyHelper->format($this->order->order_subtotal,$this->order->order_currency_id); ?>
to
<?php $taxes = 0;
if (/*$this->config->get('detailed_tax_display') &&*/ !empty($this->order->order_tax_info)) {
foreach ($this->order->order_tax_info as $tax) {
$taxes += (double)str_replace(',', '.', $this->currencyHelper->format($tax->tax_amount,$this->order->order_currency_id));
}
}
echo $this->currencyHelper->format($this->order->order_subtotal - $taxes,$this->order->order_currency_id); ?>
It's working now, but I strongly suggest to parametrize this option because the boss I'm working with in this project said to me it was a must for the Italian law.
Thank you for you important support!!