zoukankan      html  css  js  c++  java
  • Magento添加分类属性

    以该分类自定义热词举例
    第一步:添加属性标示(attribute_code)

    INSERT INTO `eav_attribute`  ( `entity_type_id` ,`attribute_code` ,`backend_type` ,`frontend_input` ,`frontend_label` ) VALUES ('3', 'hot_search_keyword', 'text', 'textarea', 'Hot Search Keyword');

    得到id:154(这是我自己数据库的值)
    第二步:添加对应关系,使其属于Category

    INSERT INTO `eav_entity_attribute` (`entity_type_id`,`attribute_set_id`,`attribute_group_id`,`attribute_id`,`sort_order`) VALUES('3','3','3','154','4');

    第三步:设置该属性参数

    INSERT INTO `catalog_eav_attribute`  (`attribute_id` ,`is_visible` ,`is_searchable` ,`is_used_for_price_rules` ,`is_configurable` , `position` ,`is_wysiwyg_enabled`) VALUES ('154','1', '1', '1', '1', '1', '1');

    数据调用方法:
    使用方法getData(‘attribute_code’) 获取数据 修改 catalog/category/view.phtml 添加以下代码进行测试

    <?php echo $_category->getData('short_description');  ?>
  • 相关阅读:
    MySQL改变表的存储引擎
    数字三角形合集
    POJ 3250 Bad Hair Day 单调栈
    Linux 网卡驱动学习(二)(网络驱动接口小结)
    Lecture Notes: Macros
    [转]LNMP环境下的Web常见问题排查(精品)
    ssh-copy-id password
    python
    python
    Ceph
  • 原文地址:https://www.cnblogs.com/liuxgnu/p/3535101.html
Copyright © 2011-2022 走看看