Monday 7 March 2016

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;

23 comments:

  1. Its really very article for my company developers..I would like to say thanks for sharing the best information..Keep Sharing.

    Website Design Agency Bangalore | SEO Bangalore

    ReplyDelete
  2. I would like to say thanks for sharing the great information..Its found the great information..Keep Sharing Am waiting for new posting..

    ReplyDelete
  3. appreciate and thank you for the post, it helped developers to change product dropdown attribute.
    https://www.facebook.com/AppJetty

    ReplyDelete
  4. As a blog reviewer I have to verify all contents both in Blog spots and WordPress Blogs for uniqueness and readers friendly .I found best content in this blog as well as your article is most useful to all regular visitors .I would suggest this blog for further promotion via google. Thank you for posting such a useful article.
    Restaurants in JLT | Indian Restaurants in JLT | Restaurants in Jumeirah
    Restaurants in Jumeirah Lake Towers | Indian Restaurants in Jumeirah

    ReplyDelete
  5. Appreciative post that every blogger should read and i need to know how you are optimizing your content. Kindly share your blogging strategy because i am very much inspired by your way of content representation .Thank you author.
    Regards
    JournalSpider | ClassifiedGenius
    Journal Spider | Classified Genius

    ReplyDelete
  6. I am a magento user and here I got great information about magento platform. Now I am working on Magento SMS API to send SMS directly from Magento.

    ReplyDelete
  7. Very nice chance and service.. Your post helps to increase my knowledge. keep posting posts like this...Very much informative.
    Magento Website Development Houston

    ReplyDelete
  8. It's clearly explained with the help of command on how to change a product dropdown attribute to a multiselect in Magento.The steps are given in clarity and easy to understand. I have read in some websites, they have given complicated command and very difficult to implement. But this blog is very effective in which detailed steps is given in an elloborative manner.
    Vitiligo Treatment

    ReplyDelete
  9. This comment has been removed by the author.

    ReplyDelete
  10. Nice information, and sql commend are simple easily understand them keep sharing a more information For More Details:Matrimony, Trichy

    Matrimony
    , Tamil Matrimony

    ReplyDelete
  11. I was wondering if you ever considered changing the structure of your site? Its very well written; I love what youve got to say. But maybe you could a little more in the way of content so people could connect with it better. Youve got an awful lot of text for only having 1 or two images. Maybe you could space it out better?suporte magento

    ReplyDelete
  12. I wanted to write a brief comment to be able to say thanks to you for all the lovely strategies you are showing here. My extensive internet search has finally been recognized with extremely good know-how to write about with my companions. I 'd repeat that most of us readers are extremely blessed to live in a very good site with so many special professionals with beneficial opinions. I feel extremely privileged to have come across your webpage and look forward to tons of more cool minutes reading here. Thanks once more for all the details.criação loja virtual

    ReplyDelete
  13. Really great post, Thank you for sharing This knowledge.Excellently written article, if only all bloggers offered the same level of content as you, the internet would be a much better place.

    loja magento

    ReplyDelete
  14. Does your site have a contact page? I'm having trouble locating it but, I'd like to send you an email. I've got some creative ideas for your blog you might be interested in hearing. Either way, great blog and I look forward to seeing it grow over time. criar loja virtual

    ReplyDelete
  15. This comment has been removed by the author.

    ReplyDelete
  16. Amazing tips! Thanks for sharing!!!

    ReplyDelete
  17. Thank you so much for taking effort to share such a useful information. I will definitely share this Magento Web Development Company

    ReplyDelete

Note: only a member of this blog may post a comment.