Hi all,
I have enabled “Display Prices With Tax” in the admin. And so my header displays the total+tax of the shopping cart in the header. Thats great but I would like to show the total(without taxes) also in the header. That’s actually the Sub-total.
I tried but can’t get it to work. In header.tpl:
<?php echo strip_tags($cart_contents['total_sum']); ?>
So I would need something like: ['subtotal_sum']
Also I would like to place the text; “Incl. TAX” and “Excl. TAX” behind the 2 prices in the header then.
Hope you guys can help.
|
|
Hi,
Unfortunately there is no subtotal variable that you can use directly and you will need to hack some core files.
This is not a trivial modification and could not be covered by the free support offered by this forum. You may post your question in the official opencart forums, or seek a freelancer to do the job for you.
Best Regards,
ThemeBurn team
|
|
But is it possible to make a calculation like: Total – (all)taxes
I think this might be easier because the Subtotal should include shipping
|
|
You will need to register in order to post topics and read replies in the ThemeBurn.com support forums!
|
|
As a first step I placed:
$json['tax'] = $this->currency->format($taxes);
in the TbController.php
And:
<?php echo strip_tags($cart_contents['tax']);?>
in the header.tpl
I thought by doing this (as a first step) it would display the carts taxes in the header, but that doesn’t work. Any idea why?
After that I thought I could do something like:
$json['total_sum_ex_tax'] = $this->currency->format($total-$taxes);
Am I on the right track?
Thanks
|
|
You will need to register in order to post topics and read replies in the ThemeBurn.com support forums!
|
|
Just add this:
$json['total_exc_tax'] = $this->currency->format($this->cart->getTotal());
It works for me,
Also, you have to edit the common.js.php file and add the same variable for the add and remove to cart functions.
-
This reply was modified 3897 days ago by JMField.
|
|
@JMField
Thanks for sharing the modification!
Best,
ThemeBurn team
|
|