skalcevich Posted December 29, 2005 Share Posted December 29, 2005 i wish to add a field on order confirmations next to item number for product descrition. I have the code below but its not correct. Can anyone help me out? i have been trying for days! This is at the top of invoice.php in /includes/modules/email_invoice/templates/invoice.php $sql = 'SELECT `products_description` FROM `products_description` WHERE 'products.products_id' = 'products_description.products_id''; $description_query = tep_db_query($sql); $description = mysql_fetch_array($description_query, MYSQL_ASSOC); $description['products_description'] = substr($description['products_description'], 0, 40); This is the other part to it where it should display it echo ' <td class="dataTableContent" valign="left">' . $description['products_description'] . '</td>' . "\n"; As you can tell its not right! here is my entire invoice.php to look at. <?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 (c) 2003 osCommerce Released under the GNU General Public License */ ?> <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html <?php echo HTML_PARAMS; $sql = 'SELECT `products_description` FROM `products_description` WHERE 'products.products_id' = 'products_description.products_id''; $description_query = tep_db_query($sql); $description = mysql_fetch_array($description_query, MYSQL_ASSOC); $description['products_description'] = substr($description['products_description'], 0, 40); ?>> <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="<?php echo $ei_css_path; ?>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" align="left"><?php echo tep_image(DIR_WS_IMAGES . 'invoicelogo.gif'); ?></td> <td class="main"align="right" ><?php echo nl2br(STORE_NAME_ADDRESS); ?></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="dataTableHeadingRow" align="left"><b><?php echo TABLE_HEADING_COMMENTS; ?></b></td> <tr><?php echo tep_draw_form('status', FILENAME_ORDERS, tep_get_all_get_params(array('action')) . 'action=update_order'); ?> <td class="dataTableHeadingContent"><?php echo tep_draw_textarea_field('comments', 'soft', '60', '5'); ?></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 Product; ?></td> <td class="dataTableHeadingContent"><?php echo Item; ?></td> <td class="dataTableHeadingContent" align="right"><?php echo Description; ?></td> <td class="dataTableHeadingContent" align="right"><?php echo Unit_Price; ?></td> <td class="dataTableHeadingContent" align="right"><?php echo Total; ?></td> </tr> <?php for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) { echo ' <tr class="dataTableRow">' . "\n" . ' <td class="dataTableContent" valign="left" align="top">' . $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="left">' . $order->products[$i]['model'] . '</td>' . "\n"; echo ' <td class="dataTableContent" valign="left">' . $description['products_description'] . '</td>' . "\n"; // ' <td class="dataTableContent" valign="left">' . $products_description[$i]['pd.products_description'] . '</td>' . "\n"; echo ' <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']) 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">Total' . $order->totals[$i]['text'] . '</td>' . "\n" . ' </tr>' . "\n"; } ?> </table></td> </tr> </table></td> </tr> </table> <!-- body_text_eof //--> <br> </body> </html> help me please! thank you Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.