hansmignon Posted January 28, 2005 Share Posted January 28, 2005 Hello, I have orderlist3.3.zip installed and it is a greet contribution and we are using it to put are orders to the whole sales manufactor. But there is only one problem when you see the orderlist it is not possible to see the actualy stock of that product. So we have to check this in the catalog. I was searching and trying for some days now but I cannot find how I have to addapt the code so he will display the stock quantity at the moment. The problem is this contribution is getting data from order_products and we need data from products tabel. Is there someone who can help us with this ? Here is the code of the orderlist: <?php /* $Id: orderlist.php, v 1.0 2004/2/1 21:08:47 dgw_ Exp $ Made by zlack, www.partshop.nl osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2004 osCommerce Released under the GNU General Public License This is not a real "contribution" but more an addon. Since i order each day (i keep no stock) i found it very much work to open each order to see what someone ordered. This little script does that for me, and shows everything nice in tables, so i can e-mail the output to my distributor :) Questions, comments, thank you's and so on: zlack AT partshop.nl */ // Buffering ob_start(); require('includes/application_top.php'); require(DIR_WS_CLASSES . 'currencies.php'); $currencies = new currencies(); include(DIR_WS_CLASSES . 'order.php'); $order_status = $select_order_status; $display_order_status = $order_status; if ($order_status == "") { $order_status = 1; } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title><?php echo TITLE . ' - ' . OL_TITLE ?></title> <link rel="stylesheet" type="text/css" href="orderlist-styles.css" media="all" > </head> <body> <h1><?php echo OL_HEAD; ?></h1><br> <h2> <?php $query_status = "SELECT * FROM `orders_status` where `orders_status_id` = $order_status AND language_id = $languages_id"; $status_result = tep_db_query($query_status); while ($row4 = tep_db_fetch_array($status_result)) { echo "("; $orders_status_name = $row4['orders_status_name']; echo $orders_status_name; echo ")"; } // FORM THAT LETS YOU SELECT WHICH ORDER STATUS TO DISPLAY ?> </h2> <form name="orderstatus" method="post" action="<?php echo $PHP_SELF?>"> <?php $query_status = "SELECT * FROM `orders_status` WHERE language_id = $languages_id"; $status_result = tep_db_query($query_status); echo OL_SELECT_STATUS . " "; echo "<select name=\"select_order_status\">"; echo "<option value=></option>"; while ($row3 = tep_db_fetch_array($status_result)) { echo "<option value="; echo $row3['orders_status_id']; echo ">"; echo $row3['orders_status_name']; echo "</option><br>"; } echo "</select>"; ?> <input type="submit" name="Submit" value="<?php echo OL_SUBMIT; ?>"> <input type="button" value="<?php echo OL_PRINT; ?>" onClick="window.print()" /> </form> <TABLE width="100%" align=center cellSpacing=1 cellPadding=4 border=1> <TBODY> <TR class="headers"> <TD class="orderNr" align="center"><?php echo OL_ORDERNR; ?></TD> <TD class="date" align="center"><?php echo OL_DATE; ?></TD> <TD class="name"><?php echo OL_NAME; ?></TD> <TD class="details"><?php echo OL_DETAILS; ?></TD> </TR> <?php $query1 = "SELECT * FROM `orders` WHERE orders_status = $order_status ORDER BY orders_id DESC"; $result = tep_db_query($query1); while ($row = tep_db_fetch_array($result)) { $ordernummer = $row['orders_id']; ?> <TR> <TD align="center"> <b><?php echo $ordernummer; ?></b></TD> <TD align="center"> <?php echo tep_datetime_short($row['date_purchased']); ?></TD> <TD> <?php echo OL_CUSTOMERNAME .' '. $row{'delivery_name'}; ?><br> <?php echo OL_ADDRESS .' '. $row{'delivery_street_address'}; ?><br> <?php echo OL_CITY .' '. $row{'delivery_city'}; ?><br> <?php echo OL_ZIP .' '. $row{'delivery_postcode'}; ?><br> <?php echo OL_TEL .' '. $row{'customers_telephone'}; ?><br> <?php echo OL_EMAIL .' '. $row{'customers_email_address'}; ?> </TD> <TD> <?php $order = new order($ordernummer); for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) { ?> <b><?php echo $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name']; ?></b><br> <b><?php echo $products['quantity'] . ' x ' . $order->products[$i]['name']; ?></b><br> <?php echo OL_MODEL . ' ' . $order->products[$i]['model']; ?><br> <?php } ?> <?php echo '--------------------------------------'; ?><br> <?php echo $row{'payment_method'}; ?><br> <?php for ($i = 0, $n = sizeof($order->totals); $i < $n; $i++) { ?> <?php echo '<br>' . $order->totals[$i]['title'] . ' ' . $order->totals[$i]['text']; ?> <?php } ?> </TD> </TR> <?php } ?> </table> <p> </p> </body> </html> <?php ob_end_flush(); ?> Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.