public function viewAction()
 {
     $request = $this->getRequest();
     if ($request->isXmlHttpRequest()) {
         if ($category = $this->_initCatagory()) {
             $this->getResponse()->setHeader('Cache-Control', 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0')->setHeader('Pragma', 'no-cache')->setHeader('Expires', 'Thu, 19 Nov 1981 08:52:00 GMT')->setBody($this->_getAjaxLayeredNav($category));
         }
     } else {
         parent::viewAction();
     }
 }
 public function viewAction()
 {
     $this->setFlag('', 'no-renderLayout', true);
     parent::viewAction();
     $response = array('content_html' => $this->getLayout()->getBlock('content')->toHtml(), 'layered_navigation_html' => $this->getLayout()->getBlock('catalog.itoris_leftnav')->setTemplate('itoris/layerednavigation/layer/view/content.phtml')->toHtml());
     if ($priceRangeBlock = $this->getLayout()->getBlock('layer_filter_price_range')) {
         if ($priceRangeBlock->canBeShown()) {
             /** @var $priceRangeBlock Itoris_LayeredNavigation_Block_Layer_Filter_Price_Range */
             $response['price_range_config'] = $priceRangeBlock->getConfig();
         }
     }
     $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));
 }
 /**
  * Category view action
  */
 public function viewAction()
 {
     if (!Mage::helper('searchanise/ApiSe')->checkSearchaniseResult(true)) {
         return parent::viewAction();
     }
     if ($category = $this->_getCurCategory()) {
         $display_mode = $category->getData('display_mode');
         if (Mage::helper('searchanise')->checkEnabled()) {
             $block_toolbar = $this->getLayout()->createBlock($this->_defaultToolbarBlock, microtime());
             Mage::helper('searchanise')->execute(Simtech_Searchanise_Helper_Data::VIEW_CATEGORY, $this, $block_toolbar, $category);
         }
     }
     return parent::viewAction();
 }
 public function viewAction()
 {
     $oneRequest = $this->getRequest();
     if ($oneRequest->isXmlHttpRequest()) {
         if ($category = $this->_initCatagory()) {
             if ($oneRequest->getParam('l')) {
                 $this->getResponse()->setBody($this->_getLayeredNavHtml());
             } else {
                 $this->getResponse()->setBody($this->_getListHtml());
             }
         }
     } else {
         parent::viewAction();
     }
 }
 /**
  * View action
  *
  * @return void
  */
 public function viewAction()
 {
     if (!$this->getRequest()->isAjax()) {
         return parent::viewAction();
     }
     if ($category = $this->_initCatagory()) {
         $design = Mage::getSingleton('catalog/design');
         $settings = $design->getDesignSettings($category);
         // apply custom design
         if ($settings->getCustomDesign()) {
             $design->applyCustomDesign($settings->getCustomDesign());
         }
         Mage::getSingleton('catalog/session')->setLastViewedCategoryId($category->getId());
         $update = $this->getLayout()->getUpdate();
         $update->addHandle('default');
         if (!$category->hasChildren()) {
             $update->addHandle('catalog_category_layered_nochildren');
         }
         $this->addActionLayoutHandles();
         $update->addHandle($category->getLayoutUpdateHandle());
         $update->addHandle('CATEGORY_' . $category->getId());
         $this->loadLayoutUpdates();
         // apply custom layout update once layout is loaded
         if ($layoutUpdates = $settings->getLayoutUpdates()) {
             if (is_array($layoutUpdates)) {
                 foreach ($layoutUpdates as $layoutUpdate) {
                     $update->addUpdate($layoutUpdate);
                 }
             }
         }
         $this->generateLayoutXml()->generateLayoutBlocks();
         // apply custom layout (page) template once the blocks are generated
         if ($settings->getPageLayout()) {
             $this->getLayout()->helper('page/layout')->applyTemplate($settings->getPageLayout());
         }
         if ($root = $this->getLayout()->getBlock('root')) {
             $root->addBodyClass('categorypath-' . $category->getUrlPath())->addBodyClass('category-' . $category->getUrlKey());
         }
         $this->_initLayoutMessages('catalog/session');
         $this->_initLayoutMessages('checkout/session');
         $filterHtml = $this->getLayout()->getBlock('catalog.leftnav')->toHtml();
         $productsHtml = $this->getLayout()->getBlock('category.products')->toHtml();
         $jsonData = json_encode(array('filter' => $filterHtml, 'products' => $productsHtml));
         $this->getResponse()->appendBody($jsonData);
     }
 }
Example #6
0
 public function _construct()
 {
     parent::_construct();
 }