public function init()
 {
     parent::init();
     $this->hurl = Axis_HumanUri::getInstance();
     $this->_helper->breadcrumbs(array('label' => Axis::translate('catalog')->__('Catalog'), 'route' => 'product_catalog'));
     $this->view->tags()->disableAction();
 }
Beispiel #2
0
 public function init()
 {
     $this->hurl = Axis_HumanUri::getInstance();
     $filterSet = array();
     $filters = $this->_getActiveFilters();
     $filterSet['category'] = $this->_getCategoryFilters($filters);
     $filterSet['price'] = $this->_getPriceFilters($filters);
     if (!$this->hurl->hasParam('manufacturer')) {
         $filterSet['manufacturer'] = $this->_getManufacturerFilters($filters);
     }
     // Attribute filters
     $filterSet['attributes'] = $this->_getAttributeFilters($filters);
     if (count($filters) && !$this->hurl->hasParam('cat') || 1 < count($filters) && $this->hurl->hasParam('cat')) {
         // we don't show categories in filters
         $this->filters = $filterSet;
         return true;
     }
     foreach ($filterSet as $filter) {
         if (count($filter)) {
             $this->filters = $filterSet;
             return true;
         }
     }
     return false;
 }
Beispiel #3
0
 /**
  * Retrieve singleton instance of Axis_HumanUri_Adapter
  *
  * @static
  * @return Axis_HumanUri_Adapter_Abstact
  */
 public static function getInstance()
 {
     if (null === self::$_instance) {
         self::$_instance = Axis_HumanUri::factory(Axis::config()->front->humanUrlAdapter);
     }
     return self::$_instance;
 }
Beispiel #4
0
 protected function _getCacheKeyParams()
 {
     $keyInfo = parent::_getCacheKeyParams();
     if ($catId = Axis_HumanUri::getInstance()->getParamValue('cat')) {
         $keyInfo[] = $catId;
     }
     return $keyInfo;
 }
Beispiel #5
0
 protected function _beforeRender()
 {
     $ids = Axis::single('discount/discount')->cache()->getSpecialProducts(Axis_HumanUri::getInstance()->getParamValue('cat'), $this->getProductsCount());
     if (!count($ids)) {
         return false;
     }
     $products = Axis::single('catalog/product')->select('*')->addCommonFields()->addFinalPrice()->where('cp.id IN (?)', $ids)->fetchProducts($ids);
     $this->products = $products;
     return $this->hasProducts();
 }
Beispiel #6
0
 /**
  * @return int
  */
 protected function _getCurrentProductId()
 {
     $_hurl = Axis_HumanUri::getInstance();
     if ($_hurl->hasParam('product')) {
         $productId = $_hurl->getParamValue('product');
     } else {
         $productId = Zend_Controller_Front::getInstance()->getRequest()->getParam('product', 0);
     }
     return $productId;
 }
Beispiel #7
0
 protected function _beforeRender()
 {
     $select = Axis::model('catalog/product')->select('id')->addFilterByAvailability()->joinCategory()->where('cc.site_id = ?', Axis::getSiteId())->where('cp.ordered > 0')->order(array('cp.ordered DESC', 'cp.id DESC'))->limit($this->getProductsCount());
     if ($catId = Axis_HumanUri::getInstance()->getParamValue('cat')) {
         $select->where('cc.id = ?', $catId);
     }
     $list = $select->fetchList();
     if (!$list['count']) {
         return false;
     }
     $this->products = $list['data'];
     return $this->hasProducts();
 }
Beispiel #8
0
 protected function _getProductId()
 {
     $productId = $this->product_id;
     // received from box configuration
     if (!is_numeric($productId)) {
         $_hurl = Axis_HumanUri::getInstance();
         if ($_hurl->hasParam('product')) {
             $productId = $_hurl->getParamValue('product');
         }
     }
     if (!is_numeric($productId)) {
         $productId = Zend_Controller_Front::getInstance()->getRequest()->getParam('product', 0);
     }
     if (Zend_Registry::isRegistered('catalog/current_product')) {
         $product = Zend_Registry::get('catalog/current_product');
         if (!$productId || $product->id == $productId) {
             $this->product = $product;
         }
     }
     return $productId;
 }
Beispiel #9
0
 public function __construct()
 {
     $this->_hurl = Axis_HumanUri::getInstance();
     $this->_enabledSsl = Axis::config('core/frontend/ssl');
     $this->_languageUrl = Axis_Locale::getLanguageUrl();
 }
Beispiel #10
0
 protected function _getCacheKeyParams()
 {
     $this->hurl = Axis_HumanUri::getInstance();
     $filters = $this->_getActiveFilters();
     return array(serialize($filters));
 }