This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# @author ryaan-anthony | |
# https://gist.github.com/ryaan-anthony/6290973 | |
# Usage: | |
# For 9 categories and 99.999 products, run the code: | |
# mysql > call build_catalog(10,100000); | |
delimiter ;; | |
drop procedure if exists build_catalog;; | |
create procedure build_catalog(IN categories INT, IN products INT) | |
begin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 class |