您还可以将额外的属性添加到作为显示或不显示标题(无论哪种方式最简单)的开关的类别中。 比调整模板代码,以便检查标题是否必须显示。
我用下面的代码添加额外的(文本域)在法师1.5.0属性类别:
/* ADD ATTRIBUTES TO MAGENTO BACKEND FOR CATEGORIES
* Adding the type
*/
INSERT INTO eav_attribute (entity_type_id, attribute_code, backend_type, frontend_input, frontend_label, default_value, source_model)
VALUES (9, 'category_from_data', 'text', 'textarea', 'From pricing text', '', '');
/*
* Source Q:
* INSERT INTO eav_entity_attribute (entity_type_id, attribute_set_id, attribute_group_id, attribute_id, sort_order) VALUES (3, 3, 3, <new attribute ID>, <next sort order>);
* Works but entity_type_id should be 9 for category
*/
INSERT INTO eav_entity_attribute (entity_type_id, attribute_set_id, attribute_group_id, attribute_id, sort_order) VALUES (9, 12, 7, 9, 25);
/*
* Adding the attribute itself
*/
INSERT INTO `catalog_eav_attribute` (`attribute_id`, `frontend_input_renderer`, `is_global`, `is_visible`, `is_searchable`, `is_filterable`, `is_comparable`, `is_visible_on_front`, `is_html_allowed_on_front`, `is_used_for_price_rules`, `is_filterable_in_search`, `used_in_product_listing`, `used_for_sort_by`, `is_configurable`, `apply_to`, `is_visible_in_advanced_search`, `position`, `is_wysiwyg_enabled`) VALUES
(977, NULL, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, '', 0, 0, 1);
你可能要检查数据库本身,并找出entity_type_id 9持有eav_entity_attribute什么eav_attribute中的insert id在第一次查询之后。
为了添加一个复选框属性,我建议你检查一下表格并钓鱼一个现有的属性,并相应地调整查询中的参数。
希望这有助于;)
抱歉,也许我不明白,也许我没能在这个问题清楚,但整个的一点是要有标题动态 – byronyasgur
那么即使我编辑更容易我的回答 –
非常感谢 - 看起来像它会工作 - 我关闭了这个项目几天,但将尝试后, – byronyasgur