Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How do I add a line to the order update email?


Floob

Recommended Posts

Posted

Hi,

 

I'm trying to add a line like this to an order update email

 

If order update = '3' (Despatched)

TEXT_ORDER_TRACKING (so I can use language files) = htpp://blahblahblah(then append the order number to the end)

 

So in effect, I would like another line item that would look like:

Order Tracking: http://www.here.com/track?=(ordernumber)

 

Thanks for any help.

 

Floob.

Posted

Hi Allen

 

Edit orders.php in the admin section

 

Add this after line 31

 

      $tracking_no = tep_db_prepare_input($HTTP_POST_VARS['tracking_no']);

 

And at around line 45 make it look like this

 

          if ($status == '3') {

           $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']) . "nn" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status] . "nn" . TEXT_ORDER_TRACKING . $tracking_no);

         } else {

           $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']) . "nn" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]);

         }

 

Then you will need to add a box to enter the tracking number into.

 

Add this at line 299

 

      <tr>

       <td><?php echo tep_draw_input_field('tracking_no'); ?></td>

     </tr>

Mark Evans

osCommerce Monkey & Lead Guitarist for "Sparky + the Monkeys" (Album on sale in all good record shops)

 

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

Software is like sex: It's better when it's free. (Linus Torvalds)

Posted

Thanks very much for the reply.

 

Can you explain how this works - i.e. where it picks up the OrderID to append to the fixed url?

 

I guess I use this in the language files (TEXT_ORDER_TRACKING) to say something like: To track your order click here:

 

But then where do I set the URL?

 

Thanks for your time.

Posted
Can you explain how this works - i.e. where it picks up the OrderID to append to the fixed url?

 

Ah I thought you wanted to add a specific tracking number to append to the url. If you just want to add the order id to a fixed url change

 

          if ($status == '3') { 

           $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']) . "nn" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status] . "nn" . TEXT_ORDER_TRACKING .  $oID); 

         } else { 

           $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']) . "nn" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]); 

         }

 

And ignore the adding for the field on line 299.

 

I guess I use this in the language files (TEXT_ORDER_TRACKING) to say something like: To track your order click here:

 

But then where do I set the URL?

 

Why not add in the language file

 

define('TEXT_ORDER_TRACKING', 'To track your order click here: http://mytrackingurl.com');

Mark Evans

osCommerce Monkey & Lead Guitarist for "Sparky + the Monkeys" (Album on sale in all good record shops)

 

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

Software is like sex: It's better when it's free. (Linus Torvalds)

Posted

Thats sounds fantastic! I assume the oID gets appended to the url without a space - so it still works etc...

 

Thanks for your help, I'm going to give it a go now.

Posted

Hi,

 

Thanks this works perfectly.

 

One more thing..... :D

 

I would like a tickbox on the order update page that says 'Append Tracking URL' or something similar, that is ticked by default.

 

So the logic would be append the tracking url if the box is ticked AND the email status = 3.

 

Would this be possible?

 

Thanks very much for any help.

Archived

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

×
×
  • Create New...