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 = '',
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;
最新文章
- Linux下如何自己编译源代码(制作成可以安装的.deb文件)
- jquery checkbox的相关操作——全选、反选、获得所有选中的checkbox
- Github注册过程以及对管理软件的了解
- Atitit selenium3 新特性
- STRUTS2 常用标签的使用
- 【转】CSS3 transition规范的实际使用经验
- (转)可收缩、扩展的TextView
- Java Swing中Substance常用皮肤
- 关于C#中的DateTime类型的技巧
- CodeForces 158 B. Taxi(模拟)
- 论文阅读笔记五十:CornerNet: Detecting Objects as Paired Keypoints(ECCV2018)
- keepalived+双主实践HA
- 站在Web3.0 理解IPFS是什么
- u盘系统安装步骤
- Mac-让 Finder 显示隐藏文件和文件夹
- Personal Software Process (PSP)
- 【js】AddFavorite/SetHome提醒用户自行操作加入收藏/设置主页
- django之 文件上传功能(缺陷:无法改存放目录)
- Siki_Unity_4-4_丛林战争_Socket/TCP网络游戏开发
- Merge Two Sorted Lists leetcode java
热门文章
- openjpa框架入门_项目 database 启动project 初始化(三)
- cf466B Wonder Room
- Java的Git管理工具Gitblit
- U盘量产的作用
- MySQL之终端(Terminal)管理数据库、数据表、数据的基本操作(转)
- 基于Mesos运行Spark
- CXF interceptor拦截顺序
- JavaScript学习笔记——简单无缝循环滚动展示图片的实现
- UVA 1660 Cable TV Network
- JBOSS javax.naming.NameNotFoundException: xxx not bound