Zen Cart Logo
Forums / General Questions / Header error of shopping cart total

Header error of shopping cart total

Views: 565

Results 1 to 5 of 5
27 May 2014, 12:17 PM
#1
ttzz avatar

ttzz

New Zenner

Join Date:
May 2014
Posts:
7
Plugin Contributions:
0

Header error of shopping cart total

My website header currently looks like this.
Home | Log In | cart icon 0 item(s) - format($_SESSION['cart']->show_total());?> | Checkout

As you can see, the total is showing codes instead of prices.
I installed the Zencart Lightbox today and editted some other files, but I am not sure what caused the problem actually.

Any idea how I can fix this problem?

Thanks in advance.

27 May 2014, 12:57 PM
#2
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Header error of shopping cart total

A stock installation does not have cart totals in the header, so you must have a custom template or mod which does that. It is not possible to identify the file responsible with the information you have given, but you can find it yourself using the Developers Toolkit in admin > Tools. Paste the code ```php
format($_SESSION['cart']->show_total());?>

27 May 2014, 1:21 PM
#3
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,089
Plugin Contributions:
56

Re: Header error of shopping cart total

Look in your template's common folder for the tpl_header.php file. It looks like that code includes "short open tags" which, under PHP versions 5.3 and later don't "render" PHP code. If you see something that looks like

<? format($_SESSION['cart']->show_total());?>

change it to

<?php format($_SESSION['cart']->show_total());?>
28 May 2014, 10:49 AM
#4
ttzz avatar

ttzz

New Zenner

Join Date:
May 2014
Posts:
7
Plugin Contributions:
0

Re: Header error of shopping cart total

Thank you for your quick replies, gjh42 and lat9.
I checked my tpl_header.php file, and the inserting "php" to the line mentioned above solved the problem!
I appreciate your help!

Regards,

TTZZ

29 May 2014, 3:43 PM
#5
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,089
Plugin Contributions:
56

Re: Header error of shopping cart total

Excellent! I'm glad that worked. You might also post your findings in the support thread for the template you are using, to let the template author know about the issue.