Skip to content

Instantly share code, notes, and snippets.

@meminuygur
Created April 27, 2017 04:55
Show Gist options
  • Save meminuygur/13475ac96ef4a21dadffea7ea0f36b4d to your computer and use it in GitHub Desktop.
Save meminuygur/13475ac96ef4a21dadffea7ea0f36b4d to your computer and use it in GitHub Desktop.
custom attribute for category
<?php
require_once 'app/Mage.php';
Mage::app()->getCache()->getBackend()->clean('old');
Mage::app()->setCurrentStore(Mage::getModel('core/store')->load(Mage_Core_Model_App::ADMIN_STORE_ID));
$installer = new Mage_Sales_Model_Mysql4_Setup;
$attribute = array(
'type' => 'int',
'label'=> 'Show Breadcrumb Image',
'input' => 'select',
'source' => 'eav/entity_attribute_source_boolean',
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
'visible' => true,
'required' => false,
'user_defined' => true,
'default' => "",
'group' => "General Information"
);
$installer->addAttribute('catalog_category', 'show_category_breadcrumb', $attribute);
$installer->endSetup();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment