If this is your first visit, check our documentation. To post, register or login.
Forums / General Questions / General Questions / Total number of products in stock

Total number of products in stock

Locked

Started by digitalshadow on 13 Aug 2010, 9:43 AM · Views: 832

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
13 Aug 2010, 9:43 AM
#1
digitalshadow avatar

digitalshadow

Totally Zenned

Join Date:
Mar 2009
Posts:
616
Plugin Contributions:
0

Post #1 by digitalshadow

Could anyone help me write a bit of code that would total up all the product stock quantities I have on the shop to tell me how many items I have in total.

for example

product 1 - out of stock
product 2 - 1 in stock
product 3 - 3 in stock
product 4 - 4 in stock
product 5 - 1 in stock
product 6 - out of stock
product 7 - 7 in stock
product 8 - 2 in stock

8 products - 18 items in stock

I'm after the total number in stock, is it possible to generate this number?

13 Aug 2010, 9:55 AM
#2
superprg avatar

superprg

Totally Zenned

Join Date:
Feb 2006
Location:
Chicago
Posts:
1,349
Plugin Contributions:
0

Post #2 by superprg

May be go to phpmyadmin and run

SELECT count(products_quantity) from products

Tutorials on Zen Cart
http://tutorials.zen-cart.com/index.php

advanced.programmer at gmail dot com
In love with Zen Cart!!

13 Aug 2010, 1:29 PM
#3
digitalshadow avatar

digitalshadow

Totally Zenned

Join Date:
Mar 2009
Posts:
616
Plugin Contributions:
0

Post #3 by digitalshadow

How could I call that from the shop side so I can have a display in the admin.

13 Aug 2010, 3:29 PM
#4
digitalshadow avatar

digitalshadow

Totally Zenned

Join Date:
Mar 2009
Posts:
616
Plugin Contributions:
0

Post #4 by digitalshadow

SELECT count(products_quantity) from products

that just totals the number of individual products on the store and not the total number available

would this work?

SELECT SUM( products_quantity ) FROM zen_products

13 Aug 2010, 9:29 PM
#5
superprg avatar

superprg

Totally Zenned

Join Date:
Feb 2006
Location:
Chicago
Posts:
1,349
Plugin Contributions:
0

Post #5 by superprg

Yes, I mean that...sorry about putting the count :)

Tutorials on Zen Cart
http://tutorials.zen-cart.com/index.php

advanced.programmer at gmail dot com
In love with Zen Cart!!