Jump to content


Corporate Sponsors


Latest News: (loading..)

- - - - -

Want to change the Price off all Products all at once?


8 replies to this topic

#1 jamesey

  • Community Member
  • 70 posts
  • Real Name:james

Posted 26 February 2010, 20:13

Hi,

I love osCommerce, but an annoying thing about it, is that you can't seem to bulk edit products, like select all the products you have and edit the product description or the product price in one go, rather then having to edit each product individually.

I did hear ages ago on here that a way to get round this is editing products via phpMyAdmin. Apparently it is possible to bulk edit using this. I have absolutely no idea how to do this with phpMyAdmin, but if anyone knows and could explain, that would be really good.

#2 mdtaylorlrim

  • Community Member
  • 2,497 posts
  • Real Name:Mark
  • Gender:Male

Posted 26 February 2010, 21:20

update products set products_price = 'whatever you want here';


'whatever you want here' can even be a calculation.

Have you considered the add on Product Quick Edit? It still does them one at a time but much faster.
Avoid the most asked question. See How to Secure My Site and How do I...?

#3 Hotclutch

  • Community Member
  • 1,243 posts
  • Real Name:Ashley
  • Gender:Male
  • Location:Cape Town, SA

Posted 26 February 2010, 21:46

View Postjamesey, on 26 February 2010, 20:13, said:

Hi,

I love osCommerce, but an annoying thing about it, is that you can't seem to bulk edit products, like select all the products you have and edit the product description or the product price in one go, rather then having to edit each product individually.

I did hear ages ago on here that a way to get round this is editing products via phpMyAdmin. Apparently it is possible to bulk edit using this. I have absolutely no idea how to do this with phpMyAdmin, but if anyone knows and could explain, that would be really good.

Most people use EasyPopulate for this
http://addons.oscommerce.com/info/500

#4 jamesey

  • Community Member
  • 70 posts
  • Real Name:james

Posted 06 March 2010, 17:07

thanks for the replies guys.

mdtaylorlrim or anyone else - can you be a bit more specific about that code line you posted on the previous message? I'm not used to using phpMyAdmin so I don't really know what I'm doing.

This is what i've done so far.. (i'm guessing)...

Logged onto phpMyAdmin
Selected the Database in the top left corner
Clicked on "products" down the left side

Now i am stuck on what to do, and how to enter that code you posted to edit the prices for every item.

Also, if i wanted to change the product description for every item, what code/text would i use to do this?

#5 mdtaylorlrim

  • Community Member
  • 2,497 posts
  • Real Name:Mark
  • Gender:Male

Posted 06 March 2010, 23:53

View Postjamesey, on 06 March 2010, 17:07, said:

thanks for the replies guys.

mdtaylorlrim or anyone else - can you be a bit more specific about that code line you posted on the previous message? I'm not used to using phpMyAdmin so I don't really know what I'm doing.

This is what i've done so far.. (i'm guessing)...

Logged onto phpMyAdmin
Selected the Database in the top left corner
Clicked on "products" down the left side

Now i am stuck on what to do, and how to enter that code you posted to edit the prices for every item.

Also, if i wanted to change the product description for every item, what code/text would i use to do this?
First thing is, you don't want to start learning this on your live shop database. Duplicate the database and use it as a test db.
And what is your real objective? Maybe using a sql statement is not the best way to do what you want, but I don't really know what you want. With certainty.

Across the top right there are more tabs. Browse, Structure, sql,import, export, operations....and some others...

To run a sql statement on the table selected click the sql tab. It will bring up a text box to enter the sql. And keep in mind that this is a permanent and immediate change in the database that you cannot undo. So, it should only be reserved for the rare instance when no other way will do.

To change all the prices to $100.00 for example,

update products set products_price = '100'

Press the go button and now all your products cost $100

To increase all prices by 5% use this..

update products set products_price = (products_price * 1.05)

I think.... see, that's the reason for a test database.

The products descriptions are in the products_description table. The code would be very similar. Again, one little slip and you could render your store out of commission for quite a while. Still want to mess with phpMyAdmin?
Avoid the most asked question. See How to Secure My Site and How do I...?

#6 mdtaylorlrim

  • Community Member
  • 2,497 posts
  • Real Name:Mark
  • Gender:Male

Posted 07 March 2010, 00:23

View Postmdtaylorlrim, on 06 March 2010, 23:53, said:


To increase all prices by 5% use this..

update products set products_price = (products_price * 1.05)

I think.... see, that's the reason for a test database.

The products descriptions are in the products_description table. The code would be very similar. Again, one little slip and you could render your store out of commission for quite a while. Still want to mess with phpMyAdmin?
But see..there are a couple of contributions that will do some of these things.
Avoid the most asked question. See How to Secure My Site and How do I...?

#7 DunWeb

  • Community Sponsor
  • 10,461 posts
  • Real Name:Chris Dunn
  • Gender:Male
  • Location:Tecumseh, Ontario, Canada N8N 1X8

Posted 07 March 2010, 01:03

James,


Try this:

http://addons.oscommerce.com/info/122



Chris
:|: Was this post helpful ? Click the LIKE THIS button :|:

:|: Click Here to learn how I can help you with custom coding, add ons, security and templates :|:

:|: Need an Area Calculator, Pre-Paid Account, Virtual Pin, Auction or Layaway Add on ? Click Here :|:

#8 jamesey

  • Community Member
  • 70 posts
  • Real Name:james

Posted 07 March 2010, 20:48

thanks mdtaylorlrim

you've made it very clear, exactly how i wanted... so i will try this on a test database to see if it works.

i'll have a look at the quick prices contrib too

#9 kymation

  • Community Sponsor
  • 5,662 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 07 March 2010, 21:41

View Postmdtaylorlrim, on 06 March 2010, 23:53, said:

To increase all prices by 5% use this..

update products set products_price = (products_price * 1.05)
<snipped>
Or you could just use the Price Updater addon. It's designed to do that and more, without learning SQL. Not that learning to write SQL is a bad idea.

Regards
Jim
My Addons

Banners Box 2.3.1 Support
Categories Accordion Box 2.3.1 Support
Categories Images Box 2.2x 2.3.1 Support
Closest Shipper 2.2x Support
Document Manager 2.2x Support
Generic Box 2.3.1 Support
Get 1 Free 2.2x Support
Include HTML and Text Boxes 2.2x
jQuery Banner Rotator 2.2x 2.3.1 Support
Modular Front Page 2.3.1 Support
Modular SEO Header Tags 2.3.1 Support
More Pics 2.2x Support
MVS 2.2x Support
osC Catalog 2.2x Support
PDF Datasheet 2.3.1 Support
Price Updater 2.2x
Products Specifications 2.2x 2.3.1 Development Version Support Bugs/Suggestions
Request a Review 2.2x - 2.3.1 Support
Similar Products Box 2.2x
Theme Switcher 2.3.1 Support