Jump to content

Query to set weight for ALL products PS1.7.*


Recommended Posts

Hi Y'all,

I'm looking for a query to update the shipping weight of all products currently in store to 150 grams.

I found a query with google but it date's back to 2013-2017

UPDATE ps_product SET weight=1 WHERE id_category_default=581

Does this still apply? or is it different in 1.7.*?

 

Thanks in advance

Cheers,

Falco

 

Share this post


Link to post
Share on other sites

Hi,

Yes, query is correct weight will be update in product table, it will work in PS 1.7.*.

If you have product combination then you need to update in product_attribute.

Take database backup before apply query, just to avoid loss of data :)

 

Share this post


Link to post
Share on other sites

 

On 2/25/2021 at 1:04 PM, GayatriY said:

Hi,

Yes, query is correct weight will be update in product table, it will work in PS 1.7.*.

If you have product combination then you need to update in product_attribute.

Take database backup before apply query, just to avoid loss of data :)

 

Thanks for your reply however I get the table ps_product does not exist.

I have a table called psxs_category_product however it does not seem to have a row called Weight.

 

Anyone got an idea what i'm doing wrong?

Share this post


Link to post
Share on other sites

You are looking in incorrect table, there is strucure in datatbase so each table start name have PREFIX_ default prefix is ps_ you have prefix psxs_ so in your case table name will be psxs_product.

Share this post


Link to post
Share on other sites
23 hours ago, KOC Admin said:

 

Thanks for your reply however I get the table ps_product does not exist.

I have a table called psxs_category_product however it does not seem to have a row called Weight.

 

Anyone got an idea what i'm doing wrong?

Check in your database with psxs_product.
I have ps_ prefix in database that's why I wrote ps_product. In your database you have psxs_ prefix.

In product table you will get the weight field.

Share this post


Link to post
Share on other sites
On 2/28/2021 at 11:59 AM, endriu107 said:

You are looking in incorrect table, there is strucure in datatbase so each table start name have PREFIX_ default prefix is ps_ you have prefix psxs_ so in your case table name will be psxs_product.

 

9 hours ago, GayatriY said:

Check in your database with psxs_product.
I have ps_ prefix in database that's why I wrote ps_product. In your database you have psxs_ prefix.

In product table you will get the weight field.

Thanks both, got the correct table, however the query said it would affect 0 rows.

I got it working by using the following instead. UPDATE psxs_product SET weight=0.15

So I left out WHERE id_category_default=581, all my products now have the correct weight!

 

thanks again!

Cheers

Falco

  • Like 1

Share this post


Link to post
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...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More