I’m creating a new attribute via install, this is the code:
$installer = $this;
$installer->startSetup();
// Add new Attribute group
$groupName = 'Atributos';
$entityTypeId = $installer->getEntityTypeId('catalog_product');
$attributeSetId = $installer->getDefaultAttributeSetId($entityTypeId);
$installer->addAttributeGroup($entityTypeId, $attributeSetId, $groupName, 0);
$attributeGroupId = $installer->getAttributeGroupId($entityTypeId, $attributeSetId, $groupName);
$installer->addAttribute("catalog_product", "prd_alto", array(
'group' => 'Atributos',
'label' => 'Alto Producto',
'input' => 'text',
"type" => 'varchar',
'required' => false,
'visible' => true,
'visible_on_front' => true,
'filterable' => false,
'searchable' => false,
'comparable' => false,
'user_defined' => true,
'is_configurable' => false,
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
'note' => '',
));
$installer->endSetup();
As you can see, I’m first creating a new group and then asigning a new attribute to it, this works fine.
However, the attribute that is created has always the option “is_visible_on_front” deactivated.
I’ve tried with true and 1, neither of them worked.
I can’t see why I can’t set this attribute to be visible on front. Please help!!