Jump to content

[SOLVED] Query to add product weight to all items (Prestashop 1.6)


Recommended Posts

I need to add weight to all products in my prestashop 1.6.1.10. I have updated the product table (in my case ps16_product) but it seems it doesn't work. Here goes the query:

update ps16_product set weight='0.3' where id_category_default=152;

 

When I go to the prestashop backoffice I can see the it doesn't effect the product weight. It is still empty. Most likely this column - weight in ps16_product table is left for back compatibility with the older versions of presta.

I have tested adding product weight through the backend and I found in the database dump that the weight is stored in ps16_feature_value_lang. Something like this:

| id_feature_value | id_lang | value |
| 36 | 1 | 0.4359876 |

 

Any idea what query i have to use to add/update product weight?

Edited by Pavel Siderov (see edit history)
Link to comment
Share on other sites

Your query is fine, you're just mixing two things. The weight in product table is there for delivery purposes, it's used when calculating delivery cost based on weight and is not visible to customers. It's in product's shipping tab.

 

It seems that you have another weight set up as a feature, and you want to update that feature. You can do it by exporting your products to a CSV file, and then importing back with that feature set to your specific value.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...