Vestax Posted March 10, 2004 Share Posted March 10, 2004 Hi all, I'm trying to send different emails depending on the order status. Thus, when I adjust the order status in the OSC Admin, I want orders.php to send two different emails, one when the order is being processed and one when the order is actually sent to the customer. Unfortunately my php knowledge is not good enough to solve it on my own. This is the code I have now (in admin/orders.php): (starting line is 46) $customer_notified = '0'; if (isset($HTTP_POST_VARS['notify']) && ($HTTP_POST_VARS['notify'] == 'on')) { $notify_comments = ''; if (isset($HTTP_POST_VARS['notify_comments']) && ($HTTP_POST_VARS['notify_comments'] == 'on')) { $notify_comments = sprintf(EMAIL_TEXT_COMMENTS_UPDATE, $comments) . "\n\n"; } if (&orders_status_array[&status] == "In behandeling") { $email = "This is a test line to identify mail" . "\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]); } 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']) . "\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); So, the if statement is supposed to see if my order status is "In behandeling" (it's dutch) or if it's any other (that would be the sent status), and then format the emails depending on the order status. (I've included the http_post_vars code on top (first alinea of code) for clarity, beneath that the actual email formatting happens. Could anyone please help me with this if statement? Thanks alot! Vestax Link to comment Share on other sites More sharing options...
Vestax Posted March 10, 2004 Author Share Posted March 10, 2004 By the way, I'm getting a parse error when exectuging orders.php, on the line where my if statement starts. Link to comment Share on other sites More sharing options...
Vestax Posted March 10, 2004 Author Share Posted March 10, 2004 Well, I've got it to work, misspelled something. For the people who want to know what went wrong: if (&orders_status_array[&status] == "In behandeling") { has to be: if ($orders_status_array[$status] == "In behandeling") { Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.