/** * 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; }