"Undefined variable" errors after upgrading to 1.5.2.1
9 posts
• Page 1 of 1
"Undefined variable" errors after upgrading to 1.5.2.1
I upgraded from 1.5.1.3 to the latest 1.5.2.1 recently. The upgrade process went just fine, encountered no errors. But when I view my Store Front I get "Underfined variable" errors. Here's what I found in the Error Log:
2012-03-29 0:52:30 - PHP Notice: Undefined variable: logged in /home/XXXX/public_html/catalog/view/theme/mycustomtheme/template/common/column_right.tpl on line 2
2012-03-29 0:52:30 - PHP Notice: Undefined variable: logged in /home/XXXX/public_html/catalog/view/theme/mycustomtheme/template/common/home.tpl on line 35
2012-03-29 0:52:30 - PHP Notice: Undefined variable: news in /home/XXXX/public_html/catalog/view/theme/mycustomtheme/template/common/home.tpl on line 63
2012-03-29 0:52:30 - PHP Warning: Invalid argument supplied for foreach() in /home/XXXX/public_html/catalog/view/theme/mycustomtheme/template/common/home.tpl on line 63
Attached is a screenshot of the store front with the errors. Any ideas how to fix this?
2012-03-29 0:52:30 - PHP Notice: Undefined variable: logged in /home/XXXX/public_html/catalog/view/theme/mycustomtheme/template/common/column_right.tpl on line 2
2012-03-29 0:52:30 - PHP Notice: Undefined variable: logged in /home/XXXX/public_html/catalog/view/theme/mycustomtheme/template/common/home.tpl on line 35
2012-03-29 0:52:30 - PHP Notice: Undefined variable: news in /home/XXXX/public_html/catalog/view/theme/mycustomtheme/template/common/home.tpl on line 63
2012-03-29 0:52:30 - PHP Warning: Invalid argument supplied for foreach() in /home/XXXX/public_html/catalog/view/theme/mycustomtheme/template/common/home.tpl on line 63
Attached is a screenshot of the store front with the errors. Any ideas how to fix this?
Last edited by marcvill on Thu Mar 29, 2012 3:35 pm, edited 1 time in total.
- marcvill
- Posts: 7
- Joined: Thu Mar 29, 2012 12:45 am
Re: "Undefined variable" errors after upgrading to 1.5.2.1
Your theme is not compatible. You need to update it.
-

MarketInSG - Posts: 2596
- Joined: Wed Nov 16, 2011 3:53 am
- Location: Singapore
Re: "Undefined variable" errors after upgrading to 1.5.2.1
Thanks for the reply. I see. Yes, I kinda realized that too. This was a custom theme and the problem is, I can't get a hold of the developer who developed this theme. I was hoping I can get answers or advise from this forum so I can try to fix the theme myself to make it compatible with 1.5.2.1. The error points to the home.tpl file and refers to lines 35 and 63 that are causing the "underfined variables" error. Here are the lines:
line 35: <?php if (!$logged) { ?>
line 63: <?php foreach($news as $news_info): ?>
I'm not a developer but it seems to me that the functions or lines above are no longer valid or being used with the latest 1.5.2.1 version. If this is the case, then what updated functions should use to replace the ones above?
line 35: <?php if (!$logged) { ?>
line 63: <?php foreach($news as $news_info): ?>
I'm not a developer but it seems to me that the functions or lines above are no longer valid or being used with the latest 1.5.2.1 version. If this is the case, then what updated functions should use to replace the ones above?
- marcvill
- Posts: 7
- Joined: Thu Mar 29, 2012 12:45 am
Re: "Undefined variable" errors after upgrading to 1.5.2.1
Its likely just a header.tpl change.. you may be able to stumble around
try changing:
to
try changing:
- Code: Select all
<?php if (!$logged) { ?>
to
- Code: Select all
<?php if (!$this->customer->isLogged()) { ?>

Donate!|OpenCart Basics|GeoZones
Help me get more development cloud storage - Click Here to get DropBox
-

Qphoria - Administrator
- Posts: 18200
- Joined: Mon Jul 21, 2008 7:02 pm

Re: "Undefined variable" errors after upgrading to 1.5.2.1
Thanks a lot!! It worked like a charm. The first 'undefined variables' error that refers to 'line 35: <?php if (!$logged) { ?>' is now gone after updating the home.tpl template file with '<?php if (!$this->customer->isLogged()) { ?>' as Qphoria suggested.
But the second "undefined variables" error that refer to to 'line 63: <?php foreach($news as $news_info): ?>" is still showing. I take it that this line is no longer supported in the latest 1.5.2.1 version. Any ideas how to solve this error?
But the second "undefined variables" error that refer to to 'line 63: <?php foreach($news as $news_info): ?>" is still showing. I take it that this line is no longer supported in the latest 1.5.2.1 version. Any ideas how to solve this error?
- marcvill
- Posts: 7
- Joined: Thu Mar 29, 2012 12:45 am
Re: "Undefined variable" errors after upgrading to 1.5.2.1
That's something custom for your shop. It's never been a part of OpenCart.
-Ryan
VQMod Manager: FREE extension to fully manage your VQMods from Admin!
Admin Enhancement Suite: Powerful Admin features and enhancements
Dependent Options: Option values displayed based on customer input
Catalog Mode: Disable "Add to Cart" and display your store in view-only
Unofficial OpenCart Wiki | Commercial Support and Development
VQMod Manager: FREE extension to fully manage your VQMods from Admin!
Admin Enhancement Suite: Powerful Admin features and enhancements
Dependent Options: Option values displayed based on customer input
Catalog Mode: Disable "Add to Cart" and display your store in view-only
Unofficial OpenCart Wiki | Commercial Support and Development
-

rph - Posts: 2697
- Joined: Thu Jan 07, 2010 9:05 pm
- Location: Lincoln, Nebraska
Re: "Undefined variable" errors after upgrading to 1.5.2.1
Apparently it's part of some "News/Blog" module that our developer must have installed. This "News/Blog" appears under Modules and I believe this is not one of those built-in modules of OC as I don't see this from another fresh installation of OC. Perhaps what I can try doing is check with the module developer to see if there's any updates or fixes.
I have no clue how to determine what this "News/Blog" module is officially called so I can search for it under the OC site's Extensions section. I can't determine who's the module author/developer too. How do I find these out?
Any help is very much appreciated, thanks guys!
I have no clue how to determine what this "News/Blog" module is officially called so I can search for it under the OC site's Extensions section. I can't determine who's the module author/developer too. How do I find these out?
Any help is very much appreciated, thanks guys!
- marcvill
- Posts: 7
- Joined: Thu Mar 29, 2012 12:45 am
Re: "Undefined variable" errors after upgrading to 1.5.2.1
Any help out there from anyone?
- marcvill
- Posts: 7
- Joined: Thu Mar 29, 2012 12:45 am
Re: "Undefined variable" errors after upgrading to 1.5.2.1
Hi Marcvill,
I wouldn't mind taking a look at it. Send me a PM.
I wouldn't mind taking a look at it. Send me a PM.
- kdmp
- Posts: 348
- Joined: Thu Jun 04, 2009 2:40 am
- Location: Ontario, Canada
9 posts
• Page 1 of 1
Return to Installation, Upgrade, & Config Support
Who is online
Users browsing this forum: alex80ks and 37 guests














