/** * Initialize widget (set attributes) * * @param array $params Widget params * * @return void */ public function setWidgetParams(array $params) { parent::setWidgetParams($params); $this->widgetParams[\XLite\View\Pager\APager::PARAM_SHOW_ITEMS_PER_PAGE_SELECTOR]->setValue(false); $this->widgetParams[\XLite\View\Pager\APager::PARAM_ITEMS_COUNT]->setValue(\XLite\Core\Config::getInstance()->XC->Reviews->reviewsCountPerTab); $this->widgetParams[\XLite\View\Pager\APager::PARAM_ITEMS_PER_PAGE]->setValue(\XLite\Core\Config::getInstance()->XC->Reviews->reviewsCountPerTab); $this->widgetParams[\XLite\View\Pager\APager::PARAM_ONLY_PAGES]->setValue(true); }
/** * Return category id of current page * * @return integer */ public function getCategoryId() { $categoryId = \XLite\Core\Request::getInstance()->category_id; if (empty($categoryId)) { $cellName = \XLite\Module\XC\Reviews\View\ItemsList\Model\Customer\Review::getSessionCellName(); $cell = (array) \XLite\Core\Session::getInstance()->{$cellName}; $categoryId = isset($cell['category_id']) ? $cell['category_id'] : $this->getProduct()->getCategoryId(); } return $categoryId; }
/** * Return product id * * @return integer */ public function getProductId() { $productId = \XLite\Core\Request::getInstance()->product_id; if (empty($productId)) { $cellName = \XLite\Module\XC\Reviews\View\ItemsList\Model\Customer\Review::getSessionCellName(); $cell = (array) \XLite\Core\Session::getInstance()->{$cellName}; $productId = $cell['product_id']; } return $productId; }