Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $installer = Mage::getResourceModel ( 'catalog/setup', 'catalog/setup' );
- $installer->startSetup ();
- // addAttribute uses _prepareValues()
- $data = array (
- 'attribute_set' => 'Default',
- 'sort_order' => 20,
- 'group' => 'Flipclock',
- 'label' => 'Flipclock Enable',
- 'note' => 'Flipclock Special Title',
- 'frontend_class' => ' required_entry input-text ',
- 'type' => 'int', // multiselect uses comma sep storage
- 'input' => 'select',
- 'backend' => '',
- 'frontend' => '',
- 'required' => 1,
- 'user_defined' => 1,
- 'unique' => 0, // eav_attribute.is_unique unique value required
- 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL, // catalog_eav_attribute.is_global (products only) scope
- 'visible' => 1, // catalog_eav_attribute.is_visible (products only) visible on admin, setting to false stops import of this attribute
- 'visible_on_front' => 0, // catalog_eav_attribute.is_visible_on_front (products only) visible on frontend (store) attribute table
- 'used_in_product_listing' => 0, // catalog_eav_attribute.used_in_product_listing (products only) made available in product listing
- 'searchable' => 0, // catalog_eav_attribute.is_searchable (products only) searchable via basic search
- 'visible_in_advanced_search' => 0, // catalog_eav_attribute.is_visible_in_advanced_search (products only) searchable via advanced search
- 'filterable' => 0, // catalog_eav_attribute.is_filterable (products only) use in layered nav
- 'filterable_in_search' => 0, // catalog_eav_attribute.is_filterable_in_search (products only) use in search results layered nav
- 'comparable' => 0, // catalog_eav_attribute.is_comparable (products only) comparable on frontend
- 'is_html_allowed_on_front' => 0, // catalog_eav_attribute.is_visible_on_front (products only) seems obvious, but also see visible
- 'apply_to' => 'simple,configurable', // catalog_eav_attribute.apply_to (products only) which product types to apply to
- 'is_configurable' => 0, // catalog_eav_attribute.is_configurable (products only) used for configurable products or not
- 'used_for_sort_by' => 0, // catalog_eav_attribute.used_for_sort_by (products only) available in the 'sort by' menu
- 'position' => 0, // catalog_eav_attribute.position (products only) position in layered naviagtion
- 'used_for_promo_rules' => 0,
- 'source' => 'eav/entity_attribute_source_boolean',
- );
- $installer->addAttribute ( 'catalog_product', 'flipclock_enable', $data );
- $data = array (
- 'attribute_set' => 'Default',
- 'sort_order' => 21,
- 'group' => 'Flipclock',
- 'label' => 'Flipclock Special Title',
- 'note' => 'Flipclock Special Title',
- 'frontend_class' => ' required_entry input-text ',
- 'type' => 'text', // multiselect uses comma sep storage
- 'input' => 'text',
- 'backend' => '',
- 'frontend' => '',
- 'required' => 1,
- 'user_defined' => 1,
- 'unique' => 0, // eav_attribute.is_unique unique value required
- 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL, // catalog_eav_attribute.is_global (products only) scope
- 'visible' => 1, // catalog_eav_attribute.is_visible (products only) visible on admin, setting to false stops import of this attribute
- 'visible_on_front' => 0, // catalog_eav_attribute.is_visible_on_front (products only) visible on frontend (store) attribute table
- 'used_in_product_listing' => 0, // catalog_eav_attribute.used_in_product_listing (products only) made available in product listing
- 'searchable' => 0, // catalog_eav_attribute.is_searchable (products only) searchable via basic search
- 'visible_in_advanced_search' => 0, // catalog_eav_attribute.is_visible_in_advanced_search (products only) searchable via advanced search
- 'filterable' => 0, // catalog_eav_attribute.is_filterable (products only) use in layered nav
- 'filterable_in_search' => 0, // catalog_eav_attribute.is_filterable_in_search (products only) use in search results layered nav
- 'comparable' => 0, // catalog_eav_attribute.is_comparable (products only) comparable on frontend
- 'is_html_allowed_on_front' => 0, // catalog_eav_attribute.is_visible_on_front (products only) seems obvious, but also see visible
- 'apply_to' => 'simple,configurable', // catalog_eav_attribute.apply_to (products only) which product types to apply to
- 'is_configurable' => 0, // catalog_eav_attribute.is_configurable (products only) used for configurable products or not
- 'used_for_sort_by' => 0, // catalog_eav_attribute.used_for_sort_by (products only) available in the 'sort by' menu
- 'position' => 0, // catalog_eav_attribute.position (products only) position in layered naviagtion
- 'used_for_promo_rules' => 0,
- );
- $installer->addAttribute ( 'catalog_product', 'flipclock_special_title', $data );
- $data = array (
- 'attribute_set' => 'Default',
- 'backend' => 'eav/entity_attribute_backend_datetime',
- 'sort_order' => 22,
- 'group' => 'Flipclock',
- 'label' => 'FlipClock Start Date and Time',
- 'note' => 'FlipClock Start Date and Time',
- 'frontend_class' => ' required_entry input-text validate-date validate-date-range date-range-flipclock_start_date-to',
- 'type' => 'datetime', // multiselect uses comma sep storage
- 'input' => 'datetime',
- 'backend' => '',
- 'frontend' => '',
- 'required' => 1,
- 'user_defined' => 1,
- 'unique' => 0, // eav_attribute.is_unique unique value required
- 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL, // catalog_eav_attribute.is_global (products only) scope
- 'visible' => 1, // catalog_eav_attribute.is_visible (products only) visible on admin, setting to false stops import of this attribute
- 'visible_on_front' => 0, // catalog_eav_attribute.is_visible_on_front (products only) visible on frontend (store) attribute table
- 'used_in_product_listing' => 0, // catalog_eav_attribute.used_in_product_listing (products only) made available in product listing
- 'searchable' => 0, // catalog_eav_attribute.is_searchable (products only) searchable via basic search
- 'visible_in_advanced_search' => 0, // catalog_eav_attribute.is_visible_in_advanced_search (products only) searchable via advanced search
- 'filterable' => 0, // catalog_eav_attribute.is_filterable (products only) use in layered nav
- 'filterable_in_search' => 0, // catalog_eav_attribute.is_filterable_in_search (products only) use in search results layered nav
- 'comparable' => 0, // catalog_eav_attribute.is_comparable (products only) comparable on frontend
- 'is_html_allowed_on_front' => 0, // catalog_eav_attribute.is_visible_on_front (products only) seems obvious, but also see visible
- 'apply_to' => 'simple,configurable', // catalog_eav_attribute.apply_to (products only) which product types to apply to
- 'is_configurable' => 0, // catalog_eav_attribute.is_configurable (products only) used for configurable products or not
- 'used_for_sort_by' => 0, // catalog_eav_attribute.used_for_sort_by (products only) available in the 'sort by' menu
- 'position' => 0, // catalog_eav_attribute.position (products only) position in layered naviagtion
- 'used_for_promo_rules' => 0,
- );
- $installer->addAttribute ( 'catalog_product', 'flipclock_start_date', $data );
- $data = array (
- 'attribute_set' => 'Default',
- 'backend' => 'eav/entity_attribute_backend_datetime',
- 'sort_order' => 23,
- 'group' => 'Flipclock',
- 'label' => 'FlipClock End Date and Time',
- 'note' => 'FlipClock End Date and Time',
- 'frontend_class' => ' required_entry input-text validate-date validate-date-range date-range-flipclock_end_date-to',
- 'type' => 'datetime', // multiselect uses comma sep storage
- 'input' => 'datetime',
- 'backend' => '',
- 'frontend' => '',
- 'required' => 1,
- 'user_defined' => 1,
- 'unique' => 0, // eav_attribute.is_unique unique value required
- 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL, // catalog_eav_attribute.is_global (products only) scope
- 'visible' => 1, // catalog_eav_attribute.is_visible (products only) visible on admin, setting to false stops import of this attribute
- 'visible_on_front' => 0, // catalog_eav_attribute.is_visible_on_front (products only) visible on frontend (store) attribute table
- 'used_in_product_listing' => 0, // catalog_eav_attribute.used_in_product_listing (products only) made available in product listing
- 'searchable' => 0, // catalog_eav_attribute.is_searchable (products only) searchable via basic search
- 'visible_in_advanced_search' => 0, // catalog_eav_attribute.is_visible_in_advanced_search (products only) searchable via advanced search
- 'filterable' => 0, // catalog_eav_attribute.is_filterable (products only) use in layered nav
- 'filterable_in_search' => 0, // catalog_eav_attribute.is_filterable_in_search (products only) use in search results layered nav
- 'comparable' => 0, // catalog_eav_attribute.is_comparable (products only) comparable on frontend
- 'is_html_allowed_on_front' => 0, // catalog_eav_attribute.is_visible_on_front (products only) seems obvious, but also see visible
- 'apply_to' => 'simple,configurable', // catalog_eav_attribute.apply_to (products only) which product types to apply to
- 'is_configurable' => 0, // catalog_eav_attribute.is_configurable (products only) used for configurable products or not
- 'used_for_sort_by' => 0, // catalog_eav_attribute.used_for_sort_by (products only) available in the 'sort by' menu
- 'position' => 0, // catalog_eav_attribute.position (products only) position in layered naviagtion
- 'used_for_promo_rules' => 0,
- );
- $installer->addAttribute ( 'catalog_product', 'flipclock_end_date', $data );
- // Done:
- $installer->endSetup ();
Add Comment
Please, Sign In to add comment