Skip to content

Instantly share code, notes, and snippets.

@alistairstead
Created August 12, 2010 15:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alistairstead/521155 to your computer and use it in GitHub Desktop.
Save alistairstead/521155 to your computer and use it in GitHub Desktop.
<?php
$installer = $this;
$installer->startSetup();
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
$entityTypeId = Mage::getModel('catalog/product')->getResource()->getTypeId();
$setup->addAttribute($orderEntityTypeId, 'remove_from_back_order', array(
'group' => 'Fulfillment API',
'label' => 'Remove from back order upon fullfiller API update',
'type' => 'int',
'input' => 'boolean',
'default' => '0',
'class' => '',
'backend' => '',
'frontend' => '',
'source' => '',
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
'visible' => true,
'required' => true,
'user_defined' => false,
'searchable' => false,
'filterable' => false,
'comparable' => false,
'visible_on_front' => false,
'visible_in_advanced_search' => false,
'unique' => false
));
$installer->endSetup();
// rebuild flat product catalog - to make new attributes visible in the system
Mage::getResourceModel('catalog/product_flat_indexer')->rebuild();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment