gayla Posted January 18, 2007 Share Posted January 18, 2007 Hey ya'll! I'm trying to add the delivery name to the order status emails and haven't been able to get it to work. I was hoping someone could check the following code for me and tell me what I'm doing wrong please! ------------------------------------ In admin/orders.php... I changed this line (line 73 on my tiny little monitor) - $check_status_query = tep_db_query("select customers_name, customers_email_address, orders_status, date_purchased from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'"); to this - $check_status_query = tep_db_query("select customers_name, delivery_name, customers_email_address, orders_status, date_purchased from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'"); ------------------------------------ and then I changed this line (line 99 on my tiny little monitor) - $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]); to this - $email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . $orders['delivery_name'] . ' ' . 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]); ------------------------------------ Did I get the code wrong? Is there something else I need to add to make this happen? Help please and thank you! Link to comment Share on other sites More sharing options...
davidinottawa Posted January 18, 2007 Share Posted January 18, 2007 $check_status_query = tep_db_query("select customers_name, delivery_name, customers_email_address, orders_status, date_purchased from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'"); this is Ok. $email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . $orders['delivery_name'] . ' ' . 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]); this is not Ok. change : $orders['delivery_name'] to : $check_status['delivery_name'] the select statment says : $check_status_query = tep_db_query("select customers_name, delivery_name, customers_email_address, orders_status, date_purchased from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'"); and then it gets reassigned into the $check_status array : $check_status = tep_db_fetch_array($check_status_query); hth, david And BTW - line numbers are line numbers. Size of monitor is of no consequence. Link to comment Share on other sites More sharing options...
gayla Posted January 18, 2007 Author Share Posted January 18, 2007 David - Thanks for your help. I changed $orders to $check_status on line 99 and it didn't seem to do anything. When I changed the status on a test order, it didn't change anything in the email that I received. Are there any other files that need to be changed to make this happen or am I still missing something in this one? Link to comment Share on other sites More sharing options...
davidinottawa Posted January 18, 2007 Share Posted January 18, 2007 David - Thanks for your help. I changed $orders to $check_status on line 99 and it didn't seem to do anything. When I changed the status on a test order, it didn't change anything in the email that I received. Are there any other files that need to be changed to make this happen or am I still missing something in this one? are you trying to change the email that gfoes out when you *update* the order within the admin/orders page ? or are you trying to update the email that goes out when someone succssfully makes a purchase ? Link to comment Share on other sites More sharing options...
gayla Posted January 18, 2007 Author Share Posted January 18, 2007 are you trying to change the email that gfoes out when you *update* the order within the admin/orders page ? or are you trying to update the email that goes out when someone succssfully makes a purchase ? I'm trying to add the delivery name to the email that is sent when the order status is updated from "Processing" to "Shipped". Our site is used internally for our sales people to request samples for potential customers and they routinely place multiple orders everyday. Adding the delivery name to the status update email would save them the step of having to go back into the order to see who it was shipped to. David, thanks for your help with this. I really appreciate it. Link to comment Share on other sites More sharing options...
davidinottawa Posted January 18, 2007 Share Posted January 18, 2007 I'm trying to add the delivery name to the email that is sent when the order status is updated from "Processing" to "Shipped". Our site is used internally for our sales people to request samples for potential customers and they routinely place multiple orders everyday. Adding the delivery name to the status update email would save them the step of having to go back into the order to see who it was shipped to. ah. well - it's this function of being able to update the status from processing to shipping a 3rd party contribution ? Link to comment Share on other sites More sharing options...
gayla Posted January 18, 2007 Author Share Posted January 18, 2007 ah. well - it's this function of being able to update the status from processing to shipping a 3rd party contribution ? I think the order status is a standard feature. But then again, I've hacked this thing to death over the last 3 years and can't even remember what all I've added. :'( What I'm trying to change is the email that is sent when I go into admin, add comments to an order and then update the order status from Pending, or Processing, or Shipped. I may, at some point, have changed those status to different words than what came with the program originally but I'm pretty sure that the process of having order status was not a contrib I added. Link to comment Share on other sites More sharing options...
davidinottawa Posted January 18, 2007 Share Posted January 18, 2007 I think the order status is a standard feature. But then again, I've hacked this thing to death over the last 3 years and can't even remember what all I've added. :'( What I'm trying to change is the email that is sent when I go into admin, add comments to an order and then update the order status from Pending, or Processing, or Shipped. I may, at some point, have changed those status to different words than what came with the program originally but I'm pretty sure that the process of having order status was not a contrib I added. Oh yeah Ok - I see it. I'm not sure what to tyell ya - it works for me. in admin/orders.php I have : $check_status_query = tep_db_query("select customers_name, [b]delivery_name,[/b] customers_email_address, orders_status, date_purchased from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'"); $check_status = tep_db_fetch_array($check_status_query); [code] and for the $email var I have : [code] $email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n". EMAIL_TEXT_DELIVERY_ADDRESS . "\n" . [b]$check_status['delivery_name'][/b] . "\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]); sorry - but are you sure you're uploading to the right directory ? d Link to comment Share on other sites More sharing options...
gayla Posted January 18, 2007 Author Share Posted January 18, 2007 Oh yeah Ok - I see it. I'm not sure what to tyell ya - it works for me. in admin/orders.php I have : $check_status_query = tep_db_query("select customers_name, [b]delivery_name,[/b] customers_email_address, orders_status, date_purchased from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'"); $check_status = tep_db_fetch_array($check_status_query); [code] and for the $email var I have : [code] $email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n". EMAIL_TEXT_DELIVERY_ADDRESS . "\n" . [b]$check_status['delivery_name'][/b] . "\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]); sorry - but are you sure you're uploading to the right directory ? d LOL I repeatedly have to check that I'm actually uploading to the right directory because I tend to have the wrong one's open so often! OK, so I copied your code from above and it's sort of working. I apparently had something wrong but I'm not even sure what it was now since I've made so many changes. The issue now is, on the actual email, I have the delivery name but just above that it says "EMAIL_TEXT_DELIVERY_ADDRESS" and I'd like to make that say something like "Your order shipping to:" I'm thinking I have to change that in the language files? Link to comment Share on other sites More sharing options...
gayla Posted January 18, 2007 Author Share Posted January 18, 2007 I added - define('EMAIL_TEXT_DELIVERY_ADDRESS', 'This order is shipping to:'); to admin/includes/languages/english/orders.php all by myself! And, it works! Thanks again for all your help! Link to comment Share on other sites More sharing options...
davidinottawa Posted January 19, 2007 Share Posted January 19, 2007 define('EMAIL_TEXT_DELIVERY_ADDRESS', 'This order is shipping to:');to admin/includes/languages/english/orders.php all by myself! Thanks again for all your help! LOL - well done! :-) no problem. d Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.