Skip to content

Instantly share code, notes, and snippets.

View andyhausmann's full-sized avatar

Andy Hausmann andyhausmann

View GitHub Profile
<?php
$installer = Mage::getResourceModel('catalog/setup', 'catalog_setup');
if (!$installer->getAttributeId(Mage_Catalog_Model_Product::ENTITY, 'attribute_name')) {
$installer->addAttribute(Mage_Catalog_Model_Product::ENTITY, 'attribute_name', array( // TABLE.COLUMN: DESCRIPTION:
'label' => 'Label', // eav_attribute.frontend_label admin input label
'group' => 'General', // (not a column) tab in product edit screen
'sort_order' => 0, // eav_entity_attribute.sort_order sort order in group
'backend' => 'module/class_name', // eav_attribute.backend_model backend clas
@andyhausmann
andyhausmann / Magento Snippets
Last active October 9, 2015 05:48 — forked from davidalexander/gist:1086455
Magento Snippets
# Magento Snippets #
## Download extension manually using pear/mage ##
Pear for 1.4, mage for 1.5. File downloaded into /downloader/.cache/community/
./pear download magento-community/Shipping_Agent
./mage download community Shipping_Agent
## Clear cache/reindex ##