CHttpException

Товар не найден в каталоге

/home/c/ch21813/sexshop/public_html/protected/controllers/ShopController.php(267)

255     /**
256      * Action show a product page
257      *
258      * @param $id
259      */
260     public function actionProduct($id)
261     {
262         $this->checkModuleActive('shop');
263 
264         $product = Product::model()->findByPk($id);
265 
266         if (!$product || !$product->category) {
267             throw new CHttpException(404, 'Товар не найден в каталоге');
268         }
269 
270         $category = $product->category;
271 
272         $this->breadcrumbs->add($this->getHomeTitle(), '/shop');
273         $this->breadcrumbs->addByNestedSet($category, '/shop/category');
274         $this->breadcrumbs->add($category->title, array('/shop/category', 'id' => $category->id));
275         $this->breadcrumbs->add($product->title);
276 
277         // set open graph tags
278         Yii::app()->clientScript->registerMetaTag('product', null, null, ['property' => 'og:type ']);
279         Yii::app()->clientScript->registerMetaTag($product->title, null, null, ['property' => 'og:title']);

Stack Trace

#9
+
 /home/c/ch21813/sexshop/public_html/index.php(63): CApplication->run()
58 
59 $config = dirname(__FILE__) . '/protected/config/main.php';
60 
61 require_once($yii);
62 
63 Yii::createWebApplication($config)->run();
64 
65 if (isset($_GET['time']) || D_MODE_LOCAL) {
66 //    echo '<br>';
67 //    echo microtime(true) - $start;
68 }
2024-03-29 14:08:24 Apache/2.4.29 Yii Framework/1.1.22