I need custom tab for specific product type only not for all product type

I need custom tab for specific product type only not for all product type

October 5, 2026 · Illustrated author avatarBy Stefan Bogdanescu
I need custom tab for specific product type only not for all product type

Adding Custom Tabs for Specific Product Types in Magento

As a senior developer specializing in e-commerce platforms, I often receive queries about customizing product attributes and tabs within the Magento admin panel. Recently, a client asked how to add a new tab like “Price - Size” specifically for their custom product type (custproduct) without affecting other types.

Understanding the Problem

The client attempted to add a new attribute using the existing codes from link-1 and link-2. However, these codes added the new tab to all product types.

The client wanted a solution that mirrored this StackOverflow question but implemented through coding. Their current mysql4-install-0.1.0.php file looked like this:

//... (other code)

$installer->addAttribute('catalog_product', 'limits', array(
    //... (attribute properties)
    'apply_to' => My_Custproduct_Model_Product_Type::TYPE_CustomProduct_PRODUCT,
));

$installer->addAttributeGroup('catalog_product', 'Default','Price - Size', 40);
$installer->addAttributeToSet('catalog_product','Default', 'Price - Size', 'limits');

$fieldList = array('price','special_price',...);
foreach ($fieldList as $field) {
    //... (update attributes)
}
$installer->endSetup();

The issue lies in the apply_to attribute setting. Even though it was set to the custom product type, the tab still appeared for all types.

Solving the Issue

To resolve this, you need to modify how Magento applies the new attribute:

  1. Update the $fieldList array: Add the new ‘limits’ attribute to the $fieldList array used in the foreach loop. This ensures that the attribute is applied only to the specified fields within the custom product type.

Here’s the updated section of the code:

$fieldList = array('price','special_price','special_from_date','special_to_date',
    'minimal_price','cost','tier_price','weight','tax_class_id', 'limits');

foreach ($fieldList as $field) {
    //... (rest of the code)
}
  1. Ensure the custom product type is recognized: In your custproduct.xml file under app/code/core/Mage/Catalog/etc/types.xml, make sure you have defined the new attribute set:
<product_type id="customproduct">
    <label>Custom Product</label>
    <parent_id>simple</parent_id>
    <allowed_attributes>limits</allowed_attributes>
    <!-- other attributes -->
</product_type>
  1. Clear cache and reindex: After making these changes, clear the Magento cache using php shell/indexer.php --reindexall in the terminal or through the admin panel at System > Cache Management > Submit.

Conclusion

Adding a custom tab to a specific product type requires careful configuration of attribute sets and application. By updating the $fieldList array and ensuring that the custom product type is correctly defined, you can add tabs for specific types without affecting others.

Remember to always test changes thoroughly in a staging environment before deploying them to your live store. If you need further assistance or want to learn more about Magento development, feel free to explore our Magento Development Services at LaravelCompany.

Catalog Database Extensions Admin

Our network