Page 1 of 1

cart total in header, how to php echo?

Posted: Wed Feb 08, 2017 7:03 am
by apmuskel
I am working on adding a fixed header for mobile device that shows a cart total price(no text displaying number of products) and a button for "go to checkout".

Was thinking this would be pretty easy but is stuck on pulling the cart total into my "mobile header" code.
I was thinking it would just be to write

Code: Select all

<?php echo $total['text']; ?>
but that returns an error.
Im no php guru so would like some help with this

Found an similare problem in an old thread but that was for OC 1.5.. I run 2.3

Im planning on adding this header in the header.tpl
Do I need to mess with the controllers or what?

Thx guys

Re: cart total in header, how to php echo?

Posted: Wed Feb 08, 2017 1:18 pm
by thekrotek
Yes, you need to add a foreach clause in header controller to get the "total" order total and then assign it's value to some distinct variable.

Re: cart total in header, how to php echo?

Posted: Wed Feb 08, 2017 5:33 pm
by apmuskel
ok, thx. One step closer :)

Could someone help me or point me in the right direction regarding what I need to do in the controller and how to later pull the price in the header.tpl?