Zen Cart Logo
Forums / General Questions / Item stock lookup in orders page

Item stock lookup in orders page

Locked

Views: 723

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
12 Jul 2010, 6:18 PM
#1
sketchhgal avatar

sketchhgal

New Zenner

Join Date:
Aug 2007
Posts:
92
Plugin Contributions:
0

Item stock lookup in orders page

Can anyone tell me how I would do a stock level look-up for an item on the orders.php page in the admin section. What I need to do is for each item that is in an order do a look-up on that item to see whether the item is currently in stock or not. If the item is is in stock I want to display a green dot. If the item is not in stock I want to display a red dot next to it.

Ideally I would also like to shift any items which are in an order and not in stock to the bottom of the orders page so it is very easy to see at a glance if an order can be completely fulfilled or not.

Any help as always much appreciated.

Thanks in advance

12 Jul 2010, 7:37 PM
#2
sketchhgal avatar

sketchhgal

New Zenner

Join Date:
Aug 2007
Posts:
92
Plugin Contributions:
0

Re: Item stock lookup in orders page

Still trying to work this out and I'm now getting the following error:

None Catchable fatal error: Object of class queryFactoryResult could not be converted to string in

Here's the line it relates to:
' <td class="dataTableContent" valign="top">' . $order->products[$i]['model'] . '</td>' . "\n" .

And Here's the line above it which I think is causing the error because its this one I've been changing.

<td class="dataTableContent" valign="top">In stock:'.$amount_check = $db->Execute("select p.products_quantity from " . TABLE_PRODUCTS . " p WHERE p.products_id = '". $order->products[$i]['id'] ."'").''.$amount_check->products[$i]['products_quantity'].'</td>' . "\n" .

Anyone any ideas?

12 Jul 2010, 9:05 PM
#3
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Item stock lookup in orders page

Ideally I would also like to shift any items which are in an order and not in stock to the bottom of the orders page so it is very easy to see at a glance if an order can be completely fulfilled or not.
Easiest is to enable stock control so that an order will not be successful if there is no stock
This way for all processed orders you will know that you have the stock

12 Jul 2010, 9:15 PM
#4
sketchhgal avatar

sketchhgal

New Zenner

Join Date:
Aug 2007
Posts:
92
Plugin Contributions:
0

Re: Item stock lookup in orders page

kobra:

Easiest is to enable stock control so that an order will not be successful if there is no stock
This way for all processed orders you will know that you have the stock
Thanks for the reply. I agree but I need to do a lookup on the orders.php page for the quantity for reporting purposes also so does anyone know how to do what I'm needing becaus I can't get this to work at all. Please can someone help with this?

12 Jul 2010, 11:33 PM
#5
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Item stock lookup in orders page

You can use:

$chk_the_stock = zen_products_lookup($order->products[$i]['id'], 'products_quantity');

Then put the $chk_the_stock where you want it ...