gabbadude Posted May 5, 2005 Share Posted May 5, 2005 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 Quote Link to comment Share on other sites More sharing options...
saborchulo Posted May 5, 2005 Share Posted May 5, 2005 Gabbadude, I ask that you please be patient, I am in the process of finalizing an update that will address your concerns, and some other polishing that I have completed since this contribution was submitted. It won't be much longer. Quote Link to comment Share on other sites More sharing options...
saborchulo Posted May 6, 2005 Share Posted May 6, 2005 @Gabbadude and everyone else, the update had been loaded! This resolves the issues with the shopping cart not resetting after the email has been sent. Sending a mulitpart email to support both HTML and plain text email clients. Also a much easier to follow HTML installation file. Quote Link to comment Share on other sites More sharing options...
thebizzboy Posted May 6, 2005 Share Posted May 6, 2005 @ Bizz It gets harder to troubleshoot the situation when you have different contributions installed. What are the specific module names, perhaps I can write a seperate version to compensate for what the other modules may be modifying. <{POST_SNAPBACK}> STILL NEED HELP WITH THE TOP I THOUGHT I COULD FIGURE IT OUT BUT NEED SOME HELP I HAVE PURCHASE WITHOUT AN ACCOUNT AND PAYPAL IPN INSTALLED EMAIL ME AT [email protected] Quote Link to comment Share on other sites More sharing options...
thebizzboy Posted May 6, 2005 Share Posted May 6, 2005 STILL NEED HELP WITH THE TOPI THOUGHT I COULD FIGURE IT OUT BUT NEED SOME HELP I HAVE PURCHASE WITHOUT AN ACCOUNT AND PAYPAL IPN INSTALLED EMAIL ME AT [email protected] <{POST_SNAPBACK}> I believe this maybe the code that we have to change inorder for it to work this is found in catalog/includes/modules/payment/paypal/classes/osC/Order.class.php this is similar code that matched with checkout proccess...so im guessing this maybe the key but i couldnt figure out how to get the emails to show in the template format....i tried making changes just like the checkout process but it didnt work...any help please // lets start with the email confirmation include($this->checkoutProcessLanguageFile); <<<<<<<<<<<<< $email_order = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $this->orderID . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . $this->accountHistoryInfoURL . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n\n"; Quote Link to comment Share on other sites More sharing options...
gabbadude Posted May 6, 2005 Share Posted May 6, 2005 STILL NEED HELP WITH THE TOPI THOUGHT I COULD FIGURE IT OUT BUT NEED SOME HELP I HAVE PURCHASE WITHOUT AN ACCOUNT AND PAYPAL IPN INSTALLED EMAIL ME AT [email protected] <{POST_SNAPBACK}> 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 Quote Link to comment Share on other sites More sharing options...
webxpres Posted May 7, 2005 Share Posted May 7, 2005 (edited) I installed this contribution, and find one problem. When enabled HTML via admin, not send user comments! :'( I used : invoice.php template Please can somebody help me? peter Edited May 7, 2005 by webxpres Quote Link to comment Share on other sites More sharing options...
PopTheTop Posted May 8, 2005 Share Posted May 8, 2005 I installed this contribution, and find one problem.When enabled HTML via admin, not send user comments! :'( I used : invoice.php template Please can somebody help me? peter <{POST_SNAPBACK}> Comments were not added to that template, you need to use the other template of you want the order comments. Quote L8r, PopTheTop Published osC Contributions: - eCheck Payment Module v3.1 - Reviews in Product Display v2.0 - Fancier Invoice & Packingslip v6.1 - Admin Notes / Customer Notes v2.2 - Customer Zip & State Validation v2.2 - Search Box with Dropdown Category Menu v1.0 Pop your camper's top today! It's a popup thing... You wouldn't understand Link to comment Share on other sites More sharing options...
PopTheTop Posted May 8, 2005 Share Posted May 8, 2005 I have a problem and a small fix... To do a quick update, just add the following at the top of includes/modules/email_invoice/templates/fancy.php or includes/modules/email_invoice/templates/html_invoice.php (depending on the file you actually have) // class constructor function objectInfo($object_array) { reset($object_array); while (list($key, $value) = each($object_array)) { $this->$key = tep_db_prepare_input($value); } } } Just above: ?> <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html <?php echo HTML_PARAMS; ?>> This should fix that error you get when you checkout and have comments. Now for the problem... I have installed your latest update and the cart will not reset and clear at checkout. I can not find what is causing the shopping cart to not clear and reset itself at checkout. I think I have checkout_process.php modified correctly, if you look at the bottom of tat file, you can see where it resets the shopping carts, but it is not working. Does anyone have any clues here? This is my checkout_process.php file: <?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 (c) 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'); if ($credit_covers) $payment=''; //ICW added for CREDIT CLASS $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_street_address2' => $order->customer['street_address2'], '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_street_address2' => $order->delivery['street_address2'], '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_street_address2' => $order->billing['street_address2'], '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'], 'cvvnumber' => $order->info['cvvnumber'], 'accountholder' => $order->info['accountholder'], 'address' => $order->info['address'], 'address2' => $order->info['address2'], 'phone' => $order->info['phone'], 'bank' => $order->info['bank'], 'bankcity' => $order->info['bankcity'], 'bankphone' => $order->info['bankphone'], 'checknumber' => $order->info['checknumber'], 'accountnumber' => $order->info['accountnumber'], 'routingnumber' => $order->info['routingnumber'], 'date_purchased' => 'now()', 'orders_status' => $order->info['order_status'], 'currency' => $order->info['currency'], 'currency_value' => $order->info['currency_value'], 'customers_referer_url' => $referer_url); 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'], 'backorders' => $order->info['backorders']); 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']; // Version: 02-20-04 (BOF) 02/20/2004 - Low Stock Level Email Author: Emmett (yesUdo.com) and Jai (kynet.co.uk) $warning_stock = STOCK_REORDER_LEVEL; $current_stock = $stock_left; // Jai @ kynet.co.uk made the following change on 20-02-04 // Dynamic store url - Replaced [' http://www.YOURDOMAIN.com/] with [. HTTP_SERVER . DIR_WS_CATALOG . '] $low_stock_email = '<b>Low stock warning:</b> ' . $order->products[$i]['name'] . "\n" . '<b>Model #:</b> ' . $order->products[$i]['model'] . "\n" . '<b>Quantity left:</b> ' . $stock_left . "\n" . '<b>Product URL:</b> ' . HTTP_SERVER . DIR_WS_CATALOG . 'product_info.php?products_id='. $order->products[$i]['id'] . "\n\n" . '<b>Current low order limit is set at: ' . $warning_stock . ' units</b>'; $low_stock_subject = 'Low Stock Warning: ' . $order->products[$i]['name']; if ($current_stock <= $warning_stock) { tep_mail(STORE_OWNER_EMAILS_FROM_NAME, STORE_OWNER_EMAIL_ADDRESS, $low_stock_subject, $low_stock_email, STORE_OWNER_EMAILS_FROM_NAME, STORE_OWNER_EMAIL_ADDRESS); } // (EOF) 02/20/2004 - Low Stock Level Email Author: Emmett (yesUdo.com) and Jai (kynet.co.uk) } 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(); $order_total_modules->update_credit_account($i);//ICW ADDED FOR CREDIT CLASS SYSTEM //begin add receipt// tep_session_register('last_order'); $last_order = $insert_id; $oID = $last_order; //end add receipt// //------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); //clr 030714 update insert query. changing to use values form $order->products for products_options_values. $sql_data_array = array('orders_id' => $insert_id, 'orders_products_id' => $order_products_id, 'products_options' => $attributes_values['products_options_name'], 'products_options_values' => $order->products[$i]['attributes'][$j]['value'], '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); } //clr 030714 changing to use values from $orders->products and adding call to tep_decode_specialchars() $products_ordered_attributes .= "\n\t" . $attributes_values['products_options_name'] . ': ' . tep_decode_specialchars($order->products[$i]['attributes'][$j]['value']); } } //------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"; // BEGIN POPTHETOP AUCTION PAYMENT MOD // Delete the new payment descriptions from the following database tables during the checkout // process so that the database will not get loaded down with useless information. // ... DELETED TABLES ... // TABLE_PRODUCTS_OPTIONS_VALUES // TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS // TABLE_PRODUCTS_ATTRIBUTES if (ereg('^AUCTION',$order->products[$i]['model'])) { //added if... for auction payments tep_db_query("delete from ".TABLE_PRODUCTS_ATTRIBUTES." where options_values_id = '".(int)$order->products[$i]['attributes'][0]['value_id']."'"); tep_db_query("delete from ".TABLE_PRODUCTS_OPTIONS_VALUES." where products_options_values_id = '".(int)$order->products[$i]['attributes'][0]['value_id']."'"); tep_db_query("delete from ".TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS." where products_options_values_id = '".(int)$order->products[$i]['attributes'][0]['value_id']."'"); } if (ereg('^PAYMENT',$order->products[$i]['model'])) { //added if... for misc payments tep_db_query("delete from ".TABLE_PRODUCTS_ATTRIBUTES." where options_values_id = '".(int)$order->products[$i]['attributes'][0]['value_id']."'"); tep_db_query("delete from ".TABLE_PRODUCTS_OPTIONS_VALUES." where products_options_values_id = '".(int)$order->products[$i]['attributes'][0]['value_id']."'"); tep_db_query("delete from ".TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS." where products_options_values_id = '".(int)$order->products[$i]['attributes'][0]['value_id']."'"); } // END POPTHETOP AUCTION PAYMENT MOD } $order_total_modules->apply_credit();//ICW ADDED FOR CREDIT CLASS SYSTEM // lets start with the email confirmation // START HTML Invoice if (EMAIL_INVOICE == 'true') { require(DIR_WS_MODULES . EMAIL_INVOICE_DIR . FILENAME_EMAIL_INVOICE); } else { // END HTML Invoice $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_SEPARATOR . "\n" . EMAIL_TEXT_BACKORDERS . "\n\n" . tep_db_output($order->info['backorders']) . "\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"; } } tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT . ' #' . $insert_id, $email_order, STORE_OWNER_EMAILS_FROM_NAME, STORE_OWNER_EMAIL_ADDRESS, ''); // send emails to other people if (SEND_EXTRA_ORDER_EMAILS_TO != '') { tep_mail(STORE_OWNER_EMAILS_FROM_NAME, SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT . ' #' . $insert_id, $email_order, $order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], ''); } // START HTML Invoice } // END HTML Invoice // Include OSC-AFFILIATE require(DIR_WS_INCLUDES . 'affiliate_checkout_process.php'); // 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_session_unregister('backorders'); if(tep_session_is_registered('credit_covers')) tep_session_unregister('credit_covers'); $order_total_modules->clear_posts();//ICW ADDED FOR CREDIT CLASS SYSTEM tep_redirect(tep_href_link(FILENAME_CHECKOUT_SUCCESS, '', 'SSL')); require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> Quote L8r, PopTheTop Published osC Contributions: - eCheck Payment Module v3.1 - Reviews in Product Display v2.0 - Fancier Invoice & Packingslip v6.1 - Admin Notes / Customer Notes v2.2 - Customer Zip & State Validation v2.2 - Search Box with Dropdown Category Menu v1.0 Pop your camper's top today! It's a popup thing... You wouldn't understand Link to comment Share on other sites More sharing options...
PopTheTop Posted May 8, 2005 Share Posted May 8, 2005 (edited) This is a quick fix and I do not know if it is the correct one or not, BUT... It works... I opened checkout_success.php and added this to the top: ?$cart->reset(true); Just above: ?> <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> I still do not know why $cart->reset(true); does not work in checkout_process.php any longer. Anyone??? Edited May 8, 2005 by PopTheTop Quote L8r, PopTheTop Published osC Contributions: - eCheck Payment Module v3.1 - Reviews in Product Display v2.0 - Fancier Invoice & Packingslip v6.1 - Admin Notes / Customer Notes v2.2 - Customer Zip & State Validation v2.2 - Search Box with Dropdown Category Menu v1.0 Pop your camper's top today! It's a popup thing... You wouldn't understand Link to comment Share on other sites More sharing options...
saborchulo Posted May 9, 2005 Share Posted May 9, 2005 (edited) PoptheTop I fixed this in my last update of this mod. What was causing this was the require(DIR_WS_INCLUDES . 'application_bottom.php'); at the bottom of the php template files, so that way it uses the inclusion that is defined in the checkout_process.php file. After removing this bit of code at the bottom and thoroughly placing test orders, the cart was deleted after each order was confirmed on a clean installation of OSC2.2-MS2. To everyone installing the latest update, I would recommend doing it from scratch, if you had a previous version. Pop I know you have a more custom version and I think I saw on another thread that you solved it. Edited May 9, 2005 by saborchulo Quote Link to comment Share on other sites More sharing options...
PopTheTop Posted May 9, 2005 Share Posted May 9, 2005 PoptheTop I fixed this in my last update of this mod.What was causing this was the at the bottom of the php template files, so that way it uses the inclusion that is defined in the checkout_process.php file. After removing this bit of code at the bottom and thoroughly placing test orders, the cart was deleted after each order was confirmed on a clean installation of OSC2.2-MS2. To everyone installing the latest update, I would recommend doing it from scratch, if you had a previous version. Pop I know you have a more custom version and I think I saw on another thread that you solved it. <{POST_SNAPBACK}> Thanks, I had it removed and then added it back in and then removed it. I have it removed for good now. You should come over to http://www.oscommerce.com/forums/index.php?showtopic=132562 and read through the problems others are having with PayPal IPN, STS, AuthorizeNET and so on about printing blank checkout_success.php screens and blank HTML e-mailed invoices. The last 2 pages are full. This may have that fixed now. Quote L8r, PopTheTop Published osC Contributions: - eCheck Payment Module v3.1 - Reviews in Product Display v2.0 - Fancier Invoice & Packingslip v6.1 - Admin Notes / Customer Notes v2.2 - Customer Zip & State Validation v2.2 - Search Box with Dropdown Category Menu v1.0 Pop your camper's top today! It's a popup thing... You wouldn't understand Link to comment Share on other sites More sharing options...
saborchulo Posted May 9, 2005 Share Posted May 9, 2005 Will do I will track that forum Quote Link to comment Share on other sites More sharing options...
gabbadude Posted May 10, 2005 Share Posted May 10, 2005 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> Quote Link to comment Share on other sites More sharing options...
PopTheTop Posted May 10, 2005 Share Posted May 10, 2005 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! <{POST_SNAPBACK}> I fixed that bug in my contribution of the Fancier Invoice & Packingslip v5.4 saborchulo, Here is the fix to add to your contribution... Open: catalog/includes/modules/email_invoice/templates/html_invoice.php ... OR catalog/includes/modules/email_invoice/templates/fancy.php ... The file name depends on your version of this contribution Look for (at the top): Released under the GNU General Public License */ ?> <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html <?php echo HTML_PARAMS; ?>> <head> Change it to this: Released under the GNU General Public License */ class objectInfo { // class constructor function objectInfo($object_array) { reset($object_array); while (list($key, $value) = each($object_array)) { $this->$key = tep_db_prepare_input($value); } } } ?> <html> <head> Also, you will see that I got rid of some coding that is not needed for HTML e-mails... ie: DELETED <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> and CHANGED <html <?php echo HTML_PARAMS; ?>> to <html> Also, here is a copy of my html_invoice.php which WAS fancy.php - I renamed it for my contribution. You can see if it will work for you. It will add the credit card number to the invoice as 1234xxxxxxxx1234 under the payment method. html_invoice.php <?php /* $Id: html_invoice.php,v 5.2 2005/05/08 00:37:30 PopTheTop Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ class objectInfo { // class constructor function objectInfo($object_array) { reset($object_array); while (list($key, $value) = each($object_array)) { $this->$key = tep_db_prepare_input($value); } } } ?> <html> <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> <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"> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td align="left"><?php echo '<img src="' . INVOICE_IMAGE . '" border="0" alt="' . INVOICE_IMAGE_ALT_TEXT . '" width="' . INVOICE_IMAGE_WIDTH . '" height="' . INVOICE_IMAGE_HEIGHT . '" hspace="10">'; ?></td> <TD ALIGN="right" VALIGN="top" NOWRAP><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><br><br><span class="pageHeadingSM"><FONT FACE="Verdana" SIZE="1" COLOR="#006699"><strong><?php echo nl2br(STORE_NAME_ADDRESS); ?></strong></font></span></TD> </tr> <tr> <td colspan="2"> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <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" NOWRAP><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"><img src="<?php echo $ei_image_dir; ?>pixel_trans.gif" width="100" height="5" alt=""></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> <img src="<?php echo $ei_image_dir; ?>pixel_trans.gif" width="1" height="5" alt=""></td> </tr> <tr> <td NOWRAP> <?php echo tep_address_format($order->customer['format_id'], $order->customer, 1, '', '<br> '); ?></td> </tr> <tr> <td> <img src="<?php echo $ei_image_dir; ?>pixel_trans.gif" width="1" height="10" alt=""></td> </tr> <tr> <td NOWRAP> <?php echo $order->customer['telephone']; ?></td> </tr> <tr> <td NOWRAP> <?php echo $order->customer['email_address']; ?></td> </tr> <tr> <td><img src="<?php echo $ei_image_dir; ?>pixel_trans.gif" width="1" height="7" alt=""></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> <img src="<?php echo $ei_image_dir; ?>pixel_trans.gif" width="1" height="5" alt=""></td> </tr> <tr> <td NOWRAP> <?php echo tep_address_format($order->delivery['format_id'], $order->delivery, 1, '', '<br> '); ?></td> </tr> <tr> <td> <img src="<?php echo $ei_image_dir; ?>pixel_trans.gif" width="1" height="10" alt=""></td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> <tr> <td><img src="<?php echo $ei_image_dir; ?>pixel_trans.gif" width="1" height="7" alt=""></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"><img src="<?php echo $ei_image_dir; ?>pixel_trans.gif" width="100" height="15" alt=""></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="50%" NOWRAP> <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> <?php if (tep_not_null($order->info['cc_number'])) { $this->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 width="50%" NOWRAP> <b><?php echo ENTRY_PAYMENT_METHOD; ?></b> <?php echo $order->info['payment_method']; ?> (<?php echo $order->info['cc_type']; ?>)<br><img src="<?php echo $ei_image_dir; ?>pixel_trans.gif" width="100%" height="6" alt=""><br> <b><?php echo ENTRY_PAYMENT_CC_NUMBER; ?></b> <?php echo $this->cc_card_number_less_middle_digits; ?></td> <?php } elseif (tep_not_null($order->info['checknumber']) || tep_not_null($order->info['accountnumber']) || tep_not_null($order->info['routingnumber'])) { ?> <td width="50%" NOWRAP> <b><?php echo ENTRY_PAYMENT_METHOD; ?></b> <?php echo $order->info['payment_method']; ?><br><img src="<?php echo $ei_image_dir; ?>pixel_trans.gif" width="100%" height="6" alt=""><br> <b>Check Number:</b> <?php echo $order->info['checknumber']; ?></td> <?php } else { ?> <td width="50%" NOWRAP> <b><?php echo ENTRY_PAYMENT_METHOD; ?></b> <?php echo $order->info['payment_method']; ?></td> <?php } ?> </tr> <tr> <td><img src="<?php echo $ei_image_dir; ?>pixel_trans.gif" width="1" height="7" alt=""></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"><img src="<?php echo $ei_image_dir; ?>pixel_trans.gif" width="1" height="15" alt=""></td> </tr> <tr> <TD COLSPAN="2"><img src="<?php echo $ei_image_dir; ?>pixel_trans.gif" width="1" height="10" alt=""></td> </tr> <tr> <TD COLSPAN="2" align="center"> <table border="0" width="98%" cellspacing="0" cellpadding="2"> <tr class="dataTableHeadingRow"> <td class="dataTableHeadingContent" colspan="2"> <font color="#000000"><?php echo TABLE_HEADING_PRODUCTS; ?></font></td> <td WIDTH="80" class="dataTableHeadingContent"><font color="#000000"><?php echo TABLE_HEADING_PRODUCTS_MODEL; ?></font></td> <td WIDTH="80" class="dataTableHeadingContent" align="right"><font color="#000000"><?php echo TABLE_HEADING_UNIT_PRICE; ?></font></td> <TD WIDTH="80" ALIGN="right" CLASS="dataTableHeadingContent"><font color="#000000"><?php echo TABLE_HEADING_TOTAL; ?></font> </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" NOWRAP>' . $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 WIDTH="80" class="dataTableContent" valign="top">' . $order->products[$i]['model'] . '</td>' . "\n"; echo ' <td WIDTH="80" class="dataTableContent" align="right" valign="top">' . $currencies->format($order->products[$i]['final_price'], true, $order->info['currency'], $order->info['currency_value']) . '</td>' . "\n" . ' <td WIDTH="80" 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"; echo ' </tr>' . "\n"; } ?> <tr> <td align="right" colspan="5"> <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> <?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 HTTP_SERVER; ?>/catalog/images/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 HTTP_SERVER; ?>/catalog/images/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%" NOWRAP> <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><img src="<?php echo HTTP_SERVER; ?>/catalog/images/pixel_trans.gif" width="1" height="7" alt=""></td> </tr> </table> </td> <td background="<?php echo HTTP_SERVER; ?>/catalog/images/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 HTTP_SERVER; ?>/catalog/images/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 } ?> <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> </html> L8r... Quote L8r, PopTheTop Published osC Contributions: - eCheck Payment Module v3.1 - Reviews in Product Display v2.0 - Fancier Invoice & Packingslip v6.1 - Admin Notes / Customer Notes v2.2 - Customer Zip & State Validation v2.2 - Search Box with Dropdown Category Menu v1.0 Pop your camper's top today! It's a popup thing... You wouldn't understand Link to comment Share on other sites More sharing options...
PopTheTop Posted May 10, 2005 Share Posted May 10, 2005 html_invoice.php L8r... <{POST_SNAPBACK}> By the way, I have my eCheck payment mod installed. If you do not, change the following code in the file I posted above... Change this: <?php } elseif (tep_not_null($order->info['checknumber']) || tep_not_null($order->info['accountnumber']) || tep_not_null($order->info['routingnumber'])) { ?> <td width="50%" NOWRAP> <b><?php echo ENTRY_PAYMENT_METHOD; ?></b> <?php echo $order->info['payment_method']; ?><br><img src="<?php echo $ei_image_dir; ?>pixel_trans.gif" width="100%" height="6" alt=""><br> <b>Check Number:</b> <?php echo $order->info['checknumber']; ?></td> <?php } else { ?> To this: <?php } else { ?> That should get you going if you use this file. I should be pretty much the same as fancy.php but you can try them both, just save it in your template folder. I have another template that I will post too... Quote L8r, PopTheTop Published osC Contributions: - eCheck Payment Module v3.1 - Reviews in Product Display v2.0 - Fancier Invoice & Packingslip v6.1 - Admin Notes / Customer Notes v2.2 - Customer Zip & State Validation v2.2 - Search Box with Dropdown Category Menu v1.0 Pop your camper's top today! It's a popup thing... You wouldn't understand Link to comment Share on other sites More sharing options...
PopTheTop Posted May 10, 2005 Share Posted May 10, 2005 NEW BASIC TEMPLATE: osC_invoice.php <?php /* $Id: osC_invoice.php,v 5.4 2005/05/09 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 */ ?> <html> <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> </head> <body> <strong><?php echo nl2br(STORE_NAME); ?></strong> <br> ==================================== <br> <b>Order Number:</b> <?php echo $oID; ?> <br> <b>Payment Method:</b> <?php echo $order->info['payment_method']; ?> <br> <b>Date of Order:</b> <?php echo $date; ?> <br><br> <strong>Products Ordered:</strong> <br> ==================================== <br> <?php for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) { echo $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' (' . $order->products[$i]['model'] . ') = ' . $currencies->format($order->products[$i]['final_price'], true, $order->info['currency'], $order->info['currency_value']); 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>'; } } } ?> <br><br> <?php for ($i = 0, $n = sizeof($order->totals); $i < $n; $i++) { echo $order->totals[$i]['title'] . ' ' . $order->totals[$i]['text'] . '<br>'; } ?> <br> <b>Billing Address</b> <br> ==================================== <br> <?php echo tep_address_format($order->customer['format_id'], $order->customer, 1, '', '<br>'); ?> <br> <?php echo $order->customer['telephone']; ?> <br> <?php echo '<a href="mailto:' . $order->customer['email_address'] . '"><u>' . $order->customer['email_address'] . '</u></a>'; ?> <br><br> <b>Shipping Address:</b> <br> ==================================== <br> <?php echo tep_address_format($order->delivery['format_id'], $order->delivery, 1, '', '<br>'); ?> <br> </body> </html> Enjoy... Quote L8r, PopTheTop Published osC Contributions: - eCheck Payment Module v3.1 - Reviews in Product Display v2.0 - Fancier Invoice & Packingslip v6.1 - Admin Notes / Customer Notes v2.2 - Customer Zip & State Validation v2.2 - Search Box with Dropdown Category Menu v1.0 Pop your camper's top today! It's a popup thing... You wouldn't understand Link to comment Share on other sites More sharing options...
gabbadude Posted May 11, 2005 Share Posted May 11, 2005 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... Quote Link to comment Share on other sites More sharing options...
gabbadude Posted May 11, 2005 Share Posted May 11, 2005 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?! Quote Link to comment Share on other sites More sharing options...
PopTheTop Posted May 12, 2005 Share Posted May 12, 2005 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... <{POST_SNAPBACK}> Yes, I have been trying to figure how to do this and now the contribution was born. After it was 6 days old, I added it into my MOD. pretty much identical. Quote L8r, PopTheTop Published osC Contributions: - eCheck Payment Module v3.1 - Reviews in Product Display v2.0 - Fancier Invoice & Packingslip v6.1 - Admin Notes / Customer Notes v2.2 - Customer Zip & State Validation v2.2 - Search Box with Dropdown Category Menu v1.0 Pop your camper's top today! It's a popup thing... You wouldn't understand Link to comment Share on other sites More sharing options...
PopTheTop Posted May 12, 2005 Share Posted May 12, 2005 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?! <{POST_SNAPBACK}> If you would read, you would see that I did reply to you with the fix to your problem AND this contribution. Quote L8r, PopTheTop Published osC Contributions: - eCheck Payment Module v3.1 - Reviews in Product Display v2.0 - Fancier Invoice & Packingslip v6.1 - Admin Notes / Customer Notes v2.2 - Customer Zip & State Validation v2.2 - Search Box with Dropdown Category Menu v1.0 Pop your camper's top today! It's a popup thing... You wouldn't understand Link to comment Share on other sites More sharing options...
gabbadude Posted May 12, 2005 Share Posted May 12, 2005 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. Quote Link to comment Share on other sites More sharing options...
PopTheTop Posted May 12, 2005 Share Posted May 12, 2005 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. <{POST_SNAPBACK}> Post number 40 above... http://www.oscommerce.com/forums/index.php?sho...ndpost&p=610874 ================ Open: catalog/includes/modules/email_invoice/templates/html_invoice.php ... OR catalog/includes/modules/email_invoice/templates/fancy.php ... The file name depends on your version of this contribution Look for (at the top): Released under the GNU General Public License */ ?> <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html <?php echo HTML_PARAMS; ?>> <head> Change it to this: Released under the GNU General Public License */ class objectInfo { // class constructor function objectInfo($object_array) { reset($object_array); while (list($key, $value) = each($object_array)) { $this->$key = tep_db_prepare_input($value); } } } ?> <html> <head> Also, you will see that I got rid of some coding that is not needed for HTML e-mails... ie: DELETED <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> and CHANGED <html <?php echo HTML_PARAMS; ?>> to <html> Quote L8r, PopTheTop Published osC Contributions: - eCheck Payment Module v3.1 - Reviews in Product Display v2.0 - Fancier Invoice & Packingslip v6.1 - Admin Notes / Customer Notes v2.2 - Customer Zip & State Validation v2.2 - Search Box with Dropdown Category Menu v1.0 Pop your camper's top today! It's a popup thing... You wouldn't understand Link to comment Share on other sites More sharing options...
gabbadude Posted May 12, 2005 Share Posted May 12, 2005 Thank you so much, it's working now :) Quote Link to comment Share on other sites More sharing options...
BradsZ24 Posted August 6, 2005 Share Posted August 6, 2005 Hello, I have installed the latest email mod but am having issues with my logo being visible in the email. When I utilized the stock invoice.php <---that was included in the mod, it was giving me the same issue - red X image. I have attempted to make full URL changes with no luck. Does someone know how to resolve this issue? Also, any plans on getting "Professional Invoice & Packaging Slip" contribution to work? I like that layout the best but for the life of me, I cannot get the body to look similar. Thanks in advance, Brad Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.