// Inside a controller $request = Mage::app()->getRequest(); $productId = $request->getParam('id'); // assume this is a product ID $productUrl = Mage::getModel('catalog/product')->load($productId)->getUrl(); // retrieve product URL $this->_redirectUrl($productUrl); // redirect to the product page
// Inside a template file $productUrl = $this->getProduct()->getUrl(); // retrieve product URL Product PageIn this example, getUrl() is used to retrieve the URL of a product and create a link to that page. Package/library: This method is part of the Magento Core Library.