PHP notice

Trying to get property 'product_id' of non-object

/home/getravish/public_html/protected/controllers/ShoppingCartController.php(128)

116         }
117         
118         
119         if(!empty($product))
120         {
121             $product_images = ProductImages::model()->findAll(array('condition'=>'product_id='.$product->product_id));
122         }
123         else
124         {
125             $product_images = array();
126         }
127         
128         $this->getSeoMeta($product->product_id,'P');
129         
130         $this->render('detail',array('product'=>$product,'images'=>$product_images));
131     }
132     
133     public function actionAddToCart()
134     {
135         $product_id = $_POST['product_id'];
136         $quantity = $_POST['quantity'];
137         $member_id = ApplicationSessions::run()->read('member_id');
138         $member_data = Member::model()->findByPk($member_id);
139         $session_id = ApplicationSessions::run()->read('session_id');
140         $cart_data = Cart::model()->find(array('condition'=>'session_id="'.$session_id.'" and product_id='.$product_id));

Stack Trace

#7
+
 /home/getravish/public_html/index.php(13): CApplication->run()
08 defined('YII_DEBUG') or define('YII_DEBUG',true);
09 // specify how many levels of call stack should be shown in each log message
10 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
11 
12 require_once($yii);
13 Yii::createWebApplication($config)->run();
2024-03-28 21:44:13 Apache Yii Framework/1.1.15