More

    Adding Customer Attributes to Magento Product Session by Install Script


    My Script like this :
    <?php
    /* @var $installer Mage_Core_Model_Resource_Setup */
    $installer = $this;
    $connection = $installer->getConnection();
    $setup = new Mage_Eav_Model_Entity_Setup(‘core_setup’);
    $installer->startSetup();
    $entityTypeId = $setup->getEntityTypeId(‘catalog_product’);
    $attributeSetId = $setup->getDefaultAttributeSetId($entityTypeId);
    $attributeGroupId = $setup->getDefaultAttributeGroupId($entityTypeId, $attributeSetId);
    $setup->addAttribute(‘catalog_product’, ‘shippingprice’, array(
    ‘group’ => ‘Prices’,
    ‘type’ => ‘text’,
    ‘input’ => ‘price’,
    ‘label’ => ‘Shipping Price’,
    ‘visible’ => 1,
    ‘required’ => 1,
    ‘default’ => 0,
    ‘sort_order’=> 1
    ));
    $installer->endSetup();

    Recent Articles

    spot_img

    Related Stories

    Stay on op - Ge the daily news in your inbox