Created
February 2, 2017 13:30
-
-
Save seansan/1397a892fa496d5b5f98c2d85e4fa82e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$store_id = Mage::app()->getStore()->getId(); | |
$rootId = Mage::app()->getStore($store_id)->getRootCategoryId(); | |
$catCollection = $_product->getCategoryCollection()->addAttributeToSelect('name')->addUrlRewriteToResult() | |
->addIsActiveFilter()->addFieldToFilter('path', array('like'=> "1/$rootId/%"))->setOrder('id','ASC'); | |
$cache = Mage::app()->getCache(); // [TODO] Cache the collection result not sure if this works | |
$cache->setLifetime(28800); | |
$catCollection->initCache($cache,'customcategoryfilter_', array('collections')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment