This question already has an answer here:
- Efficient get product url from id 4 answers
i want to get product url from id with category path in url :
for same product url are like :
with my code i am able to get 2nd url , what to do to get 1st one from code , pls help..
$store = Mage::app()->getStore(); $path = Mage::getResourceModel('core/url_rewrite') ->getRequestPathByIdPath('product/456', $store); $url = $store->getBaseUrl($store::URL_TYPE_WEB) . $path;
what to add extra to make it work