Nov 15, 2011

Magento: Custom category Field.

Add one row to eav_attribute


INSERT INTO `fl_mage`.`eav_attribute`
SET
`attribute_id` =0, -- AUto
`entity_type_id`=3,
`attribute_code`='category_url',
`attribute_model`=NULL ,
`backend_model`=NULL ,
`backend_type`='varchar',
`backend_table`=NULL ,
`frontend_model` =NULL,
`frontend_input` ='text',
`frontend_label`='Url' ,
`frontend_class`=NULL ,
`source_model`=NULL ,
`is_required` '0',
`is_user_defined`='0' ,
`default_value` =NULL,
`is_unique` ='0',
`note`=''
;

Add other one row to eav_entity_attribute


INSERT INTO `fl_mage`.`eav_entity_attribute`
SET
`entity_attribute_id` =NULL,
`entity_type_id` =3,
`attribute_set_id` =3,
`attribute_group_id` =3,
`attribute_id`=163, --Must be same to eav_attribute
`sort_order`=3
;

Finally one more row to catalog_eav_attribute


INSERT INTO `catalog_eav_attribute`
SET
`attribute_id`=163,
`frontend_input_renderer`=NULL,
`is_global`=0,
`is_visible`=1,
`is_searchable`=0,
`is_filterable`=0,
`is_comparable`=0,
`is_visible_on_front`=0,
`is_html_allowed_on_front`=0,
`is_used_for_price_rules`=0,
`is_filterable_in_search`=0,
`used_in_product_listing`=0,
`used_for_sort_by`=0,
`is_configurable`=1,
`apply_to`=0,
`is_visible_in_advanced_search`=0,
`position`=0,
`is_wysiwyg_enabled`=0,
`is_used_for_promo_rules`=0
;

That's simple as is, you can find the charm there. Happy reading.

TIPS: If you are confuse try to look the eav_attribute and compare the data on your admin category page.

Reference:

No comments: