Error

Call to a member function getOrderedPropertys() on null

/home/myboss/public_html/protected/models/Product.php(424)

412                         if (!empty($row->propertyValue)) {
413                             $price+=$row->code;
414                         }
415                     }
416                 }
417             }
418         }
419         return $price;
420     }
421     public function getListProperty($id_product){
422         $model=Product::model()->findByPk($id_product);
423         $price=$model->sale;
424         $order_prop = $model->getOrderedPropertys();
425         $i=0;
426         $p='';
427         if (!empty($order_prop)) {
428             foreach ($order_prop as $item) {
429                 $ordered_vals = $model->getOrderedPropValue($item->id);
430                 if (!empty($ordered_vals)) {
431                     $row=$ordered_vals[0];
432                     if (!empty($row->propertyValue)) {
433                         $property_value = $row->propertyValue;
434                         if($i==0) $p.=$property_value->id;
435                         else $p.=','.$property_value->id;
436                         $i++;

Stack Trace

#0
+
 /home/myboss/public_html/protected/views/site/pages/product.php(142): Product::getListProperty(null)
137                             <?php
138                         }
139                         ?>
140 
141                         <?php echo CHtml::beginForm(Yii::app()->urlManager->createUrl('site/addCart', array('product_cart' => $model->id)), 'GET', array('class' => 'row shopcart_form')); ?>
142                         <input type="hidden" name="property_cart" class="prop_shopcart_form" value="<?=Product::getListProperty($model->id)?>">
143                         <input type="hidden" name="product_id" value="<?=$model->id; ?>">
144                         <?php
145                         $order_prop = $model->getOrderedPropertys();
146                         if (!empty($order_prop)) {
147                             foreach ($order_prop as $item) {
#5
+
 /home/myboss/public_html/protected/controllers/SiteController.php(456): CController->render("pages/product", array("model" => null))
451             $this->menu=$menu[0]->id;
452             if($menu[0]->parent!=0)
453                 $this->menu=$menu[0]->parent;
454         }
455         Product::model()->updateByPk($model->id, array('hits' => (($model->hits==0)?1:($model->hits+1))));
456         $this->render('pages/product', array('model' => $model));
457     }
458 
459 
460     /*
461     * LIỆT KÊ DANH MỤC THEO CHA
#15
+
 /home/myboss/public_html/index.php(15): CApplication->run()
10 defined('YII_DEBUG') or define('YII_DEBUG',true);
11 // specify how many levels of call stack should be shown in each log message
12 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
13 
14 require_once($yii);
15 Yii::createWebApplication($config)->run();
2024-03-19 13:16:07 LiteSpeed Yii Framework/1.1.16