Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Orderlist contrib


99darkgreenGT

Recommended Posts

  • Replies 92
  • Created
  • Last Reply

Top Posters In This Topic

yes, i have done that, but now i get this error:

 

Warning: mysql_connect(): Access denied for user: '******@localhost' (Using password: YES) in /home/username/public_html/catalog/admin/orderlist.php on line 64
Unable to connect to MySQL

 

are there any other files that need to be edited? thanks. i really want to get this to work! :D

Link to comment
Share on other sites

yes, i have done that, but now i get this error:

 

Warning: mysql_connect(): Access denied for user: '******@localhost' (Using password: YES) in /home/username/public_html/catalog/admin/orderlist.php on line 64
Unable to connect to MySQL

 

are there any other files that need to be edited? thanks. i really want to get this to work! :D

just copy it to the root of the admin folder. you will need to edit the file to provide the login information into the database.

 

another thing i discovered messing with it is that if you have changed your order statuses from the default, you will need to tweak the file, it is hardcoded to only look for orders with a status of "1".

 

B)

Link to comment
Share on other sites

thanks.....that worked.

 

btw, i did not set up my oscommerce site, my web host did. i am still learning php :P :D

 

now is there any way it can list the product attributes, as well as customer shipping information and shipping method? if i knew php i would take a stab at it, but like i said i am a newbie :o :lol:

Link to comment
Share on other sites

thanks.....that worked.

 

btw, i did not set up my oscommerce site, my web host did. i am still learning php :P :D

 

now is there any way it can list the product attributes, as well as customer shipping information and shipping method? if i knew php i would take a stab at it, but like i said i am a newbie :o :lol:

good question....no idea...I didnt write it....just got it working couple days ago....but now that i think of it, it would be kinda cool to list all the information.... might have to copy some code from the invoice.php or orders.php to get this data

Link to comment
Share on other sites

basically, i want something that will make it easier to send my orders to my wholesaler. our site does not stock inventory and whenever we have a sale, we just manually copy the order information into an email and send it to our wholesaler. they then ship the order for us.

 

it can be really time consuming to manually do each order. i would like something that can be run and copied/exported to email capturing multiple orders at one time (possibly the whole days worth of orders). this would save us a ton of time. this contrib seems like it might be able to pull it off for us. i probably spend about an hour a day copying and pasting the order information into emails for our wholesaler.

 

if there is a contrib that already does something like this, please let me know. i have looked through the contribs a number of times, but don't recall seeing something that does this. if there isn't one, i'd like to see one developed if possible.

 

thanks in advance. B)

Link to comment
Share on other sites

  • 3 weeks later...

Hey zlack

 

this is a really handy contribution.

 

I've been trying to add shipping address and telephone number to it but so far have failed. Would this be possible for you to add? Or could someone post the code needed?

 

Cheers

 

stubbsy

Link to comment
Share on other sites

Just play with the code, if you want that the orderlist contribution show the customer delivery address, etc, you can add this:

 

<?php

 

echo "".$row{'delivery_name'};

echo "<br>".$row{'delivery_street_address'};

echo "<br>".$row{'delivery_suburb'};

echo "<br>".$row{'delivery_postcode'};

echo "<br>".$row{'delivery_city'} . ", " . $row{'delivery_state'};

?>

</FONT></TD>

 

Send me a PM if you want my file...

Link to comment
Share on other sites

I edited orderlist.php so now shows delivery address, payments method, subtotal, shipping, total and attributes. And now the orders are not repited if there are more than one product in the order.

 

this is the code:

 

<?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 (c) 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
*/

require('includes/application_top.php');

require(DIR_WS_CLASSES . 'currencies.php');
$currencies = new currencies();

include(DIR_WS_CLASSES . 'order.php');
?>
<html>
<head>
<title>Ordenes en Proceso</title>
</head>
<body>
<TABLE style="BORDER-COLLAPSE: collapse" borderColor=#666666 cellSpacing=1 borderColorDark=#aaaaaa cellPadding=4 width="100%" align=center borderColorLight=#aaaaaa border=1>
<TBODY>  <font face=verdana>
<TR bgcolor=cccccc>
<TD><FONT face=verdana size=2>
<b>Orden</TD>
   <TD><FONT face=verdana size=2>
<b>Enviar a:</TD>             
<TD><FONT face=verdana size=2>
<b>Productos:</TD>             
</TR>
<?php
$username = "yourdbusername";
$password = "";
$hostname = "localhost";
$database = "yourdbname";
$dbh = mysql_connect($hostname, $username, $password)
       or die("Unable to connect to MySQL");
$selected = mysql_select_db($database,$dbh)
       or die("Could not select a database");
$result = mysql_query("SELECT * FROM `orders` WHERE orders_status = '1'");
while ($row = mysql_fetch_array($result,MYSQL_ASSOC)) {
if (tep_not_null($row['delivery_company'])) {
       $compan = $row['delivery_company'];
       $linea = "<br>";     
     } else {
       $compan = "";  
       $linea = "";
 }
       $ordernummer = $row{'orders_id'};
       // Query de order
       $resultaat2 = mysql_query("SELECT * FROM `orders_products` WHERE orders_id = $ordernummer GROUP BY orders_id");
       while ($row2 = mysql_fetch_array($resultaat2,MYSQL_ASSOC)) {
         ?>
               <TR>

               <TD borderColorLight=#aaaaaa bgColor=#efefef borderColorDark=#aaaaaa><FONT face=arial size=2><b>
               <?php

               echo "#" .$ordernummer;
               ?>
               </b></FONT></TD>
 <TD borderColorLight=#aaaaaa bgColor=#efefef borderColorDark=#aaaaaa><FONT face=verdana size=2>
               <?php
               echo $row{'delivery_name'} . "\n";
 echo $linea . ' ' . $compan . "\n";
 echo "<br>".$row{'delivery_street_address'} . "\n";
 echo "<br>Col. ".$row{'delivery_suburb'} . "\n";
 echo "<br>C.P. ".$row{'delivery_postcode'} . "\n";
 echo "<br>".$row{'delivery_city'} . ", " . $row{'delivery_state'} . "\n";
 echo "<br>Tel. ".$row{'customers_telephone'} . "\n";
               ?>
               </FONT></TD>
               <TD borderColorLight=#aaaaaa bgColor=#efefef borderColorDark=#aaaaaa>
<?php
$order = new order($ordernummer);
   for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) {
     echo '<font face=arial size=2>' . $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . '</font>' . "\n";

     if (isset($order->products[$i]['attributes']) && (($k = sizeof($order->products[$i]['attributes'])) > 0)) {
       for ($j = 0; $j < $k; $j++) {
         echo '<br><nobr><small> <i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'] . "\n";
         if ($order->products[$i]['attributes'][$j]['price'] != '0') echo ' (' . $order->products[$i]['attributes'][$j]['prefix'] . $currencies->format($order->products[$i]['attributes'][$j]['price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . ')';
         echo '</i></small></nobr>';
       }
     }

     echo ' <font face=verdana size=1><br><b>Modelo:</b> ' . $order->products[$i]['model'] . ' <b>Precio:</b> ' . $order->products[$i]['final_price'] . '<br><br>' . "\n";
   }
echo "--------------------<br><b>Metodo de Pago:</b> ". $row{'payment_method'} . "<br>";

 for ($i = 0, $n = sizeof($order->totals); $i < $n; $i++) {
   echo '<br>' . $order->totals[$i]['title'] . "\n" . $order->totals[$i]['text'] . "\n";
 }
?>
 </font></TD>                    
               </TR>
               <?php



               }
       }
mysql_close($dbh);
?>
</table>
</body>
</html>

Link to comment
Share on other sites

Thanks mutter,

 

just what I was after - nice work :)

 

btw hope you don't mind, I translated the text back to english :)

 

               <?php
              echo "<b>Name:</b> ".$row{'delivery_name'} . "\n";
echo "<br><b>Company:</b> " . ' ' . $compan . "\n";
echo "<br><b>Address 1:</b> ".$row{'delivery_street_address'} . "\n";
echo "<br><b>Address 2:</b> ".$row{'delivery_suburb'} . "\n";
echo "<br><b>Town / County:</b> ".$row{'delivery_city'} . ", " . $row{'delivery_state'} . "\n";
echo "<br><b>Postcode :</b> ".$row{'delivery_postcode'} . "\n";
echo "<br><b>Telephone:</b> ".$row{'customers_telephone'} . "\n";
              ?>

Link to comment
Share on other sites

  • 1 month later...

Hi all,

 

Like this script. Would like to add a feature though that displays the comments added to orders in the "notes" field.

 

I would like it to list the following but I'm no coder so I doesn't know how to write it

 

|orders_status_history -> comments| when |orders_status_history -> orders_status_id=2

 

[or where the orders_status_id= status you have selected..]

 

 

If anyone would like to help I really appreciate it!

 

Thanx!

Link to comment
Share on other sites

  • 2 weeks later...

That is exaclty what I'm trying to do, I have made the table for it to appear in but don't know the code to printthe comments in the table?

 

This is what I have which doesn't work, because i guess it is looking for the info in the orders table

 

<?php

echo "<b>Comments:</b> ".$row{'comments'} . "\n";

?>

 

Any ideas anyone?

 

cheers

 

stubbsy

Link to comment
Share on other sites

Hi, to add the comments of the orders try this (in the code that i post in this same topic).

 

Add

// Comments query

$statuses_query = mysql_query("select comments from orders_status_history WHERE orders_id = $ordernummer and orders_status_id = '1'");

while ($statuses = mysql_fetch_array($statuses_query)) {

 

just after

$ordernummer = $row{'orders_id'};

 

--------

 

Then, add

echo '<br><br>Comentarios: ' . $statuses{'comments'} . "\n";

 

After

echo '<br><a href="mailto:' . $row{'customers_email_address'} . '"><font size=1>' . $row{'customers_email_address'} . '</font></a>' . "\n";

 

----------

and before

mysql_close($dbh);

 

add

}

 

 

Let me know if work for you..

Link to comment
Share on other sites

  • 3 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...