Skip to content

Instantly share code, notes, and snippets.

@bekapod
Created January 29, 2014 15:41
Show Gist options
  • Save bekapod/8690607 to your computer and use it in GitHub Desktop.
Save bekapod/8690607 to your computer and use it in GitHub Desktop.
MAGENTO: Category Attributes
$installer->addAttribute(Mage_Catalog_Model_Category::ENTITY, 'is_showcase', array(
'type' => 'text', // varchar
'backend' => '',
'frontend' => '',
'label' => "Showcase category?",
'input' => 'select', // image
'class' => '',
'source' => 'eav/entity_attribute_source_boolean',
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
'visible' => true,
'required' => true,
'user_defined' => true,
'default' => 0,
'searchable' => false,
'filterable' => false,
'comparable' => false,
'visible_on_front' => true,
'used_in_product_listing' => false,
'unique' => false,
'wysiwyg_enabled' => true,
'apply_to' => '',
'is_configurable' => true
));
$installer->addAttributeToSet(Mage_Catalog_Model_Category::ENTITY, '3', '4', 'is_showcase','98');
$installer->addAttributeToGroup(Mage_Catalog_Model_Category::ENTITY, '3', '4', 'is_showcase','98');
// REMOVE ATTRIBUTE
$installer->removeAttribute('catalog_category', 'is_showcase');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment