Magento: how do I add a column to products selection in admin category page?

Magento: how do I add a column to products selection in admin category page?

October 11, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Magento: how do I add a column to products selection in admin category page?

Enhancing Magento Admin Category Page: Adding Custom Columns for Product Type and Visibility

As an experienced developer working with e-commerce platforms like Magneto 2, I often encounter requests to customize the admin interface for enhanced efficiency. One common requirement is adding new columns to the products selection in the category management page.

Understanding the Request

The user wants to display two additional pieces of information on this tab:

  1. Product Type: This will allow administrators to quickly identify configurable master products among their simple child variants.
  2. Visibility: The catalog/search, search, and catalog options can provide a clear overview of each product’s visibility settings.

Implementing the Changes

To proceed with adding these custom columns, we’ll follow these steps:

Step 1: Override the Grid Container

Firstly, you need to create an extension that overrides the Mage_Adminhtml_Block_Catalog_Category_Tab_Products block. This is where the product grid is initially defined.

Step 2: Define New Columns in the Grid Definition

Next, add the following code within your overridden block file:

protected function _prepareCollection()
{
    $collection = Mage::getResourceModel($this->getCollectionClass());
    $this->setCollection($collection);

    parent::_prepareCollection();

    // Add new columns here
    $this->addColumn('type',
        array(
            'header' => $this->__('Product Type'),
            'index'  => 'product_type',
            'width'  => '50px'
        )
    );

    $this->addColumn('visibility',
        array(
            'header' => $this->__('Visibility'),
            'index'  => 'visibility',
            'type'   => 'options',
            'options' => Mage::getSingleton('catalog/product_visibility')->getOptionArray(),
            'width'  => '100px'
        )
    );
}

In this snippet, we’re adding two new columns—one for the product type and one for visibility. The index attribute points to the database field that should be displayed.

Step 3: Update the Database Schema

To ensure your custom columns are saved correctly in the database, you need to modify the catalog_category_entity_int table.

Add a new entry with the following values:

  • Attribute code: visibility
  • Entity type ID: 6 (for category)
  • Column name: visibility
  • frontend input type: select

For product type, ensure that the existing product_type_id column is indexed and used in your custom column.

Remember to always backup your database before making schema changes!

Conclusion

Adding new columns to Magento’s admin grid involves a combination of overriding blocks, modifying collection preparation methods, and updating the database schema. By following these steps, you can enhance your category management interface with relevant product information for increased efficiency.

This guide provides an overview of the necessary code adjustments. For more detailed instructions on extension development and Magneto 2’s architecture, I recommend checking out our comprehensive tutorials at Laravel Company.

As a seasoned developer, I understand that customizing Magento can be complex but highly rewarding for optimizing your e-commerce workflow. Don’t hesitate to reach out if you need further assistance or have other requests!

Catalog Extensions Admin Configuration

Our network