Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Checkout Confirmation Email Issue


NadonSport

Recommended Posts

Hi everyone,

 

I have a problem with the confirmation email that has appeared recently. When I receive the email look like this :

 

Nadon Sport Lachute - Centre de Liquidation

EMAIL_SEPARATOR

EMAIL_TEXT_ORDER_NUMBER 53

EMAIL_TEXT_INVOICE_URL http://www.XXXXXXXXX.com/account_history_info.php?order_id=780962

EMAIL_TEXT_DATE_ORDERED Thursday 23 February, 2013

 

EMAIL_TEXT_PRODUCTS

EMAIL_SEPARATOR

1 x Item #234 = 89.99$

EMAIL_SEPARATOR

 

EMAIL_TEXT_DELIVERY_ADDRESS

EMAIL_SEPARATOR

Mister Smith

1111,Street

SomeCity

ZipCode - Canada

 

EMAIL_TEXT_BILLING_ADDRESS

EMAIL_SEPARATOR

Mister Smith

1111,Street

SomeCity

ZipCode - Canada

 

EMAIL_TEXT_PAYMENT_METHOD

EMAIL_SEPARATOR

PayPal

 

-------------------

 

The checkout_process.php in includes/languages/english/ looks fine

 

<?php
/*
 $Id: checkout_process.php,v 1.26 2002/11/01 04:22:05 hpdl Exp $
 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com
 Copyright (c) 2002 osCommerce
 Released under the GNU General Public License
*/
define('EMAIL_TEXT_SUBJECT', 'Order Process');
define('EMAIL_TEXT_ORDER_NUMBER', 'Order Number:');
define('EMAIL_TEXT_INVOICE_URL', 'Detailed Invoice:');
define('EMAIL_TEXT_DATE_ORDERED', 'Date Ordered:');
define('EMAIL_TEXT_PRODUCTS', 'Products');
define('EMAIL_TEXT_SUBTOTAL', 'Sub-Total:');
define('EMAIL_TEXT_TAX', 'Tax:	    ');
define('EMAIL_TEXT_SHIPPING', 'Shipping: ');
define('EMAIL_TEXT_TOTAL', 'Total:    ');
define('EMAIL_TEXT_DELIVERY_ADDRESS', 'Delivery Address');
define('EMAIL_TEXT_BILLING_ADDRESS', 'Billing Address');
define('EMAIL_TEXT_PAYMENT_METHOD', 'Payment Method');
define('EMAIL_SEPARATOR', '------------------------------------------------------');
define('TEXT_EMAIL_VIA', 'via');
?>

 

I don't know what the problem can be.

 

Any help would be appreciate!

Thanks

Link to comment
Share on other sites

Hi - any possibility that you have a multi-langauge setup (French & English) and the customer is checking out in French and the includes/languages/french/checkout_process.php file is missing?

 

Yes, I do have a multi-languages store (English and French). Both checkout_process.php are uploaded to the server and are identical (apart from the language).

Link to comment
Share on other sites

I've been looking all over the web for 5 days to resolve this issue with no avail.

The 3 checkout_process.php haven't change in a long time, everything was ok and suddently the email started to shown all the define parameters instead and the actual define text in language files.

 

The store is small, under 200 clients which are mostly one time customer to by a specific Motorcycle clearance part/accessorie. So I don't get a bunch of order each day... more 1 to 3 per week as we are a Motorsport Dealer and customer can call directly to order.

 

At least I receive a confirmation email when the order is made, it's just something annoying me. I should try to make an order to myself to see if the customer also receive the same kind of email with all the EMAIL_TEXT not define.

 

Meanwhile,

Here's the checkout_process.php in /catalog if this could help. I usually tag all contrib modifications/additions with //ADD and //END. Maybe I forgot some.

 

I hope someone can help me out with this issue.

 

<?php
/*
 $Id: checkout_process.php,v 1.128 2003/05/28 18:00:29 hpdl Exp $[/background][/font][/color]
[color=#282828][font=helvetica, arial, sans-serif][background=rgb(247, 247, 247)]  osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com[/background][/font][/color]
[color=#282828][font=helvetica, arial, sans-serif][background=rgb(247, 247, 247)]  Copyright (c) 2007 osCommerce[/background][/font][/color]
[color=#282828][font=helvetica, arial, sans-serif][background=rgb(247, 247, 247)]  Released under the GNU General Public License
*/[/background][/font][/color]
[color=#282828][font=helvetica, arial, sans-serif][background=rgb(247, 247, 247)]  include('includes/application_top.php');[/background][/font][/color]
[color=#282828][font=helvetica, arial, sans-serif][background=rgb(247, 247, 247)]// 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'));
 }[/background][/font][/color]
[color=#282828][font=helvetica, arial, sans-serif][background=rgb(247, 247, 247)]  if ( (tep_not_null(MODULE_PAYMENT_INSTALLED)) && (!tep_session_is_registered('payment')) ) {
   tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
}[/background][/font][/color]
[color=#282828][font=helvetica, arial, sans-serif][background=rgb(247, 247, 247)]// 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'));
   }
 }[/background][/font][/color]
[color=#282828][font=helvetica, arial, sans-serif][background=rgb(247, 247, 247)]  include(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_PROCESS);[/background][/font][/color]
[color=#282828][font=helvetica, arial, sans-serif][background=rgb(247, 247, 247)]// load selected payment module
 require(DIR_WS_CLASSES . 'payment.php');
 $payment_modules = new payment($payment);[/background][/font][/color]
[color=#282828][font=helvetica, arial, sans-serif][background=rgb(247, 247, 247)]// load the selected shipping module
 require(DIR_WS_CLASSES . 'shipping.php');
 $shipping_modules = new shipping($shipping);[/background][/font][/color]
[color=#282828][font=helvetica, arial, sans-serif][background=rgb(247, 247, 247)]  require(DIR_WS_CLASSES . 'order.php');
 $order = new order;[/background][/font][/color]
[color=#282828][font=helvetica, arial, sans-serif][background=rgb(247, 247, 247)]  require(DIR_WS_CLASSES . 'order_total.php');
 $order_total_modules = new order_total;[/background][/font][/color]
[color=#282828][font=helvetica, arial, sans-serif][background=rgb(247, 247, 247)]  $order_totals = $order_total_modules->process();[/background][/font][/color]
[color=#282828][font=helvetica, arial, sans-serif][background=rgb(247, 247, 247)]// load the before_process function from the payment modules
 $payment_modules->before_process();[/background][/font][/color]
[color=#282828][font=helvetica, arial, sans-serif][background=rgb(247, 247, 247)]  $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);
 }[/background][/font][/color]
[color=#282828][font=helvetica, arial, sans-serif][background=rgb(247, 247, 247)]  $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);[/background][/font][/color]
[color=#282828][font=helvetica, arial, sans-serif][background=rgb(247, 247, 247)]// initialized for the email confirmation
 $products_ordered = '';
 $subtotal = 0;
 $total_tax = 0;[/background][/font][/color]
[color=#282828][font=helvetica, arial, sans-serif][background=rgb(247, 247, 247)]  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']) . "'");
    }
  }
   }[/background][/font][/color]
[color=#282828][font=helvetica, arial, sans-serif][background=rgb(247, 247, 247)]// 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']) . "'");[/background][/font][/color]
[color=#282828][font=helvetica, arial, sans-serif][background=rgb(247, 247, 247)]    $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();[/background][/font][/color]
[color=#282828][font=helvetica, arial, sans-serif][background=rgb(247, 247, 247)]//------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);[/background][/font][/color]
[color=#282828][font=helvetica, arial, sans-serif][background=rgb(247, 247, 247)]	    $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);[/background][/font][/color]
[color=#282828][font=helvetica, arial, sans-serif][background=rgb(247, 247, 247)]	    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;[/background][/font][/color]
[color=#282828][font=helvetica, arial, sans-serif][background=rgb(247, 247, 247)]    $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";
 }[/background][/font][/color]
[color=#282828][font=helvetica, arial, sans-serif][background=rgb(247, 247, 247)]// lets start with the email confirmation
 $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";[/background][/font][/color]
[color=#282828][font=helvetica, arial, sans-serif][background=rgb(247, 247, 247)]  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";
 }[/background][/font][/color]
[color=#282828][font=helvetica, arial, sans-serif][background=rgb(247, 247, 247)]  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";
 }[/background][/font][/color]
[color=#282828][font=helvetica, arial, sans-serif][background=rgb(247, 247, 247)]  $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 .= $order->info['payment_method'] . "\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, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);[/background][/font][/color]
[color=#282828][font=helvetica, arial, sans-serif][background=rgb(247, 247, 247)]// 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);
 }[/background][/font][/color]
[color=#282828][font=helvetica, arial, sans-serif][background=rgb(247, 247, 247)]// load the after_process function from the payment modules
 $payment_modules->after_process();[/background][/font][/color]
[color=#282828][font=helvetica, arial, sans-serif][background=rgb(247, 247, 247)]  $cart->reset(true);[/background][/font][/color]
[color=#282828][font=helvetica, arial, sans-serif][background=rgb(247, 247, 247)]// 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');[/background][/font][/color]
[color=#282828][font=helvetica, arial, sans-serif][background=rgb(247, 247, 247)]//ADD
 if (tep_session_is_registered('held_order')) {
   tep_db_query("delete from " . TABLE_HOLDING_ORDERS . " where orders_id = '" . $held_order . "'");
   tep_db_query("delete from " . TABLE_HOLDING_ORDERS_PRODUCTS . " where orders_id = '" . $held_order . "'");
   tep_db_query("delete from " . TABLE_HOLDING_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_id = '" . $held_order . "'");
   tep_db_query("delete from " . TABLE_HOLDING_ORDERS_PRODUCTS_DOWNLOAD . " where orders_id = '" . $held_order . "'");
   tep_db_query("delete from " . TABLE_HOLDING_ORDERS_STATUS_HISTORY . " where orders_id = '" . $held_order . "'");
   tep_db_query("delete from " . TABLE_HOLDING_ORDERS_TOTAL . " where orders_id = '" . $held_order . "'");
   tep_session_unregister('held_order');
 }
//END[/background][/font][/color]
[color=#282828][font=helvetica, arial, sans-serif][background=rgb(247, 247, 247)]  tep_redirect(tep_href_link(FILENAME_CHECKOUT_SUCCESS, '', 'SSL'));[/background][/font][/color]
[color=#282828][font=helvetica, arial, sans-serif][background=rgb(247, 247, 247)]  require(DIR_WS_INCLUDES . 'application_bottom.php');
?>[/background][/font][/color]
[color=#282828][font=helvetica, arial, sans-serif][background=rgb(247, 247, 247)]

 

 

and to make the thing easier, here's the /languages/english/checkout_process.php from above. (Both french and english are identical except after the " , " )

 

<?php
/*
$Id: checkout_process.php,v 1.26 2002/11/01 04:22:05 hpdl Exp $
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright (c) 2002 osCommerce
Released under the GNU General Public License
*/
define('EMAIL_TEXT_SUBJECT', 'Order Process');
define('EMAIL_TEXT_ORDER_NUMBER', 'Order Number:');
define('EMAIL_TEXT_INVOICE_URL', 'Detailed Invoice:');
define('EMAIL_TEXT_DATE_ORDERED', 'Date Ordered:');
define('EMAIL_TEXT_PRODUCTS', 'Products');
define('EMAIL_TEXT_SUBTOTAL', 'Sub-Total:');
define('EMAIL_TEXT_TAX', 'Tax:		 ');
define('EMAIL_TEXT_SHIPPING', 'Shipping: ');
define('EMAIL_TEXT_TOTAL', 'Total:	 ');
define('EMAIL_TEXT_DELIVERY_ADDRESS', 'Delivery Address');
define('EMAIL_TEXT_BILLING_ADDRESS', 'Billing Address');
define('EMAIL_TEXT_PAYMENT_METHOD', 'Payment Method');
define('EMAIL_SEPARATOR', '------------------------------------------------------');
define('TEXT_EMAIL_VIA', 'via');
?>
Link to comment
Share on other sites

Hi - in amongst all the extra stuff that code looks OK - towards the top of the file you have:

 

include(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_PROCESS);

 

and then towards the bottom the $email_order gets constructed.

 

you could try replacing the above line with

die(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_PROCESS);

 

and run through a quick test order - you should get a white screen of death with the filename printed out that matches your language - if not then you've found the problem, if not then I'm stumped

 

p.s. if you can access your PHP error logs there may be something

Link to comment
Share on other sites

I tried the above "die" line, and I get this when doing an order :

 

Unable to process payment. Please contact the merchant as the shipping address provided by the merchant is invalid, and the merchant has requested that your order must be shipped to that address.

 

I don't know what's going on with this.

 

This appear on the paypal website. I also received the email with all the EMAIL_TEXT.

 

It got me thinking... I added a contrib called "Held Orders v2.2" (link) that send me an email when a paypal transation is not complete correctly or the client does not click the "Return to Merchant" button on paypal website after the transaction. This way I can contact the client and ask him if something went wrong and if he want to proceed to the order or if he just cancelled it.

 

Maybe my error come from this contrib.

 

I won't copy the entire Contrib code here, but if someone wants to take a look at it and see if this may be the cause of my issue and provide me a way to resolve the problem, it would be appriciate.

Link to comment
Share on other sites

Ok i found why I got this message from paypal :

 

Unable to process payment. Please contact the merchant as the shipping address provided by the merchant is invalid, and the merchant has requested that your order must be shipped to that address.

 

To resolve this you need to set the STATE to YES in Customer Details (Admin Section of OsC).

I guess that this is due to "PayPal Website Payments Standard" or a Paypal setting asking for a State or Province before making the order. I added this contrib 2 days ago.

--

Now back to my original error (got this error before addind PayPal Website Payments Standard).

 

After retrying the "die" line, i'm now on paypal website with all the information :

 

Your order summary
DescriptionsAmount
STORE NAME
$4.99Item price: $4.99
Quantity: 1
Item total $4.99
Tax $0.92
Total $5.91 CAD

 

And also received the email Without completing the transaction.

Which I think refers to a problem with the contrib of Held Orders v.2.2.

 

I'll try to look more deeply in this contrib as soon as I get some more free times at my job (as my oscommerce files and FTP access are there).

Link to comment
Share on other sites

Hi

 

Sorry - I didn't realise you were talking about one of the PayPal systems - they are many and varied - chances are that the one you have is skipping the checkout_process file and is, instead, using it's own bastardised code to do 'stuff' - as a result it's sending the email out but has no value for

include(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_PROCESS);

 

I have no idea where the code may be that is sending the email (perhaps in includes/modules/payment/whatever_paypal or in the /ext/ folder) but if you can find it and there is a line that looks like the above then you could try changing it to:

 

include(DIR_WS_LANGUAGES . 'english/' . FILENAME_CHECKOUT_PROCESS);

 

see if that works

Link to comment
Share on other sites

I confirm that the problem come from the Held Orders v2.2.

 

The faulty email is sent as soon as the client Proceed to the payment (the last page of the confirmation process on my store) and just before arriving on paypal website. If i remember correctly, a Basic OsC don't send an email at this point.

 

What I've tried since I realized the faulty mail is relate to this contrib ? :

  • Checked the Database to see if everything from Held Orders is there = Everything's OK.
  • Checked all php files related to the installation of this contrib = Everything's OK.
  • Reupload all php files related to the contrib = DONE.

Still get emails with all the EMAIL_TEXT, EMAIL_SEPARATOR ...etc not defined.

Link to comment
Share on other sites

If anyone can move this topic to the approriate Add-Ons section of the forum, you're welcome to do it.

 

The Addons is called HELD ORDERS v2.2 and it's purpose is to send and email as soon as the client click the LAST button of the Order Confirmation process pages, the one that brings you to Paypal Website. So if the order do not complete because the client haven't click the "Return To Merchant" button on paypal and the order doesn't complete properly, this way we still get an order in the admin section in the Held Orders section (created with the contrib) and an email to notify us.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...