I am working on Magento custom module admin grid I want to show product id and related product id and other product information.

Please help me to do this.

  • Can you provide more info about this?
    – Sukeshini
    Commented Feb 7, 2014 at 5:39
  • @Sukeshini i want a page in Admin where I can enter product ID, I can see all related products associated with it and edit the list(add and delete the related produts).
    – Mani Dev
    Commented Feb 7, 2014 at 5:43

3 Answers 3


You can try on this.

Assume you want to find the related products of $product_id.

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

// Get all related product ids of $product.
$allRelatedProductIds = $product->getRelatedProductIds();

foreach ($allRelatedProductIds as $id) {
            $relatedProduct = $model->load($id);

            // get Product's name
            echo $relatedProduct->getName();

            // get product's short description
            echo $relatedProduct->getShortDescription();

            // get Product's Long Description
            echo $relatedProduct->getDescription();

            // get Product's Regular Price
            echo $relatedProduct->getPrice();

            // get Product's Special price
            echo $relatedProduct->getSpecialPrice();

            // get Product's Url
            echo $relatedProduct->getProductUrl();

            // get Product's image Url
            echo $relatedProduct->getImageUrl();


Its very simple add the below code in your custom module tab.php file.

 $this->addTab('related', array(
            'label'     => Mage::helper('catalog')->__('Related Products'),
            'url'       => $this->getUrl('*/*/related', array('_current' => true)),
            'class'     => 'ajax',

and run your module.

Hope you got the solutions.

$RelProduct = Mage::getModel('catalog/product')->load($p_id)->getRelatedProductIds();
echo "<div class='product clearfix'>";
foreach ($RelProduct as $id) {
    $Product = Mage::getModel('catalog/product')->load($id);
    echo "<div class='product__item' style='float: left;'>"."<a href='#' class='product__link'>";
    echo "<img src=".$relatedProduct->getImageUrl()." width='200' height='200' />"."</br>";
    echo $Product->getName()."</br>";
    echo $Product->getDescription()."</br>";
    echo $Product->getPrice()."</br>";
    echo "</a></div>";
echo "</div>";

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.