Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mass update simple product "status" via MySQL query

I just imported over 12k products to my Magento catalog.

Problem is, the products came with the "Status" field undefined, and I need to seem them to "Enabled" manually if I want to use them in the front-end store. Doing this manually would take hours.

Do you know where this setting is defined in the database? Do you know of a query that would this automatically (I want to set ALL products to "Enabled").

like image 546
pedropeixoto Avatar asked Aug 25 '11 12:08

pedropeixoto


1 Answers

# First find the ID of the product status attribute in the EAV table:
SELECT * FROM eav_attribute where entity_type_id = 4 AND attribute_code = 'status'

# Then use that status attribute ID ($id) while querying the product entity table:
UPDATE catalog_product_entity_int SET value = 1 WHERE attribute_id = $id
  • 1 - enabled
  • 2 - disabled
like image 79
wormhit Avatar answered Oct 06 '22 20:10

wormhit