Magento 1.9 – Quickly Update Attribute Values for Products

databaseeavmagento-1.9MySQL

i would like to update attribute_value="integer" for all products where attribute_set_id = "x"

This might be a quick sql command, but i'm not actually able to figure out what tables need to be update.

Thanks

Edit:

This is a system attribute which is created by a plugin. (Not seen in magento admin) I am able to trace it in db in eav_attribute table. But unsure how to update its value with products and attribute_set

Best Answer

A quick solution:

  1. make attribute visible in backend:

    UPDATE catalog_eav_attribute cea
    INNER JOIN eav_attribute ea ON ea.attribute_id=cea.attribute_id
    SET cea.is_visible=1
    WHERE attribute_code="the_attribute_code"
    
  2. change the value in the backend, using grid filter and mass action in product grid (as suggested by Amasty)
  3. make attribute invisible again:

    UPDATE catalog_eav_attribute cea
    INNER JOIN eav_attribute ea ON ea.attribute_id=cea.attribute_id
    SET cea.is_visible=0
    WHERE attribute_code="the_attribute_code"
    
Related Topic