Friday 13 June 2014

Magento Install GeoIP Extesion

In following link you can get GeoIP Extesion.
This extension allows you to use free GeoIP Lite database by MaxMind with your Magento installation. 

http://www.magentocommerce.com/magento-connect/geoip.html

Magento Create Custom Attribute in Category

1) Yes / No Dropdown

<?php

$installer = $this;
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
$installer->startSetup();
$setup->addAttribute('catalog_category', 'is_catalog', array(
   'type' => 'int',
    'group' => 'General',
    'backend' => '',
    'frontend' => '',
    'label' => 'Is Catalog ',
    'input' => 'select',
    'class' => '',
    'source' => 'eav/entity_attribute_source_boolean',            // Leave blank for input type text box
    'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
    'visible' => true,
    'required' => false,
    'user_defined' => false,
    'default' => '0',  //Leave blank for input type text box
    'searchable' => false,
    'filterable' => false,
    'comparable' => false,
    'visible_on_front' => false,
    'unique' => false
));
$installer->endSetup();

2) Textbox

$installer = $this;
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
$installer->startSetup();
$setup->addAttribute('catalog_category', 'my_attribute', array(
'group' => 'General',
'input' => 'text',
'type' => 'varchar',
'label' => 'My Attribute',
'backend' => '',
'visible' => 1,
'required' => 0,
'user_defined' => 1,
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
));
$installer->endSetup();