Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Invoices and Labels


fredfillah

Recommended Posts

Posted

Over time, as your store has success, you develop shortcuts and streamline your processes for shipping out orders. When I first started, I was cutting/pasting the entire order into a Word doc so that I could use a custom format. Label printing was also a VERY manual process. This is very time consuming and doesn't scale as your business grows.

 

As we have been more successful (processing 300+ orders/day at peak), this approach was clearly not scaling.

 

So, I decided to employ a strategy used by Amazon, QVC and HSN.

  • I found printing paper that had 2 labels integrated on the top half, and blank paper at the bottom.
  • I reformatted admin/invoice.php to align to the new paper.
  • Now I have the ability, as I print the packing slip, to print the shipping label AND a return label (in the event the customer wants to return the product), all on one sheet of paper.

This has saved an unbelievable amount of time in order processing.

-Fred

Posted

Here's my admin/invoice.php. You may have to do some slight tweaking ;)

 

<?php
/*
 $Id: invoice.php,v 1.4 2003/02/16 13:40:33 thomasamoulton Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2002 osCommerce

 Released under the GNU General Public License
*/

 require('includes/application_top.php');

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

 $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);
 $orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where orders_id = '" . tep_db_input($oID) . "'");

 include(DIR_WS_CLASSES . 'order.php');
 $order = new order($oID);
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title>Storename Packing Slip: Order <?php echo $oID; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">

<!-- body_text //-->
<table border="0" width="100%" cellspacing="0" cellpadding="2">
 <tr>
   <table border="0" width="100%" cellspacing="0" cellpadding="2">
   <tr>
     <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '150'); ?></td>
     <!-- shipping label //-->
     <td valign="top">
       <table border="0" width="300" cellspacing="0" cellpadding="2">
       <tr><td class="smallText">Shipping Label<img src="images/arrow_rd.gif" border="0"></td></tr>
       <tr><td class="main"><br><?php echo nl2br(STORE_NAME_ADDRESS); ?></td></tr>
       <tr><td colspan="2"><img src="images/dash.gif" border="0"></td></tr>
       <tr><td class="main"><?php echo "<br><b>TO:<dl><dd>"; echo tep_address_format($order->delivery['format_id'], $order->delivery, 1, ' ', '<br>'); echo "</dl>" ?></td></tr>
       <tr><td class="smallText" align="right"><br><br>Order Number: <?php echo $oID; ?></td></tr>
       </table>
     </td>
     <td><?php echo tep_draw_separator('pixel_trans.gif', '50', '1'); ?></td>
     <!-- return label //-->
     <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '150'); ?></td>
     <td valign="top">
       <table border="0" width="300" cellspacing="0" cellpadding="2">
       <tr><td class="smallText">Return Label<img src="images/arrow_rd.gif" border="0"></td></tr>
       <tr><td class="main"><?php echo "<br>"; echo tep_address_format($order->delivery['format_id'], $order->delivery, 1, ' ', '<br>'); ?></td></tr>
       <tr><td colspan="2"><img src="images/dash.gif" border="0"></td></tr>
       <tr><td class="main"><br><b>TO:<dl><dd><?php echo nl2br(STORE_NAME_ADDRESS); ?></dl></td></tr>
       <tr><td class="smallText" align="right"><br><br>Order Number: <?php echo $oID; ?></td></tr>
       </table>
     </td>
     <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '150'); ?></td>
   </tr>
   <tr><td class="smallText" colspan="5"><br><br><i>For your convenience, we've provided a return label in the event you are not satisfied with our product. Please see our shipping and returns policy by visiting <u>http://www.StoreName.com/shipping.php</u></i><br></td></tr>
   </table>
 </tr>
 <tr>
   <td><table width="100%" border="0" cellspacing="0" cellpadding="2">
     <tr>
       <td colspan="2"><?php echo tep_draw_separator(); ?></td>
     </tr>
     <tr>
       <td class="pageHeading">Order Number: <?php echo $oID; ?></td>
     </tr>
     <tr>
       <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="2">
         <tr>
           <td class="main"><b><?php echo ENTRY_SOLD_TO; ?></b></td>
         </tr>
         <tr>
           <td class="main"><?php echo tep_address_format($order->customer['format_id'], $order->customer, 1, ' ', '<br>'); ?></td>
         </tr>
         <tr>
           <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>
         </tr>
         <tr>
           <td class="main"><?php echo $order->customer['telephone']; ?></td>
         </tr>
         <tr>
           <td class="main"><?php echo '<a href="mailto:' . $order->customer['email_address'] . '"><u>' . $order->customer['email_address'] . '</u></a>'; ?></td>
         </tr>
       </table></td>
       <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="2">
         <tr>
           <td class="main"><b><?php echo ENTRY_SHIP_TO; ?></b></td>
         </tr>
         <tr>
           <td class="main"><?php echo tep_address_format($order->delivery['format_id'], $order->delivery, 1, ' ', '<br>'); ?></td>
         </tr>
       </table></td>
     </tr>
   </table></td>
 </tr>
 <tr>
   <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
 </tr>
 <tr>
   <td><table border="0" cellspacing="0" cellpadding="2">
     <tr>
       <td class="main"><b><?php echo ENTRY_PAYMENT_METHOD; ?></b></td>
       <td class="main"><?php echo $order->info['payment_method']; ?></td>
     </tr>
   </table></td>
 </tr>
 <tr>
   <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
 </tr>
 <tr>
   <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
     <tr class="dataTableHeadingRow">
       <td class="dataTableHeadingContent" colspan="2"><?php echo TABLE_HEADING_PRODUCTS; ?></td>
       <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS_MODEL; ?></td>
       <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_TAX; ?></td>
       <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_PRICE_EXCLUDING_TAX; ?></td>
       <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_PRICE_INCLUDING_TAX; ?></td>
       <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_TOTAL_EXCLUDING_TAX; ?></td>
       <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_TOTAL_INCLUDING_TAX; ?></td>
     </tr>
<?php
   for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) {
     echo '      <tr class="dataTableRow">' . "\n" .
          '        <td class="dataTableContent" valign="top" align="right">' . $order->products[$i]['qty'] . ' x</td>' . "\n" .
          '        <td class="dataTableContent" valign="top">' . $order->products[$i]['name'];

     if ( ($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'];
         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 '        </td>' . "\n" .
          '        <td class="dataTableContent" valign="top">' . $order->products[$i]['model'] . '</td>' . "\n";
     echo '        <td class="dataTableContent" align="right" valign="top">' . tep_display_tax_value($order->products[$i]['tax']) . '%</td>' . "\n" .
          '        <td class="dataTableContent" align="right" valign="top"><b>' . $currencies->format($order->products[$i]['final_price'], true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "\n" .
          '        <td class="dataTableContent" align="right" valign="top"><b>' . $currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']), true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "\n" .
          '        <td class="dataTableContent" align="right" valign="top"><b>' . $currencies->format($order->products[$i]['final_price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "\n" .
          '        <td class="dataTableContent" align="right" valign="top"><b>' . $currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']) * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "\n";
     echo '      </tr>' . "\n";
   }
?>
     <tr>
       <td align="right" colspan="8"><table border="0" cellspacing="0" cellpadding="2">
<?php
 for ($i = 0, $n = sizeof($order->totals); $i < $n; $i++) {
   echo '          <tr>' . "\n" .
        '            <td align="right" class="smallText">' . $order->totals[$i]['title'] . '</td>' . "\n" .
        '            <td align="right" class="smallText">' . $order->totals[$i]['text'] . '</td>' . "\n" .
        '          </tr>' . "\n";
 }
?>
       </table></td>
     </tr>
     <tr><table border="0" width="500" cellspacing="0" cellpadding="2">
         <tr class="dataTableHeadingRow"><td colspan="3" class="dataTableHeadingContent"><b>Order Comments</td></tr>
<?php
   $orders_history_query = tep_db_query("select orders_status_id, date_added, customer_notified, comments from " . TABLE_ORDERS_STATUS_HISTORY . " where orders_id = '" . tep_db_input($oID) . "' order by date_added");
   if (tep_db_num_rows($orders_history_query)) {
     while ($orders_history = tep_db_fetch_array($orders_history_query)) {
       echo '          <tr valign=\"top\">' . "\n" .
            '            <td class="smallText" align="left" width="140">' . tep_datetime_short($orders_history['date_added']) . '</td>' . "\n" .
            '            <td class="smallText">' . nl2br(tep_db_output($orders_history['comments'])) . ' </td>' . "\n" .
            '          </tr>' . "\n";
     }
   }
?>
     </table>
     </tr>
   </table></td>
 </tr>
</table>
<!-- body_text_eof //-->

<br>

</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

 

Good luck,

Fred

-Fred

Posted

If anyone in the UK is interested in a bulk buy of these lables please PM me ASAP as I'll be ordering before Xmas.

  • 4 weeks later...
Posted

Hello Paul,

Well I spent the last two weeks pretty much full-time upgrading to MS2 but now am free to look at other things again. Did you decide whether to order labels? If you want to order 10,000 between the three of us and simply slip it 3 ways I'm happy. Just let me know.

 

Happy New Year

David

Posted

fred,

 

mind sharing the images you are using? what is dash, and the others?

 

Thanks.

-Chris

Chris Sullivan

  • 1 month later...
Posted

Does anyone know where to get hold of the paper with the integrated labels. I've been looking everywhere in the UK without success?

TIA,

Ian

Posted

I dont, but if you find out I would sure like to know too.

This kind of thing aint easy to find in the UK.

 

Might be a trip to the printers and get them to make them up for us.

:(

Posted

I found the Form/Shipping label combination at Office Max.

 

It has two labels - one for the "Ship to" label and a "Return Address" label.

 

They are placed in a column centered on half of the page, so I modified fredfillah's modified invoice.php file to fit this form.

 

I also made it so that my company logo is also on the shipping label for a more professional appearance.

 

The labels I found are: NCR - One step Form/Shipping Label combination, the best price I have found so far is $7.99 for 25 labels, if you find better let me know.

 

Below is the catalog/admin/invoice.php, and as always BACKUPBACKUPBACKUP before changing your files.

 

++++++++++++++++++++++++++++++++++++++++++++

 

<?php

/*

$Id: invoice.php,v 1.4 2003/02/16 13:40:33 thomasamoulton Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2002 osCommerce

 

Released under the GNU General Public License

*/

 

require('includes/application_top.php');

 

require(DIR_WS_CLASSES . 'currencies.php');

$currencies = new currencies();

 

$oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);

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

 

include(DIR_WS_CLASSES . 'order.php');

$order = new order($oID);

?>

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">

<html <?php echo HTML_PARAMS; ?>>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">

<title>YourStore Packing Slip: Order <?php echo $oID; ?></title>

<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">

</head>

<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">

 

<!-- body_text //-->

 

 

<center><table border="0" width="35%" cellspacing="0" cellpadding="0">

<tr>

<td valign="top">

<table border="0" width="300" cellspacing="0" cellpadding="0">

 

<!--Your LOGO Image //-->

<tr><td><br><br><img src="http://www.yourdomain.com/catalog/images/yourlogo.gif" width="250"></td></tr>

 

 

<tr><td class="main"><?php echo "<br><b>TO:<dl><dd>"; echo tep_address_format($order->delivery['format_id'], $order->delivery, 1, ' ', '<br>'); echo "</dl>" ?></td></tr>

</table>

</td>

<td><?php echo tep_draw_separator('pixel_trans.gif', '50', '1'); ?></td>

<!-- return label //-->

<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '150'); ?></td>

<td valign="top">

<tr><td class="main" valign="bottom"><br><br><br><dl><dd><?php echo nl2br(STORE_NAME_ADDRESS); ?></dl><br></td></tr>

<tr><td class="smallText" align="right"><br><br>Order Number: <?php echo $oID; ?><br><br>br><br><br></td></tr>

</table></center>

 

 

</tr>

<tr>

<td><table width="100%" border="0" cellspacing="0" cellpadding="2">

<tr>

<td colspan="2"><?php echo tep_draw_separator(); ?></td>

</tr>

<tr>

<td class="pageHeading">Order Number: <?php echo $oID; ?></td>

</tr>

<tr>

<td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="2">

<tr>

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

</tr>

<tr>

<td class="main"><?php echo tep_address_format($order->customer['format_id'], $order->customer, 1, ' ', '<br>'); ?></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>

</tr>

<tr>

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

</tr>

<tr>

<td class="main"><?php echo '<a href="mailto:' . $order->customer['email_address'] . '"><u>' . $order->customer['email_address'] . '</u></a>'; ?></td>

</tr>

</table></td>

<td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="2">

<tr>

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

</tr>

<tr>

<td class="main"><?php echo tep_address_format($order->delivery['format_id'], $order->delivery, 1, ' ', '<br>'); ?></td>

</tr>

</table></td>

</tr>

</table></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

</tr>

<tr>

<td><table border="0" cellspacing="0" cellpadding="2">

<tr>

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

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

</tr>

</table></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

</tr>

<tr>

<td><table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr class="dataTableHeadingRow">

<td class="dataTableHeadingContent" colspan="2"><?php echo TABLE_HEADING_PRODUCTS; ?></td>

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

<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_TAX; ?></td>

<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_PRICE_EXCLUDING_TAX; ?></td>

<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_PRICE_INCLUDING_TAX; ?></td>

<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_TOTAL_EXCLUDING_TAX; ?></td>

<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_TOTAL_INCLUDING_TAX; ?></td>

</tr>

<?php

for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) {

echo ' <tr class="dataTableRow">' . "\n" .

' <td class="dataTableContent" valign="top" align="right">' . $order->products[$i]['qty'] . ' x</td>' . "\n" .

' <td class="dataTableContent" valign="top">' . $order->products[$i]['name'];

 

if ( ($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'];

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 ' </td>' . "\n" .

' <td class="dataTableContent" valign="top">' . $order->products[$i]['model'] . '</td>' . "\n";

echo ' <td class="dataTableContent" align="right" valign="top">' . tep_display_tax_value($order->products[$i]['tax']) . '%</td>' . "\n" .

' <td class="dataTableContent" align="right" valign="top"><b>' . $currencies->format($order->products[$i]['final_price'], true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "\n" .

' <td class="dataTableContent" align="right" valign="top"><b>' . $currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']), true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "\n" .

' <td class="dataTableContent" align="right" valign="top"><b>' . $currencies->format($order->products[$i]['final_price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "\n" .

' <td class="dataTableContent" align="right" valign="top"><b>' . $currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']) * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "\n";

echo ' </tr>' . "\n";

}

?>

<tr>

<td align="right" colspan="8"><table border="0" cellspacing="0" cellpadding="2">

<?php

for ($i = 0, $n = sizeof($order->totals); $i < $n; $i++) {

echo ' <tr>' . "\n" .

' <td align="right" class="smallText">' . $order->totals[$i]['title'] . '</td>' . "\n" .

' <td align="right" class="smallText">' . $order->totals[$i]['text'] . '</td>' . "\n" .

' </tr>' . "\n";

}

?>

</table></td>

</tr>

<tr><table border="0" width="500" cellspacing="0" cellpadding="2">

<tr class="dataTableHeadingRow"><td colspan="3" class="dataTableHeadingContent"><b>Order Comments</td></tr>

<?php

$orders_history_query = tep_db_query("select orders_status_id, date_added, customer_notified, comments from " . TABLE_ORDERS_STATUS_HISTORY . " where orders_id = '" . tep_db_input($oID) . "' order by date_added");

if (tep_db_num_rows($orders_history_query)) {

while ($orders_history = tep_db_fetch_array($orders_history_query)) {

echo ' <tr valign=\"top\">' . "\n" .

' <td class="smallText" align="left" width="140">' . tep_datetime_short($orders_history['date_added']) . '</td>' . "\n" .

' <td class="smallText">' . nl2br(tep_db_output($orders_history['comments'])) . ' </td>' . "\n" .

' </tr>' . "\n";

}

}

?>

</table>

</tr>

</table></td>

</tr>

</table>

<!-- body_text_eof //-->

 

<br>

 

</body>

</html>

<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Posted

If anyone in the UK would like the details of a supplier here, then please send me a PM.

Posted

Fred - are you able to share those images? arrow_rd.gif & dash?

 

Thanks.

  • 1 month later...
Posted

If anyone in the UK needs any of these labels then I have some available having somewhat over-ordered :-(

 

Please PM me if you are interested.

  • 1 year later...
Posted

Hi,

 

Could you tell which UK supplier you got your integrated labels from? Can't seem to find what I'm lokking for - theres loads in the US though! :( Many thanks!

Posted

You can find a UK company called Centereed who are literally a stones throw away from our own business.

They have quoted us for this kind of design.

Posted
You can find a UK company called Centereed who are literally a stones throw away from our own business.

They have quoted us for this kind of design.

 

Thanks for that...would you mind telling me where they are based and what business they are in (eg. printers) as I can't find them (is that the correct spelling?). Website address would also be great is you happen to know it.

 

Many thanks for your help :thumbsup:

  • 11 months later...
  • 2 months later...
Posted

Just to make it quicker still, what we've done is format the email you receive to be the invoice with a peel off integrated address label and return address, and another peal off label for the posting book (orderID and address)

 

 

So that we just bulk print the order notification emails with a handy little add on called outlookprinter.

 

One select&click in outlook prints all invoices. No need to go to admin at all. You wouldn't believe how much time this saves.

 

Cheers

 

K

  • 1 month later...
Posted
Just to make it quicker still, what we've done is format the email you receive to be the invoice with a peel off integrated address label and return address, and another peal off label for the posting book (orderID and address)

So that we just bulk print the order notification emails with a handy little add on called outlookprinter.

 

One select&click in outlook prints all invoices. No need to go to admin at all. You wouldn't believe how much time this saves.

 

Cheers

 

K

 

 

Hi,

it's possible stamp invoice click only button invoice without open new page and select stamp??

Posted

Yes .

 

we can print all selected invoices/emails with one click

Archived

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

×
×
  • Create New...