vijayrami

Magento install script

Feb 20th, 2018
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 9.43 KB | None | 0 0
  1. <?php
  2.  
  3. $installer = Mage::getResourceModel ( 'catalog/setup', 'catalog/setup' );
  4. $installer->startSetup ();
  5. // addAttribute uses _prepareValues()
  6. $data = array (
  7.         'attribute_set' => 'Default',
  8.         'sort_order' => 20,
  9.         'group' => 'Flipclock',
  10.         'label' => 'Flipclock Enable',
  11.         'note'  => 'Flipclock Special Title',
  12.         'frontend_class' => ' required_entry input-text ',
  13.         'type' => 'int', // multiselect uses comma sep storage
  14.         'input' => 'select',
  15.         'backend' => '',
  16.         'frontend' => '',
  17.         'required' => 1,
  18.         'user_defined' => 1,
  19.         'unique' => 0, // eav_attribute.is_unique unique value required
  20.         'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL, // catalog_eav_attribute.is_global (products only) scope
  21.         'visible' => 1, // catalog_eav_attribute.is_visible (products only) visible on admin, setting to false stops import of this attribute
  22.         'visible_on_front' => 0, // catalog_eav_attribute.is_visible_on_front (products only) visible on frontend (store) attribute table
  23.         'used_in_product_listing' => 0, // catalog_eav_attribute.used_in_product_listing (products only) made available in product listing
  24.         'searchable' => 0, // catalog_eav_attribute.is_searchable (products only) searchable via basic search
  25.         'visible_in_advanced_search' => 0, // catalog_eav_attribute.is_visible_in_advanced_search (products only) searchable via advanced search
  26.         'filterable' => 0, // catalog_eav_attribute.is_filterable (products only) use in layered nav
  27.         'filterable_in_search' => 0, // catalog_eav_attribute.is_filterable_in_search (products only) use in search results layered nav
  28.         'comparable' => 0, // catalog_eav_attribute.is_comparable (products only) comparable on frontend
  29.         'is_html_allowed_on_front' => 0, // catalog_eav_attribute.is_visible_on_front (products only) seems obvious, but also see visible
  30.         'apply_to' => 'simple,configurable', // catalog_eav_attribute.apply_to (products only) which product types to apply to
  31.         'is_configurable' => 0, // catalog_eav_attribute.is_configurable (products only) used for configurable products or not
  32.         'used_for_sort_by' => 0, // catalog_eav_attribute.used_for_sort_by (products only) available in the 'sort by' menu
  33.         'position' => 0, // catalog_eav_attribute.position (products only) position in layered naviagtion
  34.         'used_for_promo_rules' => 0,
  35.         'source' => 'eav/entity_attribute_source_boolean',
  36. );
  37. $installer->addAttribute ( 'catalog_product', 'flipclock_enable', $data );
  38.  
  39. $data = array (
  40.         'attribute_set' => 'Default',
  41.         'sort_order' => 21,
  42.         'group' => 'Flipclock',
  43.         'label' => 'Flipclock Special Title',
  44.         'note'  => 'Flipclock Special Title',
  45.         'frontend_class' => ' required_entry input-text ',
  46.         'type' => 'text', // multiselect uses comma sep storage
  47.         'input' => 'text',
  48.         'backend' => '',
  49.         'frontend' => '',
  50.         'required' => 1,
  51.         'user_defined' => 1,
  52.         'unique' => 0, // eav_attribute.is_unique unique value required
  53.         'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL, // catalog_eav_attribute.is_global (products only) scope
  54.         'visible' => 1, // catalog_eav_attribute.is_visible (products only) visible on admin, setting to false stops import of this attribute
  55.         'visible_on_front' => 0, // catalog_eav_attribute.is_visible_on_front (products only) visible on frontend (store) attribute table
  56.         'used_in_product_listing' => 0, // catalog_eav_attribute.used_in_product_listing (products only) made available in product listing
  57.         'searchable' => 0, // catalog_eav_attribute.is_searchable (products only) searchable via basic search
  58.         'visible_in_advanced_search' => 0, // catalog_eav_attribute.is_visible_in_advanced_search (products only) searchable via advanced search
  59.         'filterable' => 0, // catalog_eav_attribute.is_filterable (products only) use in layered nav
  60.         'filterable_in_search' => 0, // catalog_eav_attribute.is_filterable_in_search (products only) use in search results layered nav
  61.         'comparable' => 0, // catalog_eav_attribute.is_comparable (products only) comparable on frontend
  62.         'is_html_allowed_on_front' => 0, // catalog_eav_attribute.is_visible_on_front (products only) seems obvious, but also see visible
  63.         'apply_to' => 'simple,configurable', // catalog_eav_attribute.apply_to (products only) which product types to apply to
  64.         'is_configurable' => 0, // catalog_eav_attribute.is_configurable (products only) used for configurable products or not
  65.         'used_for_sort_by' => 0, // catalog_eav_attribute.used_for_sort_by (products only) available in the 'sort by' menu
  66.         'position' => 0, // catalog_eav_attribute.position (products only) position in layered naviagtion
  67.         'used_for_promo_rules' => 0,
  68. );
  69. $installer->addAttribute ( 'catalog_product', 'flipclock_special_title', $data );
  70.  
  71. $data = array (
  72.         'attribute_set' => 'Default',
  73.         'backend' => 'eav/entity_attribute_backend_datetime',
  74.         'sort_order' => 22,
  75.         'group' => 'Flipclock',
  76.         'label' => 'FlipClock Start Date and Time',
  77.         'note'  => 'FlipClock Start Date and Time',
  78.         'frontend_class' => ' required_entry input-text validate-date validate-date-range date-range-flipclock_start_date-to',
  79.         'type' => 'datetime', // multiselect uses comma sep storage
  80.         'input' => 'datetime',
  81.         'backend' => '',
  82.         'frontend' => '',
  83.         'required' => 1,
  84.         'user_defined' => 1,
  85.         'unique' => 0, // eav_attribute.is_unique unique value required
  86.         'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL, // catalog_eav_attribute.is_global (products only) scope
  87.         'visible' => 1, // catalog_eav_attribute.is_visible (products only) visible on admin, setting to false stops import of this attribute
  88.         'visible_on_front' => 0, // catalog_eav_attribute.is_visible_on_front (products only) visible on frontend (store) attribute table
  89.         'used_in_product_listing' => 0, // catalog_eav_attribute.used_in_product_listing (products only) made available in product listing
  90.         'searchable' => 0, // catalog_eav_attribute.is_searchable (products only) searchable via basic search
  91.         'visible_in_advanced_search' => 0, // catalog_eav_attribute.is_visible_in_advanced_search (products only) searchable via advanced search
  92.         'filterable' => 0, // catalog_eav_attribute.is_filterable (products only) use in layered nav
  93.         'filterable_in_search' => 0, // catalog_eav_attribute.is_filterable_in_search (products only) use in search results layered nav
  94.         'comparable' => 0, // catalog_eav_attribute.is_comparable (products only) comparable on frontend
  95.         'is_html_allowed_on_front' => 0, // catalog_eav_attribute.is_visible_on_front (products only) seems obvious, but also see visible
  96.         'apply_to' => 'simple,configurable', // catalog_eav_attribute.apply_to (products only) which product types to apply to
  97.         'is_configurable' => 0, // catalog_eav_attribute.is_configurable (products only) used for configurable products or not
  98.         'used_for_sort_by' => 0, // catalog_eav_attribute.used_for_sort_by (products only) available in the 'sort by' menu
  99.         'position' => 0, // catalog_eav_attribute.position (products only) position in layered naviagtion
  100.         'used_for_promo_rules' => 0,
  101. );
  102. $installer->addAttribute ( 'catalog_product', 'flipclock_start_date', $data );
  103.  
  104. $data = array (
  105.         'attribute_set' => 'Default',
  106.         'backend' => 'eav/entity_attribute_backend_datetime',
  107.         'sort_order' => 23,
  108.         'group' => 'Flipclock',
  109.         'label' => 'FlipClock End Date and Time',
  110.         'note'  => 'FlipClock End Date and Time',
  111.         'frontend_class' => ' required_entry input-text validate-date validate-date-range date-range-flipclock_end_date-to',
  112.         'type' => 'datetime', // multiselect uses comma sep storage
  113.         'input' => 'datetime',
  114.         'backend' => '',
  115.         'frontend' => '',
  116.         'required' => 1,
  117.         'user_defined' => 1,
  118.         'unique' => 0, // eav_attribute.is_unique unique value required
  119.         'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL, // catalog_eav_attribute.is_global (products only) scope
  120.         'visible' => 1, // catalog_eav_attribute.is_visible (products only) visible on admin, setting to false stops import of this attribute
  121.         'visible_on_front' => 0, // catalog_eav_attribute.is_visible_on_front (products only) visible on frontend (store) attribute table
  122.         'used_in_product_listing' => 0, // catalog_eav_attribute.used_in_product_listing (products only) made available in product listing
  123.         'searchable' => 0, // catalog_eav_attribute.is_searchable (products only) searchable via basic search
  124.         'visible_in_advanced_search' => 0, // catalog_eav_attribute.is_visible_in_advanced_search (products only) searchable via advanced search
  125.         'filterable' => 0, // catalog_eav_attribute.is_filterable (products only) use in layered nav
  126.         'filterable_in_search' => 0, // catalog_eav_attribute.is_filterable_in_search (products only) use in search results layered nav
  127.         'comparable' => 0, // catalog_eav_attribute.is_comparable (products only) comparable on frontend
  128.         'is_html_allowed_on_front' => 0, // catalog_eav_attribute.is_visible_on_front (products only) seems obvious, but also see visible
  129.         'apply_to' => 'simple,configurable', // catalog_eav_attribute.apply_to (products only) which product types to apply to
  130.         'is_configurable' => 0, // catalog_eav_attribute.is_configurable (products only) used for configurable products or not
  131.         'used_for_sort_by' => 0, // catalog_eav_attribute.used_for_sort_by (products only) available in the 'sort by' menu
  132.         'position' => 0, // catalog_eav_attribute.position (products only) position in layered naviagtion
  133.         'used_for_promo_rules' => 0,
  134. );
  135. $installer->addAttribute ( 'catalog_product', 'flipclock_end_date', $data );
  136. // Done:
  137. $installer->endSetup ();
Add Comment
Please, Sign In to add comment