Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Scenario: I have created a new product type (configurable_b), that extends the configurable product type.

The issue is that when I edit the product in the backend I cannot see many attributes.

The reason are:

  • Many attribute are assigned specifically to configurable so I need to manually assign them to the configurable_b type.
  • Even if the attribute is assigned to all product types, I need to save the attribute to display in my new configurable_b

Any way to fix this programmatically ?

Cycle on every attribute:

  • assign it to configurable_b if they are assigned to configurable
  • fix the issue with the attribute assigned to all product type

I will accept also info that help me to create a script by myself, what I really miss is where the association to product type/attribute (apply_to) is stored in DB


share|improve this question
up vote 6 down vote accepted

I assume you created a module to support your new product type.
You should write an install/upgrade script for your module that changes the apply_to of the attributes you need to be available for your product type also.
Make an array with all the attributes you need and run this script:


/* @var $installer Mage_Eav_Model_Entity_Setup*/
$installer = $this;

$newType =  'configurable_b';

$attributes = Mage::getResourceModel('catalog/product_attribute_collection')

foreach ($attributes as $attribute) {
    $applyTo = explode(',', $installer->getAttribute('catalog_product', $attribute->getAttributeCode(), 'apply_to'));

    if ( in_array('configurable', $applyTo) && !in_array($newType, $applyTo)) {
        $applyTo[] = $newType;
        $installer->updateAttribute('catalog_product', $attribute->getAttributeCode(), 'apply_to', join(',', $applyTo));


The installer class need to be Mage_Eav_Model_Entity_Setup or a derivate

share|improve this answer
thanks, that is exactly what I need – Fra Aug 7 '14 at 7:54
@Fra. You may want to make the installer be an instance of Mage_Catalog_Model_Resource_Setup instead of Mage_Core_Model_Resource_Setup . The core one does not have the method updateAttribute. Or make it at least Mage_Eav_Model_Entity_Setup – Marius Aug 7 '14 at 8:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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