public function demoeditAction() { if ($this->tplVars['lvals']['canEdit']) { array_push($this->tplVars['header']['actions']['names'], array('name' => 'demoedit', 'menu_name' => 'Edit Product\'s Demolimits')); array_push($this->viewIncludes, 'products/demoAdd.tpl'); array_push($this->viewIncludes, 'products/demoList.tpl'); if ($this->_hasParam('id') && $this->_hasParam('lang')) { $pId = $this->_getParam('id'); $lang = $this->_getParam('lang'); $saved = $this->_hasParam('saved') ? $this->_getParam('saved') : '0'; $products = new AdminProducts(); $this->tplVars['lvals']['language'] = $lang; $this->tplVars['lvals']['product'] = $pId; $this->tplVars['lvals']['title'] = $products->getProduct($pId); $this->tplVars['lvals']['saved'] = $saved; $this->tplVars['demolimits'] = $products->getDemo($lang, $pId); } } else { $this->_redirect('/products/list/'); } }
public function additional2productAction() { if ($this->_hasParam('id')) { $productId = $this->_getParam('id'); if ($this->_request->isPost()) { if ($this->_request->getPost('addOffer')) { $this->purchaseHandler->addAdditionalFeature2Product($this->_request->getPost('feature'), $productId); } } $products = new AdminProducts(); $this->tplVars['purchase']['prices'] = $this->purchaseHandler->getAdditionalFeatures2ProductPrices($productId); $this->tplVars['purchase']['features'] = $this->purchaseHandler->getAdditionalFeatures($productId); $this->tplVars['header']['actions']['names'][] = array('name' => 'prices', 'menu_name' => 'Edit prices', 'params' => array('id' => $productId)); $this->tplVars['header']['actions']['names'][] = array('name' => 'bundles', 'menu_name' => 'Edit bundles', 'params' => array('id' => $productId)); $this->tplVars['header']['actions']['names'][] = array('name' => 'additional2product', 'menu_name' => 'Edit product additional offers prices', 'params' => array('id' => $productId)); $this->tplVars['purchase']['productTitle'] = $products->getProduct($productId); array_push($this->tplVars['page_css'], 'pages.css'); array_push($this->tplVars['page_js'], 'purchase.js'); array_push($this->viewIncludes, 'purchase/additional2productList.tpl'); array_push($this->viewIncludes, 'purchase/additional2productAdd.tpl'); } }