I'm drawing a draft for a script to update several products at once using mysql. I've got my own table myinventory which has two columns: sku and qty

UPDATE cataloginventory_stock_item 
INNER JOIN catalog_product_entity
ON cataloginventory_stock_item.product_id = catalog_product_entity.entity_id
SET cataloginventory_stock_item.qty = myinventory.qty, cataloginventory_stock_item.is_in_stock = 1
WHERE myinventory.sku = catalog_product_entity.sku;

I'm struggling to get it work, I'm sure there's something wrong in this query

I'm also thinking how about set to 0 all items not listed in myinventory

  • which issue you are facing into this one? – Dhiren Vasoya Jun 17 at 13:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.