tigergirl Posted July 5, 2007 Share Posted July 5, 2007 I've searched but can't find anything (we've all been there!) The scenario: Customer creates account with email address [email protected] and places an order. The welcome emails and order confirmations emails have been sent to an incorrect email address and have bounced back. The customer realises they made a mistake so they change their email address to [email protected]. BUT - any order update emails still go to the email address [email protected], despite the customer having changed their email address. This does not make sense to me - please can someone help me fix this problem??? It's really important that once a customer changes email address, order update emails should be sent to the current email address, not the one that was used before the order was placed. In this instance, I knew there was a problem because of the bounced mails and I happened to notice that the email was different under the customers details compared to the order. I worry that I may not notice in future and customers won't get the emails and the high standard slips and I lose customers. thanks folks 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 Link to comment Share on other sites More sharing options...
tigergirl Posted July 5, 2007 Author Share Posted July 5, 2007 I can see in the order table in the database that the order still has the old email address recorded. I have no idea how to update the database manually - BUT I still think the order page should be updated with the most recent email address that the customer has entered so that order update emails go to the current email address. thanks for reading - hope someone can help... Tiger 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 Link to comment Share on other sites More sharing options...
rafiq_qc Posted July 5, 2007 Share Posted July 5, 2007 I've searched but can't find anything (we've all been there!) The scenario: Customer creates account with email address [email protected] and places an order. The welcome emails and order confirmations emails have been sent to an incorrect email address and have bounced back. The customer realises they made a mistake so they change their email address to [email protected]. BUT - any order update emails still go to the email address [email protected], despite the customer having changed their email address. This does not make sense to me - please can someone help me fix this problem??? It's really important that once a customer changes email address, order update emails should be sent to the current email address, not the one that was used before the order was placed. In this instance, I knew there was a problem because of the bounced mails and I happened to notice that the email was different under the customers details compared to the order. I worry that I may not notice in future and customers won't get the emails and the high standard slips and I lose customers. thanks folks Tigergirl hi, How a customer will update their e-mail address? Without admin how customer will change their permanent information. Can u tell me?U can go admin & see customer information. customers->customers & change Link to comment Share on other sites More sharing options...
tigergirl Posted July 5, 2007 Author Share Posted July 5, 2007 hi,How a customer will update their e-mail address? Without admin how customer will change their permanent information. Can u tell me?U can go admin & see customer information. customers->customers & change Hi, the customer updated their email address in their account. If I look in admin under the customers info, the email address is the correct updated one. But, if I look at the order page, the old email address shows, and that's where the order update emails are being sent. This does not fill me with confidence as I won't be able to keep track of email changes. Surely OSC should be using the current email address to send out order update emails??? Tiger 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 Link to comment Share on other sites More sharing options...
tigergirl Posted July 7, 2007 Author Share Posted July 7, 2007 Hi,the customer updated their email address in their account. If I look in admin under the customers info, the email address is the correct updated one. But, if I look at the order page, the old email address shows, and that's where the order update emails are being sent. This does not fill me with confidence as I won't be able to keep track of email changes. Surely OSC should be using the current email address to send out order update emails??? Tiger I'm rephrasing to see if anyone knows what I'm banging on about: How do I ensure that the order update emails get sent to the customers current email address?? Seems like the email address is implanted into the database at the time of order - when the email address is changed - the order still has the old email address. 1) Do I need to do a query in phpmyadmin to update the email address in the order? 2) Or can I re-code the files to re-call the current email address for the customer when order update emails are sent? 2 would be my preffered solution. Please can someone offer a solution? thank you Tiger 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 Link to comment Share on other sites More sharing options...
djmonkey1 Posted July 7, 2007 Share Posted July 7, 2007 The customer email address for each order is stored independently within the information for each order in the orders table and has no relation to the customers email address stored in the customers table. I recommend using Order Editor to edit the information of existing orders (3.0.2.1 is the most up to date release): http://www.oscommerce.com/community/contributions,1435 Do, or do not. There is no try. Order Editor 5.0.6 "Ultra Violet" is now available! For support or to post comments, suggestions, etc, please visit the Order Editor support thread. Link to comment Share on other sites More sharing options...
Guest Posted July 7, 2007 Share Posted July 7, 2007 you could use the order editor as Stew suggested, is a good one (although I would prefer an alternative instead of always forcing AJAX) In any case for the regular orders.php script you could change the code from: $order_updated = false; $check_status_query = tep_db_query("select customers_name, customers_email_address, orders_status, date_purchased from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'"); $check_status = tep_db_fetch_array($check_status_query); to $order_updated = false; $check_status_query = tep_db_query("select customers_id, customers_name, customers_email_address, orders_status, date_purchased from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'"); $check_status = tep_db_fetch_array($check_status_query); $email_query = tep_db_query("select customers_email_address from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$check_status['customers_id'] . "'"); if( $email_array = tep_db_fetch_array($email_query) ) { $check_status['customers_email_address'] = $email_array['customers_email_address']; } This should cover for cases where the customer is deleted. In which case the order's table email address will be used Link to comment Share on other sites More sharing options...
djmonkey1 Posted July 7, 2007 Share Posted July 7, 2007 you could use the order editor as Stew suggested, is a good one (although I would prefer an alternative instead of always forcing AJAX) If you are referring to the use of AJAX only for the "Add a Product" function, an update for this is in the works. Do, or do not. There is no try. Order Editor 5.0.6 "Ultra Violet" is now available! For support or to post comments, suggestions, etc, please visit the Order Editor support thread. Link to comment Share on other sites More sharing options...
Guest Posted July 7, 2007 Share Posted July 7, 2007 If you are referring to the use of AJAX only for the "Add a Product" function, an update for this is in the works. Yes, great, thank you very much. Link to comment Share on other sites More sharing options...
tigergirl Posted July 8, 2007 Author Share Posted July 8, 2007 thanks guys, djmonkey - I will keep Order Editor in mind for the future but looking for a quick fix at the moment. What is AJAX? enigma - need a little clarification about the code where you say This should cover for cases where the customer is deleted. In which case the order's table email address will be used Are you saying that for the order update email notifications, the code you give will take the customers email address from the customers table (instead of the order table) but if the customer has been deleted, the email address will be taken from the order table? thanks so much 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 Link to comment Share on other sites More sharing options...
djmonkey1 Posted July 8, 2007 Share Posted July 8, 2007 thanks guys,djmonkey - I will keep Order Editor in mind for the future but looking for a quick fix at the moment. What is AJAX? It's the technology that Order Editor uses for its "Add a Product" feature- the use of it allows the user to just type all or part of the item name or model in the search box and potential matches are displayed without any further input (ie you don't have to push a button). The problem that Mark mentioned is that right now the "Add a Product" feature is AJAX only, so if you're using a browser that doesn't support it (in my experience this is rare) the feature doesn't work at all. AJAX is powerful and you can do a lot of cool things with it, but since the "J" stands for JavaScript and end-users can turn JavaScript off, not everyone can use it. enigma - need a little clarification about the code where you say Are you saying that for the order update email notifications, the code you give will take the customers email address from the customers table (instead of the order table) but if the customer has been deleted, the email address will be taken from the order table? thanks so much Tigergirl I'm not Mark but I would say the answer to your question is yes. To my eyes the code he posted is excellent. Do, or do not. There is no try. Order Editor 5.0.6 "Ultra Violet" is now available! For support or to post comments, suggestions, etc, please visit the Order Editor support thread. Link to comment Share on other sites More sharing options...
tigergirl Posted July 8, 2007 Author Share Posted July 8, 2007 Hi djmonkey, thanks for the headsup on the AJAX definition - good to know as my IE6 is a bit iffy with java since an update (happened on my old PC too!), fine in Firefox though. I'll keep an eye out for your updated version. I'll see if enigma comes back with the clarification. thanks again 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 Link to comment Share on other sites More sharing options...
Guest Posted July 8, 2007 Share Posted July 8, 2007 yes it is as Stew mentioned. Link to comment Share on other sites More sharing options...
tigergirl Posted July 9, 2007 Author Share Posted July 9, 2007 Thank you SO MUCH enigma, that bit of code works perfectly for admin/orders.php. from:CODE $order_updated = false; $check_status_query = tep_db_query("select customers_name, customers_email_address, orders_status, date_purchased from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'"); $check_status = tep_db_fetch_array($check_status_query); to CODE $order_updated = false; $check_status_query = tep_db_query("select customers_id, customers_name, customers_email_address, orders_status, date_purchased from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'"); $check_status = tep_db_fetch_array($check_status_query); $email_query = tep_db_query("select customers_email_address from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$check_status['customers_id'] . "'"); if( $email_array = tep_db_fetch_array($email_query) ) { $check_status['customers_email_address'] = $email_array['customers_email_address']; } I feel I have opened a can of worms now though. Is there a way to show which email address each order update email was sent to? i.e. a column for email address used next to "Customer Notified" column. I just feel there is no way to tell where it's been sent now because the order still displays the original email address at time of order. Why was I made so fussy? Perfectionism is a pain in the butt sometimes... enigma, you put a lot into this forum, much appreciated, I would say you should get out more but we need you on here so thanks! Tiger 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 Link to comment Share on other sites More sharing options...
djmonkey1 Posted July 9, 2007 Share Posted July 9, 2007 Thank you SO MUCH enigma,that bit of code works perfectly for admin/orders.php. I feel I have opened a can of worms now though. Is there a way to show which email address each order update email was sent to? i.e. a column for email address used next to "Customer Notified" column. I just feel there is no way to tell where it's been sent now because the order still displays the original email address at time of order. Why was I made so fussy? Perfectionism is a pain in the butt sometimes... enigma, you put a lot into this forum, much appreciated, I would say you should get out more but we need you on here so thanks! Tiger Run the following command on your database: ALTER TABLE orders_status_history ADD customer_email_used VARCHAR( 96 ) NULL; Next in admin/orders.php find tep_db_query("insert into " . TABLE_ORDERS_STATUS_HISTORY . " (orders_id, orders_status_id, date_added, customer_notified, comments) values ('" . (int)$oID . "', '" . tep_db_input($status) . "', now(), '" . tep_db_input($customer_notified) . "', '" . tep_db_input($comments) . "')"); and change it to tep_db_query("insert into " . TABLE_ORDERS_STATUS_HISTORY . " (orders_id, orders_status_id, date_added, customer_notified, customer_email_used, comments) values ('" . (int)$oID . "', '" . tep_db_input($status) . "', now(), '" . tep_db_input($customer_notified) . "', '" . tep_db_input($check_status['customers_email_address']) . "', '" . tep_db_input($comments) . "')"); Next in admin/orders.php find <tr> <td class="smallText" align="center"><b><?php echo TABLE_HEADING_DATE_ADDED; ?></b></td> <td class="smallText" align="center"><b><?php echo TABLE_HEADING_CUSTOMER_NOTIFIED; ?></b></td> <td class="smallText" align="center"><b><?php echo TABLE_HEADING_STATUS; ?></b></td> <td class="smallText" align="center"><b><?php echo TABLE_HEADING_COMMENTS; ?></b></td> </tr> <?php $orders_history_query = tep_db_query("select orders_status_id, date_added, customer_notified, comments from " . TABLE_ORDERS_STATUS_HISTORY . " where orders_id = '" . tep_db_input($oID) . "' order by date_added"); if (tep_db_num_rows($orders_history_query)) { while ($orders_history = tep_db_fetch_array($orders_history_query)) { echo ' <tr>' . "\n" . ' <td class="smallText" align="center">' . tep_datetime_short($orders_history['date_added']) . '</td>' . "\n" . ' <td class="smallText" align="center">'; if ($orders_history['customer_notified'] == '1') { echo tep_image(DIR_WS_ICONS . 'tick.gif', ICON_TICK) . "</td>\n"; } else { echo tep_image(DIR_WS_ICONS . 'cross.gif', ICON_CROSS) . "</td>\n"; } echo ' <td class="smallText">' . $orders_status_array[$orders_history['orders_status_id']] . '</td>' . "\n" . ' <td class="smallText">' . nl2br(tep_db_output($orders_history['comments'])) . ' </td>' . "\n" . ' </tr>' . "\n"; } } else { echo ' <tr>' . "\n" . ' <td class="smallText" colspan="5">' . TEXT_NO_ORDER_HISTORY . '</td>' . "\n" . ' </tr>' . "\n"; } and change it to <tr> <td class="smallText" align="center"><b><?php echo TABLE_HEADING_DATE_ADDED; ?></b></td> <td class="smallText" align="center"><b><?php echo TABLE_HEADING_CUSTOMER_NOTIFIED; ?></b></td> <td class="smallText" align="center"><b><?php echo TABLE_HEADING_CUSTOMER_EMAIL_USED; ?></b></td> <td class="smallText" align="center"><b><?php echo TABLE_HEADING_STATUS; ?></b></td> <td class="smallText" align="center"><b><?php echo TABLE_HEADING_COMMENTS; ?></b></td> </tr> <?php $orders_history_query = tep_db_query("select orders_status_id, date_added, customer_notified, customer_email_used, comments from " . TABLE_ORDERS_STATUS_HISTORY . " where orders_id = '" . tep_db_input($oID) . "' order by date_added"); if (tep_db_num_rows($orders_history_query)) { while ($orders_history = tep_db_fetch_array($orders_history_query)) { echo ' <tr>' . "\n" . ' <td class="smallText" align="center">' . tep_datetime_short($orders_history['date_added']) . '</td>' . "\n" . ' <td class="smallText" align="center">'; if ($orders_history['customer_notified'] == '1') { echo tep_image(DIR_WS_ICONS . 'tick.gif', ICON_TICK) . "</td>\n"; } else { echo tep_image(DIR_WS_ICONS . 'cross.gif', ICON_CROSS) . "</td>\n"; } echo ' <td class="smallText">' . $orders_history['customer_email_used'] . '</td>' . "\n" . ' <td class="smallText">' . $orders_status_array[$orders_history['orders_status_id']] . '</td>' . "\n" . ' <td class="smallText">' . nl2br(tep_db_output($orders_history['comments'])) . ' </td>' . "\n" . ' </tr>' . "\n"; } } else { echo ' <tr>' . "\n" . ' <td class="smallText" colspan="5">' . TEXT_NO_ORDER_HISTORY . '</td>' . "\n" . ' </tr>' . "\n"; } Finally in admin/includes/languages/english/orders.php add the following line of code: define('TABLE_HEADING_CUSTOMER_EMAIL_USED', 'Customer email used'); Do, or do not. There is no try. Order Editor 5.0.6 "Ultra Violet" is now available! For support or to post comments, suggestions, etc, please visit the Order Editor support thread. Link to comment Share on other sites More sharing options...
tigergirl Posted July 12, 2007 Author Share Posted July 12, 2007 djmonkey, you rock! Fabbytastic piece of coding - just what I was after. thank you both for your excellent help. 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 Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.