Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Order #


smash123

Recommended Posts

Hi,

 

If you go to Admin>Customers>Order>invoice

OSC can generate an invoice for yoru customer but it is missing order # there. Want to know if I can add an order # generated by OSC. It would be great if package slip have the order # too. Thank you

Link to comment
Share on other sites

First, be aware that osC starts order numbers at 1.

 

You need to edit the admin/includes/classes/order.php file to add the order number to the class. The info group is a good place for this.

 

To add the order number to the Invoice and Packing Slip screen, you need to edit the admin/invoice.php and admin/packingslip.php files respectively.

 

If you wish to have some text preceeding the order number (e.g. "Order No: "), add that to the admin/includes/languages/[language]/invoice.php and admin/includes/languages/[language]/packingslip.php files, respectively.

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

Link to comment
Share on other sites

Hi

I am also trying to add order number to invoice (dont understand why this is not part of standard build?) number but have a problem.

In admin/includes/classes/order.php I have added

$this->info = array('currency' => $order['currency'],

'currency_value' => $order['currency_value'],

'payment_method' => $order['payment_method'],

'cc_type' => $order['cc_type'],

'cc_owner' => $order['cc_owner'],

'cc_number' => $order['cc_number'],

'cc_expires' => $order['cc_expires'],

 

'orders_id' => $order['orders_id'],

 

and in admin/invoice.php i have added

<tr>

<td class="main"><b><?php echo ENTRY_ORDER_ID; ?></b></td>

<td class="main"><?php echo $order->info['orders_id']; ?></td>

</tr>

 

But no luck, what I am I missing?

thanks

Rich

"May the seam be with you"

Link to comment
Share on other sites

Edit orders.php

 

Add:

// BOF: WebMakers.com Added: Additional info for Orders

// Look up things in orders

$the_extra_query= tep_db_query("select * from " . TABLE_ORDERS . " where orders_id = '" . tep_db_input($oID) . "'");

$the_extra= tep_db_fetch_array($the_extra_query);

$the_customers_id= $the_extra['customers_id'];

// Look up things in customers

$the_extra_query= tep_db_query("select * from " . TABLE_CUSTOMERS . " where customers_id = '" . $the_customers_id . "'");

$the_extra= tep_db_fetch_array($the_extra_query);

$the_customers_fax= $the_extra['customers_fax'];

// EOF: WebMakers.com Added: Additional info for Orders

 

Above:

  include(DIR_WS_CLASSES . 'order.php');

 

The where you want the the info add:

<?php

// BOF: WebMakers.com Added: show additional order info

?>

<!-- Customers ID# // -->

<tr>

 <td class="main"><b>Customers # </b></td>

 <td class="main"><?php echo $the_customers_id; ?></td>

</tr>

<!-- add Order # // -->

<tr>

 <td class="main"><b>Order # </b></td>

 <td class="main"><?php echo tep_db_input($oID); ?></td>

</tr>

<!-- add date/time // -->

<tr>

 <td class="main"><b>Date & Time</b></td>

 <td class="main"><?php echo tep_datetime_short($order->info['date_purchased']); ?></td>

</tr>

<tr>

 <td class="main"><b>Shipping Method:</b></td>

 <td class="main"><?php echo tep_get_orders_shipping_method($oID); ?></td>

</tr>

<?php

// EOF: WebMakers.com Added: show additional order info

?>

 

I placed that above the ENTRY_PAYMENT_METHOD

Link to comment
Share on other sites

Hi Ajey

Brilliant, that worked a treat. One final thing, when you go customers-orders and come to the screen with the list of orders. We have a table that goes Customers- Order Total - Date Purchased etc

How do I get the Order No in first before the Customers and then display the Order No against each ordrer?

thanks

Rich

"May the seam be with you"

Link to comment
Share on other sites

Hmm - I have done everything above, put Linda's code in orders.php, put:

 

<tr> 

<td class="main"><b><?php echo ENTRY_ORDER_ID; ?></b></td> 

<td class="main"><?php echo $order->info['orders_id']; ?></td> 

</tr>

in admin/invoice.php, defined ENTRY_ORDER_ID in languages/invoice.php, but all it says on the invoice is Order number: and then nothing, no actual number.

 

Any idea what I forgot?

Link to comment
Share on other sites

Fixed it!

 

Changed:

<tr> 

<td class="main"><b><?php echo ENTRY_ORDER_ID; ?></b></td> 

<td class="main"><?php echo $order->info['orders_id']; ?></td> 

</tr>

to:

<tr> 

<td class="main"><b><?php echo ENTRY_ORDER_ID; ?></b></td> 

<td class="main"><?php echo tep_db_input($oID); ?></td> 

</tr>

 

Works fine.

Link to comment
Share on other sites

Hi Ajey

Brilliant, that worked a treat. One final thing, when you go customers-orders and come to the screen with the list of orders. We have a table that goes Customers- Order Total - Date Purchased etc

How do I get the Order No in first before the Customers and then display the Order No against each ordrer?

 

You will need to add a column header and then the field in the listing to display the Order ID.

 

I have it on my demo site for SECv2.2 ... let me know if that is the display you are looking for on the orders.

Link to comment
Share on other sites

This addes the ID#

                <td class="dataTableHeadingContent" width='30'><?php echo 'ID #'; ?></td>

               <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CUSTOMERS; ?></td>

 

This adds the ID# in the display:

// WebMakers.com Added: Display ID# in listing

?>

               <td class="<?php echo $current_row; ?>"><?php echo '#' . $orders['orders_id']; ?></td>

               <td class="<?php echo $current_row; ?>"><?php echo '<a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $orders['orders_id'] . '&action=edit') . '">' . tep_image(DIR_WS_ICONS . 'preview.gif', ICON_PREVIEW) . '</a> ' . $orders['customers_name']; ?></td>

Link to comment
Share on other sites

All is fine except one small thing- the info in the displayed table under Order ID and Customers is in Times New Roman and a couple of sizes up on the rest of the table contents?

thanks

Rich

"May the seam be with you"

Link to comment
Share on other sites

All is fine except one small thing- the info in the displayed table under Order ID and Customers is in Times New Roman and a couple of sizes up on the rest of the table contents?

 

Sorry, that is from my code ... :shock:

 

Change:

 

<td class="<?php echo $current_row; ?>">

 

To read:

<td class="dataTableContent" align="right" valign="top">

Link to comment
Share on other sites

Thanks Linda, all fine now. :)

 

I have to remember sometimes that my code is rather customized and needs to be cleaned up a bit.

 

Sometimes I catch it and sometimes not. :wink:

Link to comment
Share on other sites

  • 4 weeks later...

Whenever I add the code into orders.php, the whole page goes blank. Then, if I take the code back out, orders.php is still blank. I have to reupload the original file to get the page back.

 

Am I missing something?

Link to comment
Share on other sites

Does anyone have any detailed instructions on how to go about this?.

it's a little confusing reading the post.

thanks

<span style='font-family:Courier'>If you can't fix it Perl it!!!...</span>

******************************

Link to comment
Share on other sites

  • 4 months later...

:D YAY! This is just the fix I was looking for to make our office manager happy. Now tell me this... where would I insert this code at? I'm reeeeeally new to doing PHP programming. I've already learned that you backup, backup, backup (and sometimes backup what you've already backed up) Just to confirm, this will add a column to the orders.php page that shows the order ID?

 

Thank you!

Tim

"Success has nothing to do with what you gain in life or accomplish for yourself. It's what you do for others."

 

- Danny Thomas, founder of St Jude Children's Research Hospital

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...