zoukankan      html  css  js  c++  java
  • How to change a product dropdown attribute to a multiselect in Magento

    First, update the attribute input type to multiselect:

    UPDATE eav_attribute SET
    entity_type_id = '4',
    attribute_model = NULL,
    backend_model = 'eav/entity_attribute_backend_array',
    backend_type = 'varchar',
    backend_table = NULL,
    frontend_model = NULL,
    frontend_input = 'multiselect',
    frontend_class = NULL
    WHERE attribute_id = 'YOUR_ATTRIBUTE_ID_HERE';

     Next, copy the attribute values from the old table to the new:

    INSERT INTO catalog_product_entity_varchar ( entity_type_id, attribute_id, store_id, entity_id, value)
    SELECT entity_type_id, attribute_id, store_id, entity_id, value
    FROM catalog_product_entity_int
    WHERE attribute_id = YOUR_ATTRIBUTE_ID_HERE;

    Finally,  remove the old values or they will conflict with the new setup (the old values will load, but Magento will save new values to the varchar table):

    DELETE FROM catalog_product_entity_int
    WHERE entity_type_id = 4 and attribute_id = YOUR_ATTRIBUTE_ID_HERE;
    作者:冯亮
             
    能力有限,水平一般。如有错误,欢迎指正
  • 相关阅读:
    _1_html_框架
    _0_web_基础
    _0_工具
    虚拟机安装与使用
    NumPy数据类型
    NumPy Ndarray对象
    机器学习之K-近邻(KNN)算法
    vue项目如何打包扔向服务器
    Eslint 规则说明
    Python ssh 远程执行shell命令
  • 原文地址:https://www.cnblogs.com/fengliang/p/3806674.html
Copyright © 2011-2022 走看看