_getDataObj()->getData('categoryId') ? $this->_getDataObj()->getData('categoryId') : Qs_Request::getRequestValue('categoryId'); return parent::_getEditForm($options); } protected function _doAddItemAjax() { $result = array(); $request = Qs_Request::getPost(); if (isset($request['product']) && isset($request['cartId']) && is_array($request['product'])) { $this->_getCart()->setPrimaryKey($request['cartId']); $this->_getCart()->clearData(); foreach ($request['product'] as $productId => $quantity) { $this->_getDataObj()->setPrimaryKey($productId); $this->_getDataObj()->clearData(); $data = array( 'productId' => $this->_getDataObj()->getPrimaryKey(), 'quantity' => $quantity ); $result['success'][$productId] = $this->_addToCart($data); } } $this->_displayJson($result); exit; } protected function _getDefaultLinks() { return $this->_prepareNewLink(parent::_getDefaultLinks()); } protected function _prepareNewLink(array $links) { $links['new'] = array('title' => 'Add New ' . $this->getConfig('itemName')); if ($categoryId = $this->_getDataObj()->getFilter('categoryId')) { $links['new']['url'] = $this->url(array( 'action' => 'new', 'categoryId' => (int) $categoryId )); } else { $links['new']['attribs'] = array( 'class' => 'warning', 'onclick' => "alert('" . self::SELECT_COMPANY_MSG . "'); return false;" ); $links['new']['url'] = '#'; } return $links; } }