Add column to Magento admin catolog > manage products

Add column to Magento admin catolog > manage products

September 4, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Add column to Magento admin catolog > manage products

Adding a Custom Column to Magento Admin Product List

Hello fellow Magento developers! Today I’m going to guide you through adding a custom column to your admin catalog > manage products section. We’ll create a new column that lists any related products associated with each product in the list.

Why Add This Column?

Displaying related products directly in the product grid can greatly enhance productivity for store managers and admins. They won’t need to click into each individual product page to see which items are linked. This is especially useful in larger catalogs where keeping track of relationships becomes challenging.

Getting Started: The Basics

First, let me quickly recap how to add a custom column in general. If you’ve ever added columns before, skip ahead. Otherwise, check out our comprehensive guide on adding custom columns for a refresher.

For this scenario, let’s assume that related products are stored as an array of product IDs in a custom field called related_products in your catalog_product_entity table.

Step 1: Override the Grid Block

In your custom theme’s layout folder (app/design/frontend/[vendor]/[theme]/layout), create or modify your catalog_product_grid.xml file. Add the following after the <reference name="content"> line:

<block type="core/text_list" name="grid.additional.columns">
  <block type="laravelcompany_adminhtml/catalog_product_helper" template="laravelcompany/adminhtml/catalog/product/grid/renderer.phtml"/>
</block>

This creates a new renderer block for our custom column.

Step 2: Create the Renderer Block

Create the laravelcompany module if you haven’t already (follow this tutorial). In your module’s Block folder, create Catalog/Product/Helper.php. Implement the required methods:

class Helper extends Mage_Core_Block_Text_List
{
    protected function _toHtml()
    {
        $products = Mage::getResourceModel('catalog/product_collection');
        foreach ($products as $product) {
            if (isset($product->getData('related_products')) && is_array(json_decode($product->getData('related_products'), true))) {
                $relatedIds = json_decode($product->getData('related_products'), true);
                $relatedNames = '';
                foreach ($relatedIds as $id) {
                    $relatedProduct = Mage::getModel('catalog/product')->load($id);
                    $relatedNames .= $relatedProduct->getName() . ', ';
                }
                $relatedNames = rtrim($relatedNames, ', ');
            } else {
                $relatedNames = '';
            }

            echo '<tr class="grid-row">';
            echo '<td class="col-rel-products" style="text-align: center;">' . $this->htmlEscape($relatedNames) . '</td>';
            echo '</tr>';
        }
    }
}

This block loads each product and checks for the related_products field. It then formats the related product names into a single string.

Step 3: Create the Column Template

In your module’s template folder under catalog/product/grid, create renderer.phtml. Insert this content:

<?php if ($this->getProducts()): ?>
    <?php foreach ($this->getProducts() as $product): ?>
        <tr class="grid-row">
            <td class="col-rel-products" style="text-align: center;">
                <?= $relatedNames = ''; ?>
                <?php if (isset($product['related_products'])): ?>
                    <?php foreach (json_decode($product['related_products'], true) as $id): ?>
                        <?php $relatedProduct = Mage::getSingleton('catalog/product')->load($id); ?>
                        <?= $relatedNames .= $relatedProduct->getName() . ', '; ?>
                    <?php endforeach; ?>
                <?php endif; ?>
                <?= rtrim($relatedNames, ', ') ?>
            </td>
        </tr>
    <?php endforeach; ?>
<?php endif; ?>

This template handles the actual rendering of the custom column.

Step 4: Add the Column to Grid

In your admin theme’s catalog_product_grid.xml file (same folder as step 1), add this inside the <columns> section:

<column name="related_products" index="related_products">
    <type>text</type>
    <header type="text">Related Products</header>
    <renderer module="laravelcompany" template="catalog/product/grid/renderer.phtml"/>
</column>

This defines the new column and sets its renderer to our custom block.

Conclusion

With these steps, you should now have a shiny new “related products” column in your Magento admin product list. This will greatly improve your ability to manage product relationships directly from the grid view.

Remember, always backup your files before making changes, and test thoroughly on a staging environment first. And if you’re looking for more advanced customization options or need further assistance, don’t hesitate to explore the comprehensive resources available at Laravel Company.

Happy coding!

Catalog Database Themes Admin

Our network