Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Order Number and Status in Update Emails


Guest

Recommended Posts

Jared, I just replaced the code and the error still comes up.

 

The error is nothing to do with your code, it is saying there is an error here in the code:

 

tep_redirect(tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('action')) . 'action=edit'));

break;

case 'deleteconfirm':

$oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);

 

tep_remove_order($oID, $HTTP_POST_VARS['restock']);

 

The error only shows when your code is included. I'm pretty sure that this is the standard oscommerce code so it shouldn't affect your new code?

 

Sarah

Link to comment
Share on other sites

  • Replies 71
  • Created
  • Last Reply
Small problem.. the Subjects of the email sent to the customer are titled "Order process" but the emails hat I get are the correct format "Jims store Order 1 Has been received"

 

Any ideas?

 

 

Sorry it was 1am .. I had it the rong way around, the Customer gets the subject of "Jims store Order 1 Has been received" and I get a subject of "Order Process" ..

 

I think there was a post on here that described how to get the store owners email to display the order number so I'll look for it later on, or if there isn't how would you do it?

Link to comment
Share on other sites

cowzor - -it sounds like you missed the 2nd half of step 2 in the installation:

Still in catalog/checkout_process.php, find the following:

 

      tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

 

to this:

 

/* commented and replaced for Email Subject contribution 

  tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

*/

 

// next line replacement for Email Subject contribution 

  tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT_1 . ' ' . $insert_id . ' ' .EMAIL_TEXT_SUBJECT_2, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

 

Save and close. 

 

-jared

Link to comment
Share on other sites

  • 3 months later...
  • 4 weeks later...
// lets start with the email confirmation

$email_order = STORE_NAME . "\n" .

EMAIL_SEPARATOR . "\n" .

EMAIL_TEXT_ORDER_NUMBER . ' ' . $order_id . "\n" .

EMAIL_TEXT_INVOICE_URL . ' ' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $order_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 Subject with Order Number and Order Status v1.5 Start

// tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

// Email Subject with Order Number and Order Status v1.5 End

tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT_1 . ' ' . $order_id . ' ' .EMAIL_TEXT_SUBJECT_2 , $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

 

// send emails to other people

if (SEND_EXTRA_ORDER_EMAILS_TO != '') {

// Email Subject with Order Number and Order Status v1.5 Start

// tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

// Email Subject with Order Number and Order Status v1.5 End

tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT_1 . ' ' . $order_id . ' ' .EMAIL_TEXT_SUBJECT_2 , $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

}

 

// load the after_process function from the payment modules

 

 

 

?>

 

Mine doesn't work with orders paid by PayPal (official PP IPN module). The edited file looks like this...anything wrong ?

Link to comment
Share on other sites

  • 4 weeks later...

when I update customer's order status in admins, and choose to notify customers through email, can I ask OSC to send me a copy of the email as well?

 

How to do it?

 

Many thanks... :)

Best regards,

Koh Kho King

Link to comment
Share on other sites

  • 4 weeks later...
  • 1 month later...
  • 2 months later...
Change this:
tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT_1 . ' ' . $insert_id . ' ' .EMAIL_TEXT_SUBJECT_2 , $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

 

to this:

tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT_1 . ' ' . $order_id . ' ' .EMAIL_TEXT_SUBJECT_2 , $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

 

(i.e. the correct variable in that code for the order number appears to be $order_id, not $insert_id).

 

Give that a shot.

 

-jared

 

 

 

Would it be possible for someone to get this code right so it works for the PayPal Shopping Cart IPN v3.1?

 

 

 

I can't seem to get it right. There needs to be some spaces in the printout in the email subject as well, but I can't do it.

 

 

 

The pathway is catalog/includes/modules/payment/paypal/classes/osC/Order.class.php

 

 

 

 

function notifyCustomer(&$order) {

$customer_notification = (SEND_EMAILS == 'true') ? '1' : '0';

tep_db_query("insert into " . TABLE_ORDERS_STATUS_HISTORY . " (orders_id, orders_status_id, date_added, customer_notified) values ('" . (int)$this->orderID . "', '" . MODULE_PAYMENT_PAYPAL_ORDER_STATUS_ID . "', now(), '" . $customer_notification . "')");

 

// 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";

 

$customerComments = $this->getCustomerComments();

 

if ($customerComments) {

$email_order .= tep_db_output($customerComments) . "\n\n";

}

$email_order .= EMAIL_TEXT_PRODUCTS . "\n" .

EMAIL_SEPARATOR . "\n" .

$this->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 ($this->contentType != 'virtual') {

$email_order .= "\n" . EMAIL_TEXT_DELIVERY_ADDRESS . "\n" .

EMAIL_SEPARATOR . "\n" .

tep_address_label($order->customer['id'], $this->sendTo, 0, '', "\n") . "\n";

}

 

$email_order .= "\n" . EMAIL_TEXT_BILLING_ADDRESS . "\n" .

EMAIL_SEPARATOR . "\n" .

tep_address_label($order->customer['id'], $this->billTo, 0, '', "\n") . "\n\n";

 

$email_order .= EMAIL_TEXT_PAYMENT_METHOD . "\n" .

EMAIL_SEPARATOR . "\n";

$email_order .= $this->paymentTitle . "\n\n";

 

tep_mail($order->customer['name'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT_1 . '' . $order_id . '' . EMAIL_TEXT_SUBJECT_2, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

 

// send emails to other people

if (SEND_EXTRA_ORDER_EMAILS_TO != '') {

// BEGIN - little EMAIL modification, ASKMURPHY 19-aug-2005 (also needed in OSC module checkout_process.php)

// tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

$newsubject .= EMAIL_TEXT_SUBJECT_1 . '' . $order_id . '' . EMAIL_TEXT_SUBJECT_2 . '(' . $order->customer['name'] . ')';

tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, $newsubject, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

// END - little EMAIL modification, ASKMURPHY 19-aug-2005

}

 

}

 

 

 

I've got about 8 different versions of the section in my editing folder now, this one gave me errors in the IPN test panel. I do have one that doesn't give me errors in the test panel and I'm going ito try and find it now and upload to the server. The reason I was trying to change it is that I needed the spaces and the order_id number wasn't showing up in the email.

 

 

 

Thanks in advance.

I like these mods, there fun! ...65 70 72 75 80 85 125+ contributions installed and counting...

 

Tools I'm using: OSC2.2 milestone2, Filezilla for FTP, PHP Designer 2007PE (nice), Araxis Merge 6.5 to compare files, XP(my box), Remote Server is shared Apache 1.3 Cpanel, CURL, and PHPmyAdmin through my hosts Cpanel to mess up the database.

Link to comment
Share on other sites

  • 2 weeks later...
When a customer replies to your admin-generated order update, and doesn't quote the email you sent, isn't it a pain to find the order? If you've installed PWA, which lets them checkout without creating an account, you may even have to look in the database to find which order they're referring to. All you have is their email address, and the fact that you've emailed them.

 

Well, folks, those worries are a thing of the past! phpMyAdmin will no longer be required to find orders! Step right up, sit yourself down, and prepare to be astonished!

 

Ok, I've had about enough of that. Let's get to it. We're going to changes the email subject line of all your admin-generated order status updates (except the original purchase email) from this: Order Update to this: Your Great Store Order 1234: Shipped. The email title will now have the order number (handy for when you get non-quoted replies) and the order status (more obvious for the customer).

 

Only 2 file edits are required:

  • catalog/admin/orders.php
  • catalog/admin/includes/languages/english/orders.php (obviously you can also do this in other languages)

Step 1: catalog/admin/orders.php

Find this:

 ? ? ? ? ? $email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "\n\n" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]);

? ? ? ? ? ?tep_mail($check_status['customers_name'], $check_status['customers_email_address'], EMAIL_TEXT_SUBJECT, $email, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

? ? ? ? ? ?$customer_notified = '1';

 

Change it to this:

 ? ? ? ? ? ?$email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "\n\n\n" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]);

? ? ? ? ? ?tep_mail($check_status['customers_name'], $check_status['customers_email_address'], EMAIL_TEXT_SUBJECT_1. $oID . EMAIL_TEXT_SUBJECT_2 . $orders_status_array[$status], $email, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

? ? ? ? ? ?$customer_notified = '1';

Step 2: catalog/admin/includes/languages/english/orders.php

Find this:

define('EMAIL_SEPARATOR', '------------------------------------------------------');
define('EMAIL_TEXT_SUBJECT', 'Order Update');
define('EMAIL_TEXT_ORDER_NUMBER', 'Order Number:');
define('EMAIL_TEXT_INVOICE_URL', 'Detailed Invoice:');
define('EMAIL_TEXT_DATE_ORDERED', 'Date Ordered:');
define('EMAIL_TEXT_STATUS_UPDATE', 'Your order has been updated to the following status.' . "\n\n" . 'New status: %s' . "\n\n" . 'Please reply to this email if you have any questions.' . "\n");
define('EMAIL_TEXT_COMMENTS_UPDATE', 'The comments for your order are' . "\n\n%s\n\n");

 

Change it to something like this:

define('EMAIL_SEPARATOR', '------------------------------------------------------');
define('EMAIL_TEXT_SUBJECT_1', 'Your Great Store Order ');
define('EMAIL_TEXT_SUBJECT_2', ': ?');
define('EMAIL_TEXT_ORDER_NUMBER', 'Order Number:');
define('EMAIL_TEXT_INVOICE_URL', 'Detailed Invoice:');
define('EMAIL_TEXT_DATE_ORDERED', 'Date Ordered:');
define('EMAIL_TEXT_STATUS_UPDATE', 'Your order has been updated to the following status: ?%s' . "\n\n" . 'If necessary, you may update your order directly by following the link above (login required). ?If you have not created an account, and are therefore unable to login, simply reply to this email with any comments or questions.' . "\n");
define('EMAIL_TEXT_COMMENTS_UPDATE', 'The comments for your order are:' . "\n\n%s\n\n");

 

You'll probably want to customize Step 2 to better fit your store, but you get the idea. I use that particular text because I have the Customer Comments contrib (linked in my signature), so it fits for me. Make yours fit your store.

 

Let me know what you think!

 

-jared

 

I updated my files and the email text has what I want - YEAH...BUT I'm using a shared server / certificate and when I made the change to the Admin/Orders.php file I now get the wrong url link displayed for the 'Detailed Invoice'. I can make it work if I use NON SSL but I still don't get right to the My Account page at that point.

 

Old url that worked correctly - https://daytona.anyservers.com/~nikki/osc/a....php?order_id=9

 

New url that doesn't work good - http://stellacandles.com/osc/account_histo....php?order_id=9

 

I like the look of the second url better but obvisouly it would be preferred to have a link that works.

 

Aside from getting this fixed, anyone know how to make the hyperlink to simply be the verbiage 'Detailed Invoice'?

 

Any thoughts?

Link to comment
Share on other sites

  • 1 month later...

hello,

 

actually my admin/order.php file looks like this :

 

 

 if (EMAIL_USE_HTML) {
			$email .= STORE_NAME . "\n";
			$email .= EMAIL_SEPARATOR . "\n";
			$email .= EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID."\n";
			$email .= EMAIL_TEXT_INVOICE_URL . ' <a href="' . $link_to_order . '">' . $link_to_order . '</a>' . "\n";
			$email .= EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "\n\n";
			$email .= $notify_comments;
			$email .= sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]);
	} else {
			$email .= STORE_NAME . "\n";
			$email .= EMAIL_SEPARATOR . "\n";
			$email .= EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID."\n";
			$email .= EMAIL_TEXT_INVOICE_URL . ' ' . $link_to_order . "\n";
			$email .= EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "\n\n";
			$email .= $notify_comments;
			$email .= sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]);
	}

	unset($link_to_order);
		tep_mail($check_status['customers_name'], $check_status['customers_email_address'], EMAIL_TEXT_SUBJECT, $email, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

		$customer_notified = '1';
	  }

 

 

Then, i'm having the contrib FANCIER INVOICE & PACKING SLIP.

 

 

When i did set up the Email Subjet contrib, i got email coming with EMAIL_TEXT_SUBJECT coming.

 

In my languages files, i did correctly change SUBJECT line to SUBJECT_1 and SUBJECT_2.

 

Do you have idea about what is wrong ?

 

Does this contrib compatible with the FANCIER INVOICE & PACKING SLIP ?

 

thanks for your help

Link to comment
Share on other sites

  • 2 weeks later...
Would it be possible for someone to get this code right so it works for the PayPal Shopping Cart IPN v3.1?

 

I am having the same problem too. Does anybody have a snippet of code that actually works with the PayPal Shopping cart IPN order.class.php?

Link to comment
Share on other sites

  • 1 month later...
Nice catch. I just grepped through the code looking for other instances as well, and didn't find any more of them.

 

I'll include that in the contrib.

 

Thanks!

 

-jared

 

Hi there - Any thoughts on why this change (which works great by the way) now changes the Detailed Invoice URL on the order emails from my shared server name to my store url. The link doesn't work. When I undo these changes, then the URL is correct.

 

Any help would be greatly appreciated!

Stella

Link to comment
Share on other sites

  • 5 months later...

So which program sends the email out:

checkout_process.php or paypal_ipn.php?

 

There seems to be confusion on whether we should change one or the other or both? The contribution shows catalog/checkout_process.php to be modified and then the paypal instructions.txt files also mentiones changing: catalog/includes/modules/payment/paypal_ipn.php . ;)

Chris

Link to comment
Share on other sites

This thread seems to have gone off topic a little, or at least to a different part of the OSC programme. I'm interested in the original contrib. of email updates.

 

I've used the contrib. to put extra info in the subject line :) I'd like to improve this contrib. and move on a stage to make the email more personal to the customer. Basically I feel its too impersonal.

 

Basically, can anyone advise what bit of code I can use to add the customers name please?

 

To put icing on the cake, what bit of code can I use to add the customers contact details (name, billing address, tel. No. and email address) elsewhere in the email please?

 

Any help will be gratefully received :D

 

Thanks in advance

 

Steve

____________________________________________________________________

____________________________________________________________________

Link to comment
Share on other sites

So which program sends the email out:

checkout_process.php or paypal_ipn.php?

 

There seems to be confusion on whether we should change one or the other or both? The contribution shows catalog/checkout_process.php to be modified and then the paypal instructions.txt files also mentiones changing: catalog/includes/modules/payment/paypal_ipn.php . ;)

I don't have paypal on my site, so can't comment on that. The order acknowledgement email is generated from catalog\checkout_process.php

____________________________________________________________________

____________________________________________________________________

Link to comment
Share on other sites

  • 3 years later...

Hi,

 

Thanks for the contribution...

 

i'm having trouble for the paypal steps...it seems that i do not get the extra email for the email order . Why is that? and how do i add a bit of text in the email?

 

also, i don't have the paypal_ipn.php so i've put your code into paypal_standard.php.

 

thanks

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...