Notice: Trying to get property of non-object in
Posted: Wed Sep 24, 2014 3:24 am
Hi Guys,
I'm working with a joomla site using Hikashop and I'm getting the following message at the top of my screen at the checkout on our website.
Notice: Trying to get property of non-object in /var/www/vhosts/purrfectlyyappy.com/httpdocs/templates/purrfectlyyappy/index.php on line 10
Notice: Trying to get property of non-object in /var/www/vhosts/purrfectlyyappy.com/httpdocs/templates/purrfectlyyappy/index.php on line 11
Notice: Trying to get property of non-object in /var/www/vhosts/purrfectlyyappy.com/httpdocs/templates/purrfectlyyappy/index.php on line 12
This does not apply on any other page on the site apart from the checkout page.
These are the first 13 lines of our index.php code for the site
Any ideas why im getting these warnings? Apologies i am a PHP n00b!!
Thanks
Sam
I'm working with a joomla site using Hikashop and I'm getting the following message at the top of my screen at the checkout on our website.
Notice: Trying to get property of non-object in /var/www/vhosts/purrfectlyyappy.com/httpdocs/templates/purrfectlyyappy/index.php on line 10
Notice: Trying to get property of non-object in /var/www/vhosts/purrfectlyyappy.com/httpdocs/templates/purrfectlyyappy/index.php on line 11
Notice: Trying to get property of non-object in /var/www/vhosts/purrfectlyyappy.com/httpdocs/templates/purrfectlyyappy/index.php on line 12
This does not apply on any other page on the site apart from the checkout page.
These are the first 13 lines of our index.php code for the site
Code: Select all
<?php
defined('_JEXEC') or die;
$app = JFactory::getApplication();
$leftbar = 1;
$rightbar = 1;
//$active = JFactory::getApplication()->getMenu()->getActive();
$menu = JFactory::getApplication()->getMenu();
$active = $menu->getActive();
$menuname = $active->title;
$parentId = $active->tree[0];
$parentName = str_replace(" ","",strtolower($menu->getItem($parentId)->title));
?>Thanks
Sam