From 6e0e5b1ab66b8140e5e58783fb2d4cf265aa4a05 Mon Sep 17 00:00:00 2001 From: Mikael Rasmussen Date: Wed, 25 May 2016 15:20:50 +0200 Subject: [PATCH] Update Data.php added new method for category url --- app/code/community/Inchoo/Alternate/Helper/Data.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/code/community/Inchoo/Alternate/Helper/Data.php b/app/code/community/Inchoo/Alternate/Helper/Data.php index 42df124..eb35361 100644 --- a/app/code/community/Inchoo/Alternate/Helper/Data.php +++ b/app/code/community/Inchoo/Alternate/Helper/Data.php @@ -14,5 +14,15 @@ public function rewrittenProductUrl($productId, $categoryId, $storeId) $coreUrl->loadByIdPath($idPath); return $coreUrl->getRequestPath(); } + + public function rewrittenCategoryUrl($categoryId, $storeId) + { + $coreUrl = Mage::getModel('core/url_rewrite'); + $idPath = sprintf('category/%d', $categoryId); + $coreUrl->setStoreId($storeId); + $coreUrl->loadByIdPath($idPath); + + return $coreUrl->getRequestPath(); + } }