Page 1 of 1

How to show Subtotal (EX VAT) in header

Posted: Tue Oct 23, 2012 7:56 pm
by wzzly
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 only have one country I sell to).

Have opencart 1.5.4.1

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.

Re: How to show Subtotal (EX VAT) in header

Posted: Thu Oct 25, 2012 6:17 am
by ian007
I really like this addition to the mini cart. BUT, it doesnt get auto-updated when you add items to the cart, like the main item/s and price inc does? I've tried adding items to cart from all the modules, but same issue - this ex vat addition to the cart only updates when you open up the mini cart.

I'm guessing it's some jscript that does the update. I dont know how or where it actions with /cart.tpl so that this ex vat subtotal auto-updates alongside the item/s inc vat subtotal?

Any clues? THANKS!

Re: How to show Subtotal (EX VAT) in header

Posted: Thu Oct 25, 2012 7:03 pm
by wzzly
Tried it but it's not working because the price in the header is defined in header.tpl on my theme...
Tried to put the:

Code: Select all

<?php echo strip_tags($cart_contents['total_sum']);?>
there, but then I got this error:

: Undefined variable: sub_total_ex_tax in header.tpl

Any ideas?

Re: How to show Subtotal (EX VAT) in header

Posted: Sat Oct 27, 2012 1:45 am
by ian007
Thank you for update enigma1. I have since changed my 'cart' in a way that I no longer need to present the ex-vat price. I hope this is useful for others though. THANKS!

Re: How to show Subtotal (EX VAT) in header

Posted: Sat Oct 27, 2012 7:42 pm
by wzzly
any idea how to change the code if the total price is defined in header.tpl on my theme?