Jump to content
Sign in to follow this  
Ralph2

Fixed: osCommerce PayPal IPN comment in email

Recommended Posts

For those who use the osCommerce PayPal IPN Module v1.0 For 2.2MS2 module:

 

This module suffers from a bug which doesn't place a customer's comment (entered during the order process) in the confirmation email.

 

Thanks to an inspirational post on the Dutch osC forum, by user Job, the solution has been found:

 

1 - If you're using this particular module, then open ipn.php.

 

2 - Find:

 

 

// lets start with the email confirmation
// $order variables have been changed from checkout_process to work with the variables from the function query () instead of cart () in the order class
 $email_order = STORE_NAME . "\n" . 
			 EMAIL_SEPARATOR . "\n" . 
			 EMAIL_TEXT_ORDER_NUMBER . ' ' . $_POST['invoice'] . "\n" .
			 EMAIL_TEXT_INVOICE_URL . ' ' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $_POST['invoice'], '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";
 }

 

 

3 - And replace this with:

 

 

// lets start with the email confirmation
// $order variables have been changed from checkout_process to work with the variables from the function query () instead of cart () in the order class
 $comment_query = tep_db_query("select comments from " . TABLE_ORDERS_STATUS_HISTORY . " where orders_id = '" . $_POST['invoice'] . "'");
 $commentfetch = tep_db_fetch_array($comment_query);
 $comments = $commentfetch['comments'];

 $email_order = STORE_NAME . "\n" . 
			 EMAIL_SEPARATOR . "\n" . 
			 EMAIL_TEXT_ORDER_NUMBER . ' ' . $_POST['invoice'] . "\n" .
			 EMAIL_TEXT_INVOICE_URL . ' ' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $_POST['invoice'], 'SSL', false) . "\n" .
			 EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n\n";
 if ($comments) {
$email_order .= $comments . "\n\n";
 }

 

 

Done :)

Share this post


Link to post
Share on other sites

Finally managed to get round to doing this - seems to work fine for me.

 

Thanks very much for this fix

 

Tigergirl


I'm feeling lucky today......maybe someone will answer my post!

I do try and answer a simple post when I can just to give something back.

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

PM me? - I'm not for hire

Share this post


Link to post
Share on other sites
For those who use the osCommerce PayPal IPN Module v1.0 For 2.2MS2 module:

 

This module suffers from a bug which doesn't place a customer's comment (entered during the order process) in the confirmation email.

 

Thanks to an inspirational post on the Dutch osC forum, by user Job, the solution has been found:

 

1 - If you're using this particular module, then open ipn.php.

 

2 - Find:

// lets start with the email confirmation
// $order variables have been changed from checkout_process to work with the variables from the function query () instead of cart () in the order class
 $email_order = STORE_NAME . "\n" . 
			 EMAIL_SEPARATOR . "\n" . 
			 EMAIL_TEXT_ORDER_NUMBER . ' ' . $_POST['invoice'] . "\n" .
			 EMAIL_TEXT_INVOICE_URL . ' ' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $_POST['invoice'], '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";
 }

3 - And replace this with:

// lets start with the email confirmation
// $order variables have been changed from checkout_process to work with the variables from the function query () instead of cart () in the order class
 $comment_query = tep_db_query("select comments from " . TABLE_ORDERS_STATUS_HISTORY . " where orders_id = '" . $_POST['invoice'] . "'");
 $commentfetch = tep_db_fetch_array($comment_query);
 $comments = $commentfetch['comments'];

 $email_order = STORE_NAME . "\n" . 
			 EMAIL_SEPARATOR . "\n" . 
			 EMAIL_TEXT_ORDER_NUMBER . ' ' . $_POST['invoice'] . "\n" .
			 EMAIL_TEXT_INVOICE_URL . ' ' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $_POST['invoice'], 'SSL', false) . "\n" .
			 EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n\n";
 if ($comments) {
$email_order .= $comments . "\n\n";
 }

Done :)

I would have thought that info would go in the contrib and in its support thread.


The Coopco Underwear Shop

 

If you live to be 100 years of age, that means you have lived for 36,525 days. Don't waste another, there aren't many left.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×