Magento get product URL by id

on with 2 Replies

Here, i am going to post simple Magento tweak. That is how to get the product URL by product id. Sometimes we only have the product id, That’s enough to get all the product instance.So using below code we can get the product url by id.

  $my_product = Mage::getModel('catalog/product')->load($product_id); 
  $my_product_url = $my_product->getProductUrl();  

Hope it helps someone.

Posted in Magento by .

About Gowri

I am professional web developer with 4+ years experience. PHP, jQuery, WordPress, Magento and Symfony2 are my key skills in web development. I am working with strong enthusiastic team with spirit. We provide all web related solution like HTML/CSS development, Web graphic design and Logo.

2 thoughts on “Magento get product URL by id

Leave a Reply

Your email address will not be published. Required fields are marked *