Add attributeSet but based on an existing set - Magento

Add attributeSet but based on an existing set - Magento

October 2, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Add attributeSet but based on an existing set - Magento

Creating a New Attribute Set Based on an Existing One in Magento

In Magento, attribute sets are used to group similar products together for easier management. While it’s straightforward to create a new set using the Mage_Eav_Model_Entity_Setup class, there may be times when you want to base your new set on an existing one.

Understanding Attribute Set Inheritance in Magento

Magento allows attribute sets to inherit from each other. This means that a new set can include all the attributes and settings of the parent set while adding additional features as needed. The admin interface provides this functionality, but you can also achieve it programmatically using the Mage_Eav_Model_Entity_Setup class.

Creating a New Attribute Set Based on an Existing One

To create a new attribute set based on an existing one, we’ll use the addAttributeSet method and specify the parent set’s ID. Here’s how you can do it:

$entitySetup = Mage::getModel('eav/entity_setup');

// Get the ID of the existing set you want to base your new set on
$parentSetId = 4; // Replace this with the actual ID

// Create a new set name
$newSetName = 'New Set Based on Existing';

// Add the new set based on the parent set
$entitySetup->addAttributeSet('catalog_product', $newSetId, $parentSetId);

In this example, replace 4 with the actual ID of the existing attribute set you want to use as a base. The $newSetName variable should contain the name for your new set.

What Happens When You Base an Attribute Set on Another

When you create a new attribute set based on another one:

  1. All attributes and settings from the parent set will be copied over to the new set.
  2. You can then modify or add additional attributes in the new set. These changes won’t affect the original set.
  3. The structure of the new set remains the same as the parent set.

Conclusion

Basing an attribute set on an existing one allows you to leverage the work already done on a set while creating a new one with unique features. This method is particularly useful when you want to create multiple sets that share many common attributes.

Remember, it’s essential to test your changes thoroughly in a development environment before deploying them to a live store. This approach can help you avoid potential conflicts and ensure the smooth functioning of your Magento site.

To learn more about customizing attribute sets in Magento, I recommend checking out our guide on working with product attributes on the Laravel Company blog. It provides a deeper dive into managing attributes and sets for improved product organization.

Happy coding!

Catalog Admin Configuration

Our network