Updating weights on products in prestashop on mass
There are occasions where you might need to update a group of products weight. Recently I had a whole bunch of products that were in correctly set as 2KG when they should have been set to 0.2KG (200 grams). I started off manually changing them and then thought..no thanks this will take all day.
Luckily mySQL is your friend!
Using this query I was able to update all products weight within a certain category from 2KG to 0.2KG.
I knew the category I wanted to update was category 3 so I ran the following query:
This query updates the weight value to 0.2 on all products which belong to category 3 that has a existing weight of 2.
UPDATE ps_product SET weight = 0.2 WHERE weight = 2 and ps_product.id_product in (SELECT ps_category_product.id_product FROM ps_category_product WHERE id_category = 3 )