Skip to content

Instantly share code, notes, and snippets.

@ryaan-anthony
Created August 19, 2013 15:46
Show Gist options
  • Select an option

  • Save ryaan-anthony/6270609 to your computer and use it in GitHub Desktop.

Select an option

Save ryaan-anthony/6270609 to your computer and use it in GitHub Desktop.
<?php
class Ip_Viewas_Model_Resource_Setup extends Mage_Eav_Model_Entity_Setup
{
/**
* @return array
*/
public function getDefaultEntities()
{
return array(
'catalog_category' => array(
'entity_model' => 'catalog/category',
'attribute_model' => 'catalog/resource_eav_attribute',
'table' => 'catalog/category',
'additional_attribute_table' => 'catalog/eav_attribute',
'entity_attribute_collection' => 'catalog/category_attribute_collection',
'default_group' => 'General Information',
'attributes' => array(
'viewas_mode' => array(
'group' => 'General Information',
'input' => 'select',
'type' => 'varchar',
'source' => 'adminhtml/system_config_source_catalog_listMode',
'label' => 'List Mode',
'backend' => '',
'visible' => true,
'required' => false,
'visible_on_front' => true,
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
),
'display_qty' => array(
'group' => 'General Information',
'input' => 'select',
'type' => 'varchar',
'source' => 'adminhtml/system_config_source_yesno',
'label' => 'Display Qty in Catalog',
'backend' => '',
'visible' => true,
'required' => false,
'visible_on_front' => true,
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
)
)
)
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment