Advertisement
Guest User

Untitled

a guest
Oct 21st, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.80 KB | None | 0 0
  1. $this->startSetup();
  2. $this->addAttribute('catalog_category', 'top_brand', array(
  3. 'group' => 'General',
  4. 'type' => 'int',//can be int, varchar, decimal, text, datetime
  5. 'backend' => '',
  6. 'frontend_input' => '',
  7. 'frontend' => '',
  8. 'label' => 'Top Hersteller',
  9. 'input' => 'select', //text, textarea, select, file, image, multilselect
  10. 'option' => array(
  11. 'value' => array(
  12.  
  13. 'optionone'=> array(
  14. 0 =>'No'),
  15. 'optiontwo'=> array(
  16. 0 =>'Yes')
  17. ),
  18.  
  19. ),
  20. 'default' => array(0),
  21. 'class' => '',
  22. // 'source' => '',//this is necessary for select and multilelect, for the rest leave it blank
  23. 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,//scope can be SCOPE_STORE or SCOPE_GLOBAL or SCOPE_WEBSITE
  24. 'visible' => true,
  25. 'frontend_class' => '',
  26. 'required' => false,//or true
  27. 'user_defined' => true,
  28. 'default' => '',
  29. 'position' => 100,//any number will do
  30. ));
  31. $this->endSetup();
  32.  
  33. $this->startSetup();
  34. $this->addAttribute('catalog_category', 'top_brand', array(
  35. 'group' => 'General',
  36. 'type' => 'int',//can be int, varchar, decimal, text, datetime
  37. 'backend' => '',
  38. 'frontend_input' => '',
  39. 'frontend' => '',
  40. 'label' => 'Top Hersteller',
  41. 'input' => 'select', //text, textarea, select, file, image, multilselect
  42. 'default' => array(0),
  43. 'class' => '',
  44. 'source' => 'eav/entity_attribute_source_boolean',//this is necessary for select and multilelect, for the rest leave it blank
  45. 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,//scope can be SCOPE_STORE or SCOPE_GLOBAL or SCOPE_WEBSITE
  46. 'visible' => true,
  47. 'frontend_class' => '',
  48. 'required' => false,//or true
  49. 'user_defined' => true,
  50. 'default' => '',
  51. 'position' => 100,//any number will do
  52. ));
  53. $this->endSetup();
  54.  
  55. $this->addAttribute( 'catalog_category', 'top_brand', array(
  56. 'group' => 'General',
  57. 'type' => 'tinyint',
  58. 'backend' => '',
  59. 'frontend' => '',
  60. 'label' => 'Top Hersteller',
  61. 'input' => 'boolean',
  62. 'source' => 'eav/entity_attribute_source_boolean',
  63. 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
  64. 'visible' => true,
  65. 'required' => false,
  66. 'user_defined' => true,
  67. 'default' => '',
  68. 'unique' => false,
  69. ) );
  70.  
  71. $this->endSetup();`
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement