Updating the Weight of All Products in Your Zen Cart Store Through a SQL Command
Wednesday, October 29th, 2008Sometimes, you may need to update certain aspects of all products in your catalog. Instead of manually changing the aspect (in this case weight) of each product, you can run a simple SQL command through your Admin –> Install SQL Patches.
Here’s how to update the weight of ALL products in your catalog to 1/2 lb:
1. First, ALWAYS do a data base backup. If you have the Database Backup from Admin mod installed go to Tools -> Database Back Up MySQL and back up your database.
2. Go to Tools -> Install SQL Patches and run the following code:
UPDATE products SET products_weight = 0.5;
All products now have the weight of 1/2 lb. If you want the weight to be different, just change the 0.5 to whatever weight you want. The number should be in pounds.
If you have items in your catalog that are down loadable products, they must have a weight of 0. The most common instance of down loadable products is Gift Certificates. To update the weight of all products EXCEPT your gift certificates, enter the following command in step 2:
UPDATE products SET products_weight = 0.5 WHERE master_categories_id != 26;
This will update ALL products weight EXCEPT those in category 26 (gift certificate category). Change the master_categories_id to your actual number.







