Tuesday, October 1, 2013

DISPLAY RELATED PRODUCTS ANYWHERE IN MAGENTO

<?php

//Start loading a product resources
$product = Mage::getModel('catalog/product')->load($productId);

//save the product into the registry
Mage::register('product', $product);

//display $product's related products
echo $this->getLayout()->createBlock('catalog/product_list_related')->setTemplate('catalog/product/list/related.phtml')->toHtml();

?>

No comments:

Post a Comment

Please mention your comments.......