Your shopping cart is empty. Browse our Store

Magento

Open Source eCommerce Evolved

Adding a new attribute

Last modified by Bojan Hrnkas on Fri, May 9, 2008 11:36
Source|Old Revisions  

In order to add a new attribute to your magento installation, you can use following method:

Create an instance of Mage_Eav_Model_Entity_Setup class and use its method addAttribute() to add one.

$setup = new Mage_Eav_Model_Entity_Setup(’core_setup’); $setup->addAttribute($entityTypeId, $code, $attr);

$attr is an array containing Attribute elements (like frontend and backend model, default value, etc.)

For details look at the sourcecode:

app/code/core/Mage/Eav/Model/Entity/Setup.php




 

Popular Wiki Tags  |  View all

Professional Services from the Magento Team

Professional Installation from the Magento Team

Magento Job Board - Some sort of tag line goes here

Latest Posts| View all Jobs
© Copyright 2008 Varien. Magento is a trademark of Irubin Consulting Inc. DBA Varien