public function getdetailsAction() { $item = $this->_getParam("item"); $this->view->item = $item; $intval = is_numeric($item); $db = new Application_Model_DbTable_Products(); if (!$intval) { $product = $db->getProductByTranslit($item); } else { $product = $db->getProductById($item); } if (count($product) > 0) { $product = $product[0]; $this->view->entrance = glob_makeEntrance($product); $watched = array(); if (isset($_COOKIE['watched'])) { $watched = $db->getProductsByIds($_COOKIE['watched']); } $this->view->watched = $watched; $this->product_addToAlreadyWatched($product['id']); $cats_ar = $this->category_getItemCats($product); $this->view->section = $cats_ar['section']; $this->view->cat = $cats_ar['cat']; $this->view->itemname = $product['name']; $this->view->details = $product; Zend_Registry::set('section', $cats_ar['section']); Zend_Registry::set('cat', $cats_ar['cat']); $where_ar = array(); $where_ar['name'] = $product['name']; $s = glob_makeWhereCondition($where_ar); $params = array('perpage' => SIMILAR_PROD_NUM, 'curpage' => 1, 'order' => '', 'where' => $s, 'search' => $product['name']); $pager = null; $db->getProductsBySearch($params, $pager); $this->view->similar = $pager->getCurrentItems(); //->toArray(); $this->view->adsense = glob_getGoogleAd(3); } else { $this->_helper->viewRenderer('noproduct'); } }