I have over 400 products in my store. All have a weight of 0.375 for the product weight. I would like all products to have a 0.02 weight. Can I do this in bulk? Maybe PHP? If someone knows how to do this it would save me lots of time.
I have over 400 products in my store. All have a weight of 0.375 for the product weight. I would like all products to have a 0.02 weight. Can I do this in bulk? Maybe PHP? If someone knows how to do this it would save me lots of time.
I think the field is product_weight in the products table, so the below should do what is desired if placed in the install sql patches window of the admin.
Or just leave off the where section at the end if you are sure everything is to be set to 0.02.Code:update products set product_weight=.02 where product_weight=.375
ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...
BACKUP, BACKUP, BACKUP![]()
A little help with colors.
myZenCartHost.com - Zen Cart Certified, PCI Compatible Hosting by JEANDRET
Free SSL & Domain with semi-annual and longer hosting. Updating 1.5.2 and Up.
The actual weight is set at: 0.0375 and I want to change all to zero.
I tried both of these:
Reason: When I looked in my database (php MyAdmin) the product weight was called: products_weight. Niether one above worked, I got a failed message error in my SQL Query Executor window.Code:update products set product_weight=.00 where product_weight=.0375 update products set products_weight=.00 where products_weight=.0375
When you looked at the database, did each table have a prefix? Was products something like zen_products?
A little help with colors.
myZenCartHost.com - Zen Cart Certified, PCI Compatible Hosting by JEANDRET
Free SSL & Domain with semi-annual and longer hosting. Updating 1.5.2 and Up.
As dbltoe is hinting at, try the revised sql that has the field products_weight (extra s that I missed) and use it from the ZC admin install sql patch window as I first suggested. This will eliminate the discussion and search for the infamous DB_PREFIX. At least for now.
Remember zc addresses the database prefix whereas phpmyadmin doesn't know a thing about it and must be manually added.
ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
No, it's neither the spaces nor the semicolon, although those make for better syntax.
The field is a data-type of "float", and a direct "equals" comparison doesn't always work as an exact match, hence the suggestion of giving it a range of "greater than or equal to 0.0375 AND less than or equal to 0.0376".
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.