public function __construct($attrCode)
{
$attrData = array(
'group' => '',
--> 'type' => 'int',
'backend' => '',
'frontend' => '',
'label' => ucfirst($attrCode),
'input' => 'select',
'class' => '',
'source' => '',
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
'visible' => true,
'required' => false,
'user_defined' => true,
'default' => '0',
'searchable' => false,
'filterable' => false,
'comparable' => false,
'visible_on_front' => false,
'is_configurable' => true,
'unique' => false,
);
$installer = new Mage_Eav_Model_Entity_Setup('core_setup');
$installer->startSetup();
$installer->addAttribute(Mage_Catalog_Model_Product::ENTITY, $this->attrCode$attrCode, $attributeData);
$installer->updateAttribute(Mage_Catalog_Model_Product::ENTITY, $this->attrCode, 'backend_type','int'>addAttributeToDefaultSet();
$installer->endSetup();
}
Where in the indicated line 4
the attribute's backend_type
is set to int
. After this, the configurable product is now being correctly displayed in category and search :)