Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

gabbadude

Banned
  • Posts

    35
  • Joined

  • Last visited

Profile Information

  • Real Name
    No

gabbadude's Achievements

  1. Thank you so much, it's working now :)
  2. Ok, So I am sorry for being blind and being an idiot, but could I please ask you to repost the piece of code that I should change because I can't find where you specifically referred to me regarding my problem. All I can see is that you said you fixed my bug in v5.4 and then I said later that I would prefer to not start all over again. I am missing something. my apologies.
  3. OK, so i see u have integrated the 2 But I just need the code fixed. I dont want to have to start all over again! What piece of code can I change to fix my previous problem?? Pls help?!
  4. So if I understand the v5.4 correctly, then does this mean that you have integrated the Email_Invoice into your mod?? I have installed the mods seperately and from what I can see in your v5.4 it already caters for an email version. My apologies if it is a dumb question...
  5. Helloooo, The Cart is resetting perfectly now, thank you, but I have found that I am getting an error when I add comments to the fancy.php invoice template. I am getting the following error: Fatal error: Cannot instantiate non-existent class: objectinfo in /home/httpd/vhosts/proxemics.co.za/httpdocs/proxemics/includes/modules/templates/fancy.php on line 289 I am not sure where I am going wrong. Please help! The code of the fancy.php is the below code: <?php /* $Id: invoice.php,v v 4.0 2005/04/27 00:37:30 PopTheTop Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License */ ?> <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html <?php echo HTML_PARAMS; ?>> <head> <title><?php echo STORE_NAME; ?> <?php echo INVOICE_TEXT_INVOICE; ?> <?php echo INVOICE_TEXT_NUMBER_SIGN; ?><?php echo INVOICE_TEXT_CURRENT_YEAR; ?><?php echo INVOICE_TEXT_DASH; ?><?php echo $oID; ?></title> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>"> <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 align="left"><?php echo '<img src="' . INVOICE_IMAGE . '" width="' . INVOICE_IMAGE_WIDTH . '" height="' . INVOICE_IMAGE_HEIGHT . '" " alt="' . INVOICE_IMAGE_ALT_TEXT . '">'; ?></td> <TD ALIGN="right" VALIGN="top"><FONT FACE="Verdana" SIZE="2" COLOR="#006699"><strong><?php echo INVOICE_TEXT_INVOICE; ?> <?php echo INVOICE_TEXT_NUMBER_SIGN; ?> <?php echo INVOICE_TEXT_CURRENT_YEAR; ?><?php echo INVOICE_TEXT_DASH; ?> <?php echo $oID; ?><BR><?php echo $date; ?></strong></font></TD> </tr> <tr> <td colspan="2"> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <TD ALIGN="right" COLSPAN="2"><span class="pageHeadingSM"><FONT FACE="Verdana" SIZE="1" COLOR="#006699"><strong><?php echo nl2br(STORE_NAME_ADDRESS); ?></strong></font></span></TD> </tr> <tr> <TD> <table width="100%" border="0" cellspacing="0" cellpadding="2"> <tr> <td colspan="4"> <table width="100%" border="0" cellspacing="0" cellpadding="2"> <tr> <td width="10%"><hr size="2"></td> <td align="center" class="pageHeading"><em><b><?php echo INVOICE_TEXT_INVOICE; ?></b></em></td> <td width="100%"><hr size="2"></td> </tr> </table> </td> </tr> <tr> <td colspan="4"><?php echo tep_draw_separator('pixel_trans.gif', '100', '5'); ?></td> </tr> <tr> <td width="3"> </td> <td valign="top"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="11"><img src="<?php echo $ei_image_dir; ?>borders/maingrey_01.gif" width="11" height="16" alt=""></td> <td background="<?php echo $ei_image_dir; ?>borders/maingrey_02.gif"><img src="<?php echo $ei_image_dir; ?>borders/maingrey_02.gif" width="24" height="16" alt="" ></td> <td width="19"><img src="<?php echo $ei_image_dir; ?>borders/maingrey_03.gif" width="19" height="16" alt=""></td> </tr> <tr> <td background="<?php echo $ei_image_dir; ?>borders/maingrey_04.gif"><img src="<?php echo $ei_image_dir; ?>borders/maingrey_04.gif" width="11" height="21" alt=""></td> <td align="center" bgcolor="#F2F2F2"> <table width="100%" border="0" cellspacing="0" cellpadding="0" class="main"> <tr> <td align="left" valign="top"><b><?php echo ENTRY_SOLD_TO; ?></b></td> </tr> <tr> <td> <?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td> </tr> <tr> <td> <?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', '10'); ?></td> </tr> <tr> <td> <?php echo $order->customer['telephone']; ?></td> </tr> <tr> <td> <?php echo $order->customer['email_address']; ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '7'); ?></td> </tr> </table> </td> <td background="<?php echo $ei_image_dir; ?>borders/maingrey_06.gif"><img src="<?php echo $ei_image_dir; ?>borders/maingrey_06.gif" width="19" height="21" alt=""></td> </tr> <tr> <td><img src="<?php echo $ei_image_dir; ?>borders/maingrey_07.gif" width="11" height="18" alt=""></td> <td background="<?php echo $ei_image_dir; ?>borders/maingrey_08.gif"><img src="<?php echo $ei_image_dir; ?>borders/maingrey_08.gif" width="24" height="18" alt=""></td> <td><img src="<?php echo $ei_image_dir; ?>borders/maingrey_09.gif" width="19" height="18" alt=""></td> </tr> </table> </td> <td width="45"> </td> <td valign="top"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="11"><img src="<?php echo $ei_image_dir; ?>borders/mainwhite_01.gif" width="11" height="16" alt=""></td> <td background="<?php echo $ei_image_dir; ?>borders/mainwhite_02.gif"><img src="<?php echo $ei_image_dir; ?>borders/mainwhite_02.gif" width="24" height="16" alt=""></td> <td width="19"><img src="<?php echo $ei_image_dir; ?>borders/mainwhite_03.gif" width="19" height="16" alt=""></td> </tr> <tr> <td background="<?php echo $ei_image_dir; ?>borders/mainwhite_04.gif"><img src="<?php echo $ei_image_dir; ?>borders/mainwhite_04.gif" width="11" height="21" alt=""></td> <td align="center" bgcolor="#FFFFFF"> <table width="100%" border="0" cellpadding="0" cellspacing="0" class="main"> <tr> <td align="left" valign="top"><b><?php echo ENTRY_SHIP_TO; ?></b></td> </tr> <tr> <td> <?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td> </tr> <tr> <td> <?php echo tep_address_format($order->delivery['format_id'], $order->delivery, 1, '', '<br> '); ?></td> </tr> <tr> <td> <?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '7'); ?></td> </tr> </table> </td> <td background="<?php echo $ei_image_dir; ?>borders/mainwhite_06.gif"><img src="<?php echo $ei_image_dir; ?>borders/mainwhite_06.gif" width="19" height="21" alt=""></td> </tr> <tr> <td><img src="<?php echo $ei_image_dir; ?>borders/mainwhite_07.gif" width="11" height="18" alt=""></td> <td background="<?php echo $ei_image_dir; ?>borders/mainwhite_08.gif"><img src="<?php echo $ei_image_dir; ?>borders/mainwhite_08.gif" width="24" height="18" alt=""></td> <td><img src="<?php echo $ei_image_dir; ?>borders/mainwhite_09.gif" width="19" height="18" alt=""></td> </tr> </table> </td> </tr> </table> </TD> </tr> <tr> <TD COLSPAN="2"><?php echo tep_draw_separator('pixel_trans.gif', '100', '15'); ?></td> </tr> <tr> <TD COLSPAN="2"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="9"> </td> <td> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="11"><img src="<?php echo $ei_image_dir; ?>borders/maingrey_01.gif" width="11" height="16" alt=""></td> <td background="<?php echo $ei_image_dir; ?>borders/maingrey_02.gif"><img src="<?php echo $ei_image_dir; ?>borders/maingrey_02.gif" width="24" height="16" alt="" ></td> <td width="19"><img src="<?php echo $ei_image_dir; ?>borders/maingrey_03.gif" width="19" height="16" alt=""></td> </tr> <tr> <td background="<?php echo $ei_image_dir; ?>borders/maingrey_04.gif"><img src="<?php echo $ei_image_dir; ?>borders/maingrey_04.gif" width="11" height="21" alt=""></td> <td align="center" bgcolor="#F2F2F2"> <table width="100%" border="0" cellpadding="0" cellspacing="0" class="main"> <tr> <td width="33%"> <b><?php echo INVOICE_TEXT_ORDER; ?> <?php echo INVOICE_TEXT_NUMBER_SIGN; ?><?php echo INVOICE_TEXT_COLON; ?></b> <?php echo tep_db_input($oID); ?></td> <td width="33%"> <b><?php echo INVOICE_TEXT_DATE_OF_ORDER; ?><?php echo INVOICE_TEXT_COLON; ?> </b><?php echo tep_date_short($order->info['date_purchased']); ?></td> <?php if (tep_not_null($order->info['cc_number'])) { $cc_card_number_less_middle_digits = substr($order->info['cc_number'], 0, 4) . str_repeat('x', (strlen($order->info['cc_number']) - 8)) . substr($order->info['cc_number'], -4); ?> <td> <b><?php echo ENTRY_PAYMENT_METHOD; ?></b> <?php echo $order->info['payment_method']; ?> (<?php echo $order->info['cc_type']; ?>)<br><?php echo tep_draw_separator('pixel_trans.gif', '100%', '6'); ?><br> <b><?php echo ENTRY_PAYMENT_CC_NUMBER; ?></b> <?php echo $cc_card_number_less_middle_digits; ?></td> <?php } else { ?> <td> <b><?php echo ENTRY_PAYMENT_METHOD; ?></b> <?php echo $order->info['payment_method']; ?></td> <?php } ?> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '7'); ?></td> </tr> </table> </td> <td background="<?php echo $ei_image_dir; ?>borders/maingrey_06.gif"><img src="<?php echo $ei_image_dir; ?>borders/maingrey_06.gif" width="19" height="21" alt=""></td> </tr> <tr> <td><img src="<?php echo $ei_image_dir; ?>borders/maingrey_07.gif" width="11" height="18" alt=""></td> <td background="<?php echo $ei_image_dir; ?>borders/maingrey_08.gif"><img src="<?php echo $ei_image_dir; ?>borders/maingrey_08.gif" width="24" height="18" alt=""></td> <td><img src="<?php echo $ei_image_dir; ?>borders/maingrey_09.gif" width="19" height="18" alt=""></td> </tr> </table> </td> </tr> </table> </td> </tr> <tr> <TD COLSPAN="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '15'); ?></td> </tr> <tr> <TD COLSPAN="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <tr> <TD COLSPAN="2"> <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> <!-- ORDER COMMENTS CODE STARTS HERE //--> <div id="comments_open" style="position: relative;"> <?php $orders_status_history_query = tep_db_query("select * from " . TABLE_ORDERS_STATUS_HISTORY . " where orders_id = '" . tep_db_input($oID) . "' order by date_added"); if (tep_db_num_rows($orders_status_history_query)) { $has_comments = false; ?> <br><br> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="9"> </td> <td><table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr><td width="11"><img src="<?php echo $ei_image_dir; ?>borders/maingrey_01.gif" width="11" height="16" alt=""></td> <td background="<?php echo $ei_image_dir; ?>borders/maingrey_02.gif"><img src="<?php echo $ei_image_dir; ?>borders/maingrey_02.gif" width="24" height="16" alt="" ></td> <td width="19"><img src="<?php echo $ei_image_dir; ?>borders/maingrey_03.gif" width="19" height="16" alt=""></td> </tr> <tr><td background="<?php echo $ei_image_dir; ?>borders/maingrey_04.gif"><img src="<?php echo $ei_image_dir; ?>borders/maingrey_04.gif" width="11" height="21" alt=""></td> <td align="center" bgcolor="#F2F2F2"> <table width="100%" border="0" cellpadding="0" cellspacing="0" class="main"> <tr> <td width="95%"> <b><?php echo TABLE_HEADING_COMMENTS; ?></b><br><br></td></tr> <?php while ($orders_comments = tep_db_fetch_array($orders_status_history_query)) { if (tep_not_null($orders_comments['comments'])) { $has_comments = true; // Not Null = Has Comments if (tep_not_null($orders_comments['comments'])) { $sInfo = new objectInfo($orders_comments); ?> <tr> <td align="center" width="95%"> <table width="95%" border="0" cellpadding="0" cellspacing="0"><tr> <td width="95%" class="smallText"> <table width="100%" border="0" cellpadding="0" cellspacing="0" class="main"> <tr> <td width="150" align="left" valign="top" class="smallText"><strong><u><?php echo TABLE_HEADING_DATE_ADDED; ?></u></strong></td> <td align="left" valign="top" class="smallText"><strong><u><?php echo TABLE_HEADING_COMMENT_LEFT; ?></u></strong></td> </tr> </table> </td> </tr> </table> </td> </tr> <tr> <td align="center" width="95%"> <table width="95%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="95%" class="smallText"> <table width="100%" border="0" cellpadding="0" cellspacing="0" class="main"> <tr> <td width="150" align="left" valign="top" class="smallText"><?php echo tep_date_short($sInfo->date_added); ?></td> <td align="left" valign="top" class="smallText"><?php echo nl2br(tep_db_output($orders_comments['comments'])); ?><br><br></td> </tr> </table></td> </tr></table></td></tr> <?php } } } if ($has_comments == false) { ?> <tr> <td align="center" width="95%"> <table width="95%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="95%" class="smallText"> <table width="100%" border="0" cellpadding="0" cellspacing="0" class="main"> <tr> <td width="100%" align="left" valign="top" class="smallText"><?php echo INVOICE_TEXT_NO_COMMENT; ?></td> </tr> </table> </td> </tr> </table> </td> </tr> <?php } ?> <tr><td><?php echo tep_draw_separator('pixel_trans.gif', '1', '7'); ?></td> </tr> </table> </td> <td background="<?php echo $ei_image_dir; ?>borders/maingrey_06.gif"><img src="<?php echo $ei_image_dir; ?>borders/maingrey_06.gif" width="19" height="21" alt=""></td> </tr> <tr> <td><img src="<?php echo $ei_image_dir; ?>borders/maingrey_07.gif" width="11" height="18" alt=""></td> <td background="<?php echo $ei_image_dir; ?>borders/maingrey_08.gif"><img src="<?php echo $ei_image_dir; ?>borders/maingrey_08.gif" width="24" height="18" alt=""></td> <td><img src="<?php echo $ei_image_dir; ?>borders/maingrey_09.gif" width="19" height="18" alt=""></td> </tr> </table> </td> </tr> </table> <?php } ?> <!-- ORDER COMMENTS CODE ENDS HERE //--> </div> <br> <CENTER><span class="smallText"><FONT FACE="Verdana" COLOR="#006699"><strong><?php echo INVOICE_TEXT_THANK_YOU; ?><BR><?php echo STORE_NAME; ?><BR><?php echo STORE_URL_ADDRESS; ?></strong></font></span></CENTER> <!-- body_text_eof //--> </body> </html>
  6. Thanks so much RG, I havent tried it yet as I havent had a chance but as soon as I do I will let you know. My apologies if I was pushy, didn't realise I was being that way. Thank you for the mod. -gabbadude
  7. Here is the code for the checkout_process.php file. At the bottom, the code exists for the cart to be reset but it never does get reset! Can someone please help. This has only started happening since I installed the Email_Invoice v1.0 Mod. <?php /* $Id: checkout_process.php,v 1.128 2003/05/28 18:00:29 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License */ include('includes/application_top.php'); // if the customer is not logged on, redirect them to the login page if (!tep_session_is_registered('customer_id')) { $navigation->set_snapshot(array('mode' => 'SSL', 'page' => FILENAME_CHECKOUT_PAYMENT)); tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); } if (!tep_session_is_registered('sendto')) { tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL')); } if ( (tep_not_null(MODULE_PAYMENT_INSTALLED)) && (!tep_session_is_registered('payment')) ) { tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL')); } // avoid hack attempts during the checkout procedure by checking the internal cartID if (isset($cart->cartID) && tep_session_is_registered('cartID')) { if ($cart->cartID != $cartID) { tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); } } include(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_PROCESS); // load selected payment module require(DIR_WS_CLASSES . 'payment.php'); $payment_modules = new payment($payment); // load the selected shipping module require(DIR_WS_CLASSES . 'shipping.php'); $shipping_modules = new shipping($shipping); require(DIR_WS_CLASSES . 'order.php'); $order = new order; // load the before_process function from the payment modules $payment_modules->before_process(); require(DIR_WS_CLASSES . 'order_total.php'); $order_total_modules = new order_total; $order_totals = $order_total_modules->process(); $sql_data_array = array('customers_id' => $customer_id, 'customers_name' => $order->customer['firstname'] . ' ' . $order->customer['lastname'], 'customers_company' => $order->customer['company'], 'customers_street_address' => $order->customer['street_address'], 'customers_suburb' => $order->customer['suburb'], 'customers_city' => $order->customer['city'], 'customers_postcode' => $order->customer['postcode'], 'customers_state' => $order->customer['state'], 'customers_country' => $order->customer['country']['title'], 'customers_telephone' => $order->customer['telephone'], 'customers_email_address' => $order->customer['email_address'], 'customers_address_format_id' => $order->customer['format_id'], 'delivery_name' => $order->delivery['firstname'] . ' ' . $order->delivery['lastname'], 'delivery_company' => $order->delivery['company'], 'delivery_street_address' => $order->delivery['street_address'], 'delivery_suburb' => $order->delivery['suburb'], 'delivery_city' => $order->delivery['city'], 'delivery_postcode' => $order->delivery['postcode'], 'delivery_state' => $order->delivery['state'], 'delivery_country' => $order->delivery['country']['title'], 'delivery_address_format_id' => $order->delivery['format_id'], 'billing_name' => $order->billing['firstname'] . ' ' . $order->billing['lastname'], 'billing_company' => $order->billing['company'], 'billing_street_address' => $order->billing['street_address'], 'billing_suburb' => $order->billing['suburb'], 'billing_city' => $order->billing['city'], 'billing_postcode' => $order->billing['postcode'], 'billing_state' => $order->billing['state'], 'billing_country' => $order->billing['country']['title'], 'billing_address_format_id' => $order->billing['format_id'], 'payment_method' => $order->info['payment_method'], 'cc_type' => $order->info['cc_type'], 'cc_owner' => $order->info['cc_owner'], 'cc_number' => $order->info['cc_number'], 'cc_expires' => $order->info['cc_expires'], 'date_purchased' => 'now()', 'orders_status' => $order->info['order_status'], 'currency' => $order->info['currency'], 'currency_value' => $order->info['currency_value']); tep_db_perform(TABLE_ORDERS, $sql_data_array); $insert_id = tep_db_insert_id(); for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) { $sql_data_array = array('orders_id' => $insert_id, 'title' => $order_totals[$i]['title'], 'text' => $order_totals[$i]['text'], 'value' => $order_totals[$i]['value'], 'class' => $order_totals[$i]['code'], 'sort_order' => $order_totals[$i]['sort_order']); tep_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array); } $customer_notification = (SEND_EMAILS == 'true') ? '1' : '0'; $sql_data_array = array('orders_id' => $insert_id, 'orders_status_id' => $order->info['order_status'], 'date_added' => 'now()', 'customer_notified' => $customer_notification, 'comments' => $order->info['comments']); tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array); // initialized for the email confirmation $products_ordered = ''; $subtotal = 0; $total_tax = 0; for ($i=0, $n=sizeof($order->products); $i<$n; $i++) { // Stock Update - Joao Correia if (STOCK_LIMITED == 'true') { if (DOWNLOAD_ENABLED == 'true') { $stock_query_raw = "SELECT products_quantity, pad.products_attributes_filename FROM " . TABLE_PRODUCTS . " p LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES . " pa ON p.products_id=pa.products_id LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad ON pa.products_attributes_id=pad.products_attributes_id WHERE p.products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"; // Will work with only one option for downloadable products // otherwise, we have to build the query dynamically with a loop $products_attributes = $order->products[$i]['attributes']; if (is_array($products_attributes)) { $stock_query_raw .= " AND pa.options_id = '" . $products_attributes[0]['option_id'] . "' AND pa.options_values_id = '" . $products_attributes[0]['value_id'] . "'"; } $stock_query = tep_db_query($stock_query_raw); } else { $stock_query = tep_db_query("select products_quantity from " . TABLE_PRODUCTS . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); } if (tep_db_num_rows($stock_query) > 0) { $stock_values = tep_db_fetch_array($stock_query); // do not decrement quantities if products_attributes_filename exists if ((DOWNLOAD_ENABLED != 'true') || (!$stock_values['products_attributes_filename'])) { $stock_left = $stock_values['products_quantity'] - $order->products[$i]['qty']; } else { $stock_left = $stock_values['products_quantity']; } tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity = '" . $stock_left . "' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); if ( ($stock_left < 1) && (STOCK_ALLOW_CHECKOUT == 'false') ) { tep_db_query("update " . TABLE_PRODUCTS . " set products_status = '0' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); } } } // Update products_ordered (for bestsellers list) tep_db_query("update " . TABLE_PRODUCTS . " set products_ordered = products_ordered + " . sprintf('%d', $order->products[$i]['qty']) . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); $sql_data_array = array('orders_id' => $insert_id, 'products_id' => tep_get_prid($order->products[$i]['id']), 'products_model' => $order->products[$i]['model'], 'products_name' => $order->products[$i]['name'], 'products_price' => $order->products[$i]['price'], 'final_price' => $order->products[$i]['final_price'], 'products_tax' => $order->products[$i]['tax'], 'products_quantity' => $order->products[$i]['qty']); tep_db_perform(TABLE_ORDERS_PRODUCTS, $sql_data_array); $order_products_id = tep_db_insert_id(); //------insert customer choosen option to order-------- $attributes_exist = '0'; $products_ordered_attributes = ''; if (isset($order->products[$i]['attributes'])) { $attributes_exist = '1'; for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) { if (DOWNLOAD_ENABLED == 'true') { $attributes_query = "select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix, pad.products_attributes_maxdays, pad.products_attributes_maxcount , pad.products_attributes_filename from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa left join " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad on pa.products_attributes_id=pad.products_attributes_id where pa.products_id = '" . $order->products[$i]['id'] . "' and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . $languages_id . "' and poval.language_id = '" . $languages_id . "'"; $attributes = tep_db_query($attributes_query); } else { $attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . $order->products[$i]['id'] . "' and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . $languages_id . "' and poval.language_id = '" . $languages_id . "'"); } $attributes_values = tep_db_fetch_array($attributes); $sql_data_array = array('orders_id' => $insert_id, 'orders_products_id' => $order_products_id, 'products_options' => $attributes_values['products_options_name'], 'products_options_values' => $attributes_values['products_options_values_name'], 'options_values_price' => $attributes_values['options_values_price'], 'price_prefix' => $attributes_values['price_prefix']); tep_db_perform(TABLE_ORDERS_PRODUCTS_ATTRIBUTES, $sql_data_array); if ((DOWNLOAD_ENABLED == 'true') && isset($attributes_values['products_attributes_filename']) && tep_not_null($attributes_values['products_attributes_filename'])) { $sql_data_array = array('orders_id' => $insert_id, 'orders_products_id' => $order_products_id, 'orders_products_filename' => $attributes_values['products_attributes_filename'], 'download_maxdays' => $attributes_values['products_attributes_maxdays'], 'download_count' => $attributes_values['products_attributes_maxcount']); tep_db_perform(TABLE_ORDERS_PRODUCTS_DOWNLOAD, $sql_data_array); } $products_ordered_attributes .= "\n\t" . $attributes_values['products_options_name'] . ' ' . $attributes_values['products_options_values_name']; } } //------insert customer choosen option eof ---- $total_weight += ($order->products[$i]['qty'] * $order->products[$i]['weight']); $total_tax += tep_calculate_tax($total_products_price, $products_tax) * $order->products[$i]['qty']; $total_cost += $total_products_price; $products_ordered .= $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' (' . $order->products[$i]['model'] . ') = ' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . $products_ordered_attributes . "\n"; } // lets start with the email confirmation /****************************************************** * Email Invoice 1.0. * Author Contact: [email protected] ******************************************************/ if (EMAIL_INVOICE == 'true') { require(DIR_WS_MODULES . EMAIL_INVOICE_DIR . FILENAME_EMAIL_INVOICE); } else { /**** End of Email Invoice Mod Snippet ****/ /*========================================*/ $email_order = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $insert_id . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $insert_id, 'SSL', false) . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n\n"; if ($order->info['comments']) { $email_order .= tep_db_output($order->info['comments']) . "\n\n"; } $email_order .= EMAIL_TEXT_PRODUCTS . "\n" . EMAIL_SEPARATOR . "\n" . $products_ordered . EMAIL_SEPARATOR . "\n"; for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) { $email_order .= strip_tags($order_totals[$i]['title']) . ' ' . strip_tags($order_totals[$i]['text']) . "\n"; } if ($order->content_type != 'virtual') { $email_order .= "\n" . EMAIL_TEXT_DELIVERY_ADDRESS . "\n" . EMAIL_SEPARATOR . "\n" . tep_address_label($customer_id, $sendto, 0, '', "\n") . "\n"; } $email_order .= "\n" . EMAIL_TEXT_BILLING_ADDRESS . "\n" . EMAIL_SEPARATOR . "\n" . tep_address_label($customer_id, $billto, 0, '', "\n") . "\n\n"; if (is_object($$payment)) { $email_order .= EMAIL_TEXT_PAYMENT_METHOD . "\n" . EMAIL_SEPARATOR . "\n"; $payment_class = $$payment; $email_order .= $payment_class->title . "\n\n"; if ($payment_class->email_footer) { $email_order .= $payment_class->email_footer . "\n\n"; } } /*=======================================================================*/ /**** Email Invoice Mod Snippet ****/ } /**** End of Email Invoice Mod Snippet ****/ /*=======================================================================*/ tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); // send emails to other people if (SEND_EXTRA_ORDER_EMAILS_TO != '') { tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); } // load the after_process function from the payment modules $payment_modules->after_process(); $cart->reset(true); // unregister session variables used during checkout tep_session_unregister('sendto'); tep_session_unregister('billto'); tep_session_unregister('shipping'); tep_session_unregister('payment'); tep_session_unregister('comments'); tep_redirect(tep_href_link(FILENAME_CHECKOUT_SUCCESS, '', 'SSL')); require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> Thanks in advance... -gabbadude
  8. Thanks but why would removing the absolute path fix the problem with the cart not being reset?? I mentioned in the previous post that I had solved the location problem! -gabbadude
  9. I fixed my problem. I removed the email_invoice/ in the configure.php file and it worked fine. I have found though that since I put the mod in whenever I click on the 'confirm order' button, the cart is not being reset!!! Can anyone add some info on this? -gabbadude
  10. I followed the installation process to the "T". I even double checked the installation processes and changes I made. I seem to be getting the below error: Warning: main(includes/modules/email_invoice/email_invoice.php): failed to open stream: No such file or directory in /home/httpd/vhosts/<web_url>/httpdocs/catalog/checkout_process.php on line 231 This is where the module is looking for the invoice.php file in the templates directory but it is not finding it. Fatal error: main(): Failed opening required 'includes/modules/email_invoice/email_invoice.php' (include_path='.:/usr/share/pear') in /home/httpd/vhosts/<web_url>/httpdocs/catalog/checkout_process.php on line 231 The above highlighted in red is the incorrect location. Why would it be pointing to that location?? the email_invoice folder doesn't exist... -gabbadude
  11. On the click of the button, the margins have not been set at all. Maybe I am missing something but I print to a network printer and if I remove it and re-install it and use the default settings, it still does the same. Anyway... Probably usefless info. Thanks
  12. What version did you download?? You need to download v3.2. It has the 2 missing files that are needed. -gabbadude
  13. Thank you. My print feature now works perfectly. I did notice though that the Store address is aligned to the right which then get's cut off when printing so I had to align it to the left instead. It's fine that it is to the left but I thought you should know. -gabbadude.
  14. Gr8 Mod. I love it... :thumbsup: But the Print invoice is not working. I think a file is missing from your mod. :blink: includes/print_header.php. I get this error message: Warning: main(includes/print_header.php): failed to open stream: No such file or directory in C:\Program Files\Apache Group\Apache2\htdocs\proxemics\print_my_invoice.php on line 49 Fatal error: main(): Failed opening required 'includes/print_header.php' (include_path='.;c:\php4\pear') in C:\Program Files\Apache Group\Apache2\htdocs\proxemics\print_my_invoice.php on line 49 :'( I checked for the file in my directories and found nothing. I also check in the original osCommerce directory in case I missed a file or something and I found nothing. It is also not added in your mod download. Is there something I have missed? :blush: -gabbadude
×
×
  • Create New...