Forums / General Questions / Change All Stock Quantity AT Once Through The Admin Panel

Change All Stock Quantity AT Once Through The Admin Panel

Views: 4,664

Results 1 to 13 of 13
20 Apr 2012, 7:48 PM
#1
fabienne avatar

fabienne

Zen Follower

Join Date:
May 2007
Location:
Cincinnati, Ohio
Posts:
246
Plugin Contributions:
0

Change All Stock Quantity AT Once Through The Admin Panel

I have had a Zen Cart for 5 years but need to set all of my product quantity in stock to 1000 units. Can I do that through the admin panel, or do I have to resort to changing the quantity in MySql? I hope for the former. I have searched this forum and my admin panel but can't quite seem to find the answer. Thanks you. I am using Zen Cart version 1.3.9h

Background (if you are interested): I started to get product ingredient discontinuations from my vendors, that meant that I have to package what I have left of some of my products, count the inventory and put it in the individual product listing. That's fairly easy, I have only about 24 of those. However, I have >200 products on my site. I really don't want to have to go in and change the in stock quantity for each of the 200 to something like 10,000 so they always show in stock. I want to change all of my products' stock level to 10,000 in one action and then go in and put in the proper quantity of packaged product for the limited products only. That would be far less time consuming. I hope I have explained this well to you. I did search to see if I could find anything to guide me here but alas, I found nothing.

Thanks.

The Zen of cat.

20 Apr 2012, 7:59 PM
#2
fabienne avatar

fabienne

Zen Follower

Join Date:
May 2007
Location:
Cincinnati, Ohio
Posts:
246
Plugin Contributions:
0

Re: Change All Stock Quantity AT Once Through The Admin Panel

Or is my answer Easy Populate?*

*The self-help desk strikes again maybe.

The Zen of cat.

20 Apr 2012, 8:12 PM
#3
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Change All Stock Quantity AT Once Through The Admin Panel

You can change it using a SQL patch:

UPDATE 'products' SET 'products_quantity' = 1000;

Under your TOOLS menu, find "Install SQL Patches", and run it using that utility.

20 years a Zencart User

20 Apr 2012, 8:52 PM
#4
fabienne avatar

fabienne

Zen Follower

Join Date:
May 2007
Location:
Cincinnati, Ohio
Posts:
246
Plugin Contributions:
0

Re: Change All Stock Quantity AT Once Through The Admin Panel

Please let me ask baby style if this would be the way to do it:

  1. backup my database (or else).
  2. go to the tools-->Install SQL Patches
  3. when I get to that screen I see "SQL Query Executor" in big scary letters on the top of the page, followed by equally scary red writing urging me to backup etc. Then there is a large empty box.
  4. I put the above code (and only that) in the box, checking to be sure that there is a ; at the end of it (which there is)
  5. click the send button
  6. Pay no mind to this scary caution: NOTE: Zen Cart database-upgrade scripts should NOT be run from this page.
    Please upload the new zc_install folder and run the upgrade from there instead for better reliability.

Am I right? Thanks for letting me know.

The Zen of cat.

20 Apr 2012, 9:03 PM
#5
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Change All Stock Quantity AT Once Through The Admin Panel

Yes... that's how you do it. BACKING UP is usually advised, and this should be done on your host c-panel. They have a backup feature (or ought to have one).

I just ran that little command through a new install of ZC1.5 and it behaved properly, so a backup is not critical in this case.

However, if you wish, do a backup first. After backing up, undertake your steps (4) and (5)

THIS CODE - WITHOUT INVERTED COMMAS will probably be better to use:

UPDATE products SET products_quantity = 1000;

20 years a Zencart User

20 Apr 2012, 10:00 PM
#6
fabienne avatar

fabienne

Zen Follower

Join Date:
May 2007
Location:
Cincinnati, Ohio
Posts:
246
Plugin Contributions:
0

Re: Change All Stock Quantity AT Once Through The Admin Panel

Thank you! That worked beautifully. In the blink of an eye everything was changed to 10000 (I went from 1000 to 10000 just in case, so I would not have to update the ones which are not going out of production.

Is there a universal way to change any product whose price is $10 to $10.99 by MySQL patch., too. Or is this a time to say that I should start thinking about Easy Populate and stop feeling lucky?

The Zen of cat.

21 Apr 2012, 9:49 AM
#7
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Change All Stock Quantity AT Once Through The Admin Panel

fabienne:

Thank you! That worked beautifully. In the blink of an eye everything was changed to 10000 (I went from 1000 to 10000 just in case, so I would not have to update the ones which are not going out of production.

Is there a universal way to change any product whose price is $10 to $10.99 by MySQL patch., too. Or is this a time to say that I should start thinking about Easy Populate and stop feeling lucky?

UPDATE products SET products_price = 10.99 where products_price = 10.00;

20 years a Zencart User

21 Apr 2012, 1:05 PM
#8
fabienne avatar

fabienne

Zen Follower

Join Date:
May 2007
Location:
Cincinnati, Ohio
Posts:
246
Plugin Contributions:
0

Re: Change All Stock Quantity AT Once Through The Admin Panel

schoolboy:

UPDATE products SET products_price = 10.99 where products_price = 10.00;


Thank you, Schoolboy! That worked a treat. I really appreciate your help. You saved me hours of tedium.

The Zen of cat.

5 Jun 2012, 4:05 PM
#9
bewitching avatar

bewitching

New Zenner

Join Date:
Oct 2010
Location:
Wisco
Posts:
54
Plugin Contributions:
0

Re: Change All Stock Quantity AT Once Through The Admin Panel

I HIGHLY recommend Apsona for ZenCart !
I have used it for several years and it's a life-saver! VERY easy to install, (just be sure you change the "admin" folder included, to what you renamed your admin folder to, and you're all set). A cinch to install via FTP.
When you first use it, it's a bit intimidating because you can SO much with it. I mainly use it to upload .csv files to add new products, update current products and do mass deletes.
If you like, I have a .csv template file I use that has all the correct headings to use when uploading your .csv files.

But you don't need csv's to update products you already have listed. You can dial down within the interface, using various filters to just the items you need to update, and update them right there.
Here's the link to their website: Apsona http://apsona.com/pages/ec/signup.html
You have to sign up with them first, they will then send you the link to download the software.
Here's a link to the tour that demonstrates all this little gem can do.

(If you want that csv file with all the proper headers for importing into ZenCart, send me a message, and it'll send it to you.)

fabienne:

Thank you! That worked beautifully. In the blink of an eye everything was changed to 10000 (I went from 1000 to 10000 just in case, so I would not have to update the ones which are not going out of production.

Is there a universal way to change any product whose price is $10 to $10.99 by MySQL patch., too. Or is this a time to say that I should start thinking about Easy Populate and stop feeling lucky?

Have a Bewitching Day

5 Jun 2012, 7:37 PM
#10
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Change All Stock Quantity AT Once Through The Admin Panel

Yes... We really like Apsona too. And I agree, the more you use it the more you find out about it.

It's still ok to use SQL Patches, however... for GLOBAL changes such as are bing discussed on this thread, a quick SQL patch is perfect.

20 years a Zencart User

5 Jun 2012, 9:47 PM
#11
bewitching avatar

bewitching

New Zenner

Join Date:
Oct 2010
Location:
Wisco
Posts:
54
Plugin Contributions:
0

Re: Change All Stock Quantity AT Once Through The Admin Panel

If only I knew how to write SQL patches :blink:

schoolboy:

Yes... We really like Apsona too. And I agree, the more you use it the more you find out about it.

It's still ok to use SQL Patches, however... for GLOBAL changes such as are bing discussed on this thread, a quick SQL patch is perfect.

Have a Bewitching Day

24 Jun 2025, 5:21 PM
#12
jmberman avatar

jmberman

Zen Follower

Join Date:
May 2016
Location:
Ohio
Posts:
422
Plugin Contributions:
0

Re: Change All Stock Quantity AT Once Through The Admin Panel

How can I use this code for a specific category?

UPDATE products SET products_quantity = 1;

Like for a specific category ID

24 Jun 2025, 8:37 PM
#13
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,111
Plugin Contributions:
56

Re: Change All Stock Quantity AT Once Through The Admin Panel

jmberman:

How can I use this code for a specific category?

UPDATE products SET products_quantity = 1;

Like for a specific category ID
Fairly easy for all products with a specific master_categories_id:

UPDATE products SET products_quantity = 1 WHERE master_categories_id = 3;

Doesn't update products that are linked to that category.