Skip to content

Instantly share code, notes, and snippets.

View xyn22's full-sized avatar
🏠
Working from home

AbdelRahman xyn22

🏠
Working from home
View GitHub Profile
@xyn22
xyn22 / install-1.0.0.0.php
Created July 23, 2015 22:42
Magento - add an attribute option in setup script
<?php
$installer = $this;
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
$attr_model = Mage::getModel('catalog/resource_eav_attribute');
$attr = $attr_model->loadByCode('customer', $attribute_name);
$attr_id = $attr->getAttributeId();