Modificacion de atributos

Oscar Pena

Nuevo usuario
Hola

Dimos de alta unos atributos nuevos en el catalogo de productos de magento en tipo "Dropdown" pero ahora necesito cambiarlos a "Multiple select", como puedo hacerlo?
 

visha Sanwar

Nuevo usuario
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;

Update on entity_type_id value referenced in the above example: The value for "entity_type_id" that you'll want to use may not always be "4" as referenced above. You'll want to check the table "eav_entity_type" and find the entry that has the "entity_type_code" set to "catalog_product". The "entity_type_id" for that record is the value you need to use. In most cases this value is either "4" or "10", but this may vary in future versions of Magento. Thanks to David Line for the heads up and providing these instructions.

Hope this will work for you.

Thanks
Vishal
 
Arriba