Magento 产品编辑界面的定制

1. 新增一个属性has_related_doc,显示在General组,如果不用API或者Magento后台管理界面可以直接插入SQL语句:
INSERT IGNORE INTO `eav_attribute` VALUES
(1000, 4, 'has_related_documents', NULL, NULL , 'int', NULL, NULL , 'select', 'Has Related Doc', '', 'eav/entity_attribute_source_boolean', 0, 0, 0, 0, '');
INSERT IGNORE INTO `catalog_eav_attribute` VALUES 
(1000, NULL , 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, '', 0, 0, 0, 0);
INSERT IGNORE INTO `eav_entity_attribute` VALUES (1000, 4, 4, 4, 1000, 0);

eav_attribute 插入属性的基本信息
catalog_eav_attribute 插入属性的扩展信息,如:是否可搜索,是否可比较等.
eav_entity_attribute 绑定属性与属性集、属性组和所属实体的关系。


2. 新增属性has_related_doc想放到一个新的组Related Doc里。
1). 新增一条记录到eav_attribute_group
insert `eav_attribute_group` (attribute_group_id, attribute_set_id,attribute_group_name,sort_order,default_id) values (100,4,'Related Doc','5',0);

2). 更新eav_entity_attribute
update eav_entity_attribute set attribute_group_id= 100 where attribute_id = 1000;

Magento 产品编辑界面的定制

你可能感兴趣的:(sql)