Skip to content

Instantly share code, notes, and snippets.

@eniuz
Created March 15, 2016 13:35
Show Gist options
  • Save eniuz/c99227fcfec15ffbe64d to your computer and use it in GitHub Desktop.
Save eniuz/c99227fcfec15ffbe64d to your computer and use it in GitHub Desktop.
Create Category Attribute
<?php
$attributeUtility = Mage::getModel('core/setup');
$attributeUtility->addAttribute('catalog_category', 'attribute_code',
array(
'sort_order' => '0',
'backend_type' => 'int',
'input' => "boolean",
'label' => 'Custom Attribute Label',
'source_model' => 'eav/entity_attribute_source_boolean',
'required' => '0',
'user_defined' => false,
'default_value' => '0',
'unique' => '0',
'note' => '',
'global' => '1',
'visible' => '1',
'searchable' => '0',
'filterable' => '0',
'comparable' => '0',
'visible_on_front' => '0',
'html_allowed_on_front' => '1',
'used_for_price_rules' => '0',
'filterable_in_search' => '0',
'used_in_product_listing' => '0',
'used_for_sort_by' => '0',
'configurable' => '0',
'apply_to' => 'configurable',
'visible_in_advanced_search' => '0',
'position' => '0',
'wysiwyg_enabled' => '0',
'used_for_promo_rules' => true,
'search_weight' => '1',
)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment