/** * Make sure that the category view doesn't cache when there are * messages in the session * * @param Mage_Catalog_Block_Category_View $block * @return type */ public function applyCategoryView(Mage_Catalog_Block_Category_View $block) { // The "messages" block is session-dependent, don't cache if (Mage::helper('cache')->responseHasMessages()) { $block->setData('cache_lifetime', null); return; } }
protected function _prepareLayout() { parent::_prepareLayout(); $this->getLayout()->createBlock('catalog/breadcrumbs'); if ($headBlock = $this->getLayout()->getBlock('head')) { $category = $this->getCurrentCategory(); if ($title = $category->getMetaTitle()) { $headBlock->setTitle($title); } if ($description = $category->getMetaDescription()) { $headBlock->setDescription($description); } if ($keywords = $category->getMetaKeywords()) { $headBlock->setKeywords($keywords); } if ($this->helper('catalog/category')->canUseCanonicalTag()) { $rewrite = Mage::getStoreConfig('web/seo/use_rewrites', Mage::app()->getStore()->getId()); // Rewrite if ($rewrite == 1) { $headBlock->removeItem('link_rel', $category->getUrl()); $headBlock->addLinkRel('canonical', Mage::getModel('seofilter/catalog_layer_filter_item')->getSpeakingFilterUrl(FALSE, TRUE)); } else { $headBlock->addLinkRel('canonical', $category->getUrl()); } } /* want to show rss feed in the url */ if ($this->IsRssCatalogEnable() && $this->IsTopCategory()) { $title = $this->helper('rss')->__('%s RSS Feed', $this->getCurrentCategory()->getName()); $headBlock->addItem('rss', $this->getRssLink(), 'title="' . $title . '"'); } } return $this; }
public function getCmsBlockHtml() { if (parent::isContentMode()) { return Mage::helper('adjnav')->wrapProducts(parent::getCmsBlockHtml()); } return parent::getCmsBlockHtml(); }
public function getProductListHtml() { $html = parent::getProductListHtml(); if ($this->getCurrentCategory()->getIsAnchor()) { $html = Mage::helper('multilayer')->wrapProducts($html); } return $html; }
protected function _prepareLayout() { parent::_prepareLayout(); $headBlock = $this->getLayout()->getBlock('head'); if (($category = $this->getCurrentCategory()) && $this->getCurrentCategory()->getMetaTitle()) { $headBlock->setData('title', $category->getMetaTitle()); } }
/** * Retrieve current category model object * * @return Mage_Catalog_Model_Category */ public function getCurrentCategory() { $categoryId = (int) $this->getRequest()->getQuery('cat'); if (!$categoryId) { return parent::getCurrentCategory(); } else { return Mage::getModel('catalog/category')->setStoreId(Mage::app()->getStore()->getId())->load($categoryId); } }
protected function _prepareLayout() { if ($headBlock = $this->getLayout()->getBlock('head')) { if ($robots = $this->getCurrentCategory()->getMetaRobots()) { $headBlock->setRobots($robots); } } return parent::_prepareLayout(); }
function getTemplate() { if ($this->shouldShowSplash()) { $this->disableLayeredNavigation(); return 'vf/vaf/splash.phtml'; } // if($this->getConfig()->category->mode == 'group') // { // return 'vaf/group/result.phtml'; // } return parent::getTemplate(); }
/** * Retrieve messages block * * We're overriding this function to add the campaign block to category view pages, in case campaigns are enabled. * We'll be using the messages class we created under the same folder, to send a modified object that has the campaign * html right after all the standard messages. * * @return Mage_Core_Block_Messages */ public function getMessagesBlock() { if (!Mage::helper('conversionpro')->getIsEngineAvailableForNavigation()) { return parent::getMessagesBlock(); } //Fetching the product list before running any code that has to do with campaigns, so as to trigger the request // to the Quiser API that will give us the info we need about the dynamic properties. $this->getChildHtml('product_list'); //Get the standard messages block, as well as the html part separately. $this->_messagesBlock = parent::getMessagesBlock(); $groupedHtml = $this->_messagesBlock->getGroupedHtml(); //Only add the campaign block in case campaigns are enabled in the admin. if (Mage::helper('conversionpro')->isCampaignsEnabled()) { //Add the campaigns html to the end of the list of messages. $groupedHtml .= $this->getLayout()->createBlock('Mage_Core_Block_Template', 'conversionpro_campaigns', array('template' => 'conversionpro/catalog/campaigns.phtml'))->toHtml(); } //Create a block that has a getter & setter for groupedHtml. $newBlock = $this->getLayout()->createBlock('Celebros_Conversionpro_Block_Catalog_Category_Messages', 'conversionpro_messages'); $newBlock->setGroupedHtml($groupedHtml); return $newBlock; }
/** * Collects list of objects in product list * * @param Mage_Catalog_Block_Category_View $object * @return Mage_Catalog_Model_Category[] */ public function collect($object) { return array($object->getCurrentCategory()); }
public function getProductListHtml() { $html = parent::getProductListHtml(); $html = Mage::helper('multiselectnavigation')->wrapProducts($html); return $html; }