i'm trying page url key category pages different store views. have 3 stores set in magento installation. want implement hrefhang tags in category pages. cannot access category url keys of other store views when i'm in default store , vice versa.
i have category object from,
$category = mage::registry('current_category');
any ideas?
it seems best way category urls under different store current 1 make use of magento’s mage_core_model_app_emulation
. here’s example of how that:
/** * @var $categoryid - numeric category id want url of. * @var $altstoreid - numeric id of other store view url from. */ $env = mage::getsingleton('core/app_emulation')->startenvironmentemulation($altstoreid); $category = mage::getmodel('catalog/category')->load($categoryid); $alturl = $category->geturl(); mage::getsingleton('core/app_emulation')->stopenvironmentemulation($env);
Comments
Post a Comment