jools Posted January 4, 2004 Share Posted January 4, 2004 There seems to be a problem in this code, but am not sure what. On the invoice page on website its coming up with lots of n's. All I had tried to do was change the oscommerce gif, with our logo. And there's something wrong. Would be grateful if someone could have a look at it please. <?php/* $Id: invoice.php,v 1.6 2003/06/20 00:37:30 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 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 = '" . (int)$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><?php echo TITLE; ?></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> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pageHeading"><?php echo nl2br(STORE_NAME_ADDRESS); ?></td> <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'oscommerce.gif', 'osCommerce', '204', '50'); ?></td> </tr> </table></td> </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 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 (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']; 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> </table></td> </tr> </table> <!-- body_text_eof //--> <br> </body> </html> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> Many thanks to anyone who can help Julie Link to comment Share on other sites More sharing options...
garyg Posted January 4, 2004 Share Posted January 4, 2004 How did you try to change the logo? The file you posted looks like the standard one. Also, find the line: <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'oscommerce.gif', 'osCommerce', '204', '50'); ?></td> The 'osCommerce' after 'osCommerce.gif' is the text that will show when someone puts the mouse over the image. You should change that to your store name. The internet? Is that thing still around? Link to comment Share on other sites More sharing options...
eHo Posted January 4, 2004 Share Posted January 4, 2004 Hi Julie, I glanced over the code and it appears to have a whole bunch of '"echo "n"' in it. I don't have a copy of oscommerce with my right now so I can't see if that is how it is supposed to be but what I am assuming is that they are "newline" characters. Try throwing a "/" before a few of those n's and see what happens. Link to comment Share on other sites More sharing options...
garyg Posted January 4, 2004 Share Posted January 4, 2004 eHo, You have GREAT eyes! ;) I didn't notice that until you mentioned it. GREAT CATCH! The internet? Is that thing still around? Link to comment Share on other sites More sharing options...
jools Posted January 5, 2004 Author Share Posted January 5, 2004 Thanks I will give that a try! Fingers crossed... Julie Link to comment Share on other sites More sharing options...
jools Posted January 5, 2004 Author Share Posted January 5, 2004 Well I did try that, and now I have a whole lot of /n 's on the invoice page! hmmm :huh: Link to comment Share on other sites More sharing options...
devosc Posted January 5, 2004 Share Posted January 5, 2004 eHO meant "\n" "Any fool can know. The point is to understand." -- Albert Einstein Link to comment Share on other sites More sharing options...
jools Posted January 5, 2004 Author Share Posted January 5, 2004 Oh I see, will give that a try also. Thanks gregbaboolal! Julie Link to comment Share on other sites More sharing options...
jools Posted January 5, 2004 Author Share Posted January 5, 2004 Well I did that, and its FIXED!! Thank you, thank you! Now all I have to do is work out how to change the oscommerce logo on it and packing slip to our shop logo. Any ideas for a quick simple fix? Please. Julie :D Link to comment Share on other sites More sharing options...
Guest Posted January 5, 2004 Share Posted January 5, 2004 Easiest thing - create your logo, name it oscommerce.gif and upload it to your server, replacing the current one with the new one. Or create your logo, upload it to the server with another name and change: <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'oscommerce.gif', 'osCommerce', '204', '50'); ?></td> to <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'yourlogoname.gif', 'Your Store Name', '204', '50'); ?></td> Link to comment Share on other sites More sharing options...
jools Posted January 5, 2004 Author Share Posted January 5, 2004 create your logo, upload it to the server with another name and change I already have a logo, but when I tried the <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'yourlogoname.gif', 'Your Store Name', '204', '50'); ?></td>, with my logo it came up as a box with a little red cross in it. Also do I have to change the packing slip file? Or any other files? Many thanks for any help. Julie Link to comment Share on other sites More sharing options...
Guest Posted January 5, 2004 Share Posted January 5, 2004 There are two images folders, one for the catalog and one for the admin. You have to upload your logo twice. The file is looking for the image in the admin folder and if it's not there it will display the red cross. I think it's in catalog/admin/images but check that. If you simply replace the image with one of the same name, no you don't have to change it anywhere else (which is why it's easier). If you change the image name then you have to also change it whever the image occurs.. Link to comment Share on other sites More sharing options...
jools Posted January 5, 2004 Author Share Posted January 5, 2004 You are a star JulieCSM! I finally did it thanks to you! :D Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.