Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

how to change the price of all products at once


ramsharan

Recommended Posts

Posted

Is there any way of increasing or decreasing the price of every products,or products of certain category by ceratin percentage at once.If yes how?

 

thanks

Posted

Could you be any more specific than that? I didn't ask the question but it would be nice to know.

David Amherst

Posted

I've created this one just for you ramsharan.

-------------------------------------------------------------------------------------------------------------------------

UPDATE `products`

SET `products_price` = ROUND(`products_price` + ((`products_price` / 100) * percentage), 2);

-------------------------------------------------------------------------------------------------------------------------

 

Replace percentage with the desired percentage value. Then execute it against your database using phpMyAdmin.

 

Examples:

 

1. Business is booming! You want all your prices to increase by 10 percent.

----------------------------------------------------------------------------------------------------------------

UPDATE `products`

SET `products_price` = ROUND(`products_price` + ((`products_price` / 100) * 10), 2);

----------------------------------------------------------------------------------------------------------------

 

2. Hey, it's January sales! 25% off all products.

----------------------------------------------------------------------------------------------------------------

UPDATE `products`

SET `products_price` = ROUND(`products_price` + ((`products_price` / 100) * -25), 2);

----------------------------------------------------------------------------------------------------------------

 

Sorted! :thumbsup:

Posted

Ray gives good advice and good code...

 

Bobby

Posted

Thanks Bobby. I value your words as much as osCommerce team member's.

 

I'm honored. Cheers! :thumbsup:

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...