Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

OSC Printorder v 1.1


Recommended Posts

I have been struggling for the past couple of days to print invoices from this contribution. Catalog Printorder.php works fine, but for some reason invoices printed in Admin gives this text "TITLE_PRINT_ORDER #" in stead of the correct "Order # 87" (I should add that the invoice apart from this phenomenon prints correctly in admin). Printorder.php (catalog) and invoice.php (admin) are not identical, but I simply cannot see how to get this to work. An extract of my code from invoice.php is shown below:


 $customer_number_query = tep_db_query("select customers_id from " . TABLE_ORDERS . " where orders_id = '". tep_db_input(tep_db_prepare_input($HTTP_GET_VARS['order_id'])) . "'");
 $customer_number = tep_db_fetch_array($customer_number_query);
 if ($customer_number['customers_id'] != $customer_id) {
   tep_redirect(tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL'));
 $payment_info_query = tep_db_query("select payment_info from " . TABLE_ORDERS . " where orders_id = '". tep_db_input(tep_db_prepare_input($HTTP_GET_VARS['order_id'])) . "'");
 $payment_info = tep_db_fetch_array($payment_info_query);
 $payment_info = $payment_info['payment_info'];

//  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_INVOICE);

 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; ?>>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE . ' - ' . TITLE_PRINT_ORDER . ' #' . $HTTP_GET_VARS['order_id']; ?></title>
<base href="<?php echo (getenv('HTTPS') == 'on' ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="print.css">
<body marginwidth="10" marginheight="10" topmargin="10" bottommargin="10" leftmargin="10" rightmargin="10">

<!-- body_text //-->
<table width="600" border="0" align="center" cellpadding="2" cellspacing="0">
   <td align="center" class="main"><table align="center" width="100%" border="0" cellspacing="0" cellpadding="5">
       <td valign="top" align="left" class="main"><script language="JavaScript">
 if (window.print) {
   document.write('<a href="javascript:;" onClick="javascript:window.print()" onMouseOut=document.imprim.src="<?php echo (DIR_WS_IMAGES . 'printimage.gif'); ?>" onMouseOver=document.imprim.src="<?php echo (DIR_WS_IMAGES . 'printimage_over.gif'); ?>"><img src="<?php echo (DIR_WS_IMAGES . 'printimage.gif'); ?>" width="43" height="28" align="absbottom" border="0" name="imprim">' + '<?php echo IMAGE_BUTTON_PRINT; ?></a></center>');
 else document.write ('<h2><?php echo IMAGE_BUTTON_PRINT; ?></h2>')
       <td align="right" valign="bottom" class="main"><p align="right" class="main"><a href="javascript:window.close();"><img src='images/close_window.jpg' border=0></a></p></td>
 <tr align="left"> 
   <td class="titleHeading"><?php echo tep_draw_separator('pixel_trans.gif', '1', '25'); ?></td>
   <td><table border="0" align="center" width="100%" cellspacing="0" cellpadding="0">
       <td><table border="0" align="left" width="100%" cellspacing="0" cellpadding="0">
           <td class="pageHeading" align="left"><?php echo nl2br(STORE_NAME_ADDRESS); ?></td>
           <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . STORE_LOGO, STORE_NAME); ?></td>
           <td colspan="2" align="center" class="titleHeading"><b><?php echo TITLE_PRINT_ORDER . ' #' . $HTTP_GET_VARS['order_id']; ?></b></td>


I would also be glad if anyone could advice me on how to use another logo than the store logo, and also change the size of this.


Thanks for your help.



Link to comment
Share on other sites

I can only help with invoice and packingslip...


In catalog/admin/packingslip.php find this:

<?php echo tep_image(DIR_WS_IMAGES . 'oscommerce.gif', 'osCommerce', '204', '50'); ?>


change to your pic, your site name, and the size info.


In catalog/admin/invoice.php find this:

<?php echo tep_image(DIR_WS_IMAGES . 'oscommerce.gif', 'osCommerce', '204', '50'); ?>


change to your pic, your site name, and the size info.


Good luck with all,



Link to comment
Share on other sites

Thanks Wendy.

I believe though, that your comments are for the standard OSC invoice/packingslip. I have installed the Printorder contribution to let customers print their own invoice at checkout, which is not possible in the standard OS 2.2.


I have tried to use the standard invoice instead (in admin - keeping Printorder.php in catalog), but here I get the problem that it does not print the invoice number.


There must be some kind of bug in my code explaining why it does not print the correct order text and number. Hope someone can see this bug in my code.



Link to comment
Share on other sites

Join the conversation

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

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...