Re: extended order status with email notifications
OK so I followed the instructions in the first post, but when I got to mod3 of func, which is actually in /include/func/func.order.php I amended the code to look like this...
Quote:
// send email notifications to admin
if($config['Email_Note']['eml_oa_notif_failed'] == 'Y'){
$mail_smarty->assign("show_order_details", "Y");
func_send_mail($config["Company"]["orders_department"], "mail/order_admin_failed_subj.tpl", "mail/order_admin_failed.tpl", $config["Company"]["orders_department"], true, true);
$mail_smarty->assign("show_order_details", "");
}
}
elseif ($status == "C" && $order["status"] != "C") {
func_complete_order($orderid);
}
if ($status == "B" && $order["status"] != "B") {
$userinfo =$order_data["userinfo"];
$to_customer = ($userinfo['language']?$userinfo['language']:$config['default_customer_language']);
$mail_smarty->assign("products", func_translate_products($order_data["products"], $to_customer));
$mail_smarty->assign("order", $order);
$mail_smarty->assign("customer", $userinfo);
if ($config['Email_Note']['eml_oc_notif_backordered'] == 'Y'){
func_send_mail($userinfo['email'],"mail/order_customer_backordered_subj.tpl", "mail/order_customer_backordered.tpl", $config["Company"]["orders_department"], false);
}
if ($status == "S" && $order["status"] != "S") {
$userinfo =$order_data["userinfo"];
$to_customer = ($userinfo['language']?$userinfo['language']:$config['default_customer_language']);
$mail_smarty->assign("products", func_translate_products($order_data["products"], $to_customer));
$mail_smarty->assign("order", $order);
$mail_smarty->assign("customer", $userinfo);
if ($config['Email_Note']['eml_oc_notif_process_shipping'] == 'Y')
func_send_mail($userinfo['email'],"mail/order_customer_process_shipping_subj.tpl", "mail/order_customer_process_shipping.tpl", $config["Company"]["orders_department"], false);
}
if ($status == "K" && $order["status"] != "K") {
$userinfo =$order_data["userinfo"];
$to_customer = ($userinfo['language']?$userinfo['language']:$config['default_customer_language']);
$mail_smarty->assign("products", func_translate_products($order_data["products"], $to_customer));
$mail_smarty->assign("order", $order);
$mail_smarty->assign("customer", $userinfo);
if ($config['Email_Note']['eml_oc_notif_back_in_stock'] == 'Y')
func_send_mail($userinfo['email'],"mail/order_customer_back_in_stock_subj.tpl", "mail/order_customer_back_in_stock.tpl", $config["Company"]["orders_department"], false);
}
if ($status == "R" && $order["status"] != "R") {
$userinfo =$order_data["userinfo"];
$to_customer = ($userinfo['language']?$userinfo['language']:$config['default_customer_language']);
$mail_smarty->assign("products", func_translate_products($order_data["products"], $to_customer));
$mail_smarty->assign("order", $order);
$mail_smarty->assign("customer", $userinfo);
if ($config['Email_Note']['eml_oc_notif_process_return'] == 'Y')
func_send_mail($userinfo['email'],"mail/order_customer_process_return_subj.tpl", "mail/order_customer_process_return.tpl", $config["Company"]["orders_department"], false);
}
if ($status == "U" && $order["status"] != "U") {
$userinfo =$order_data["userinfo"];
$to_customer = ($userinfo['language']?$userinfo['language']:$config['default_customer_language']);
$mail_smarty->assign("products", func_translate_products($order_data["products"], $to_customer));
$mail_smarty->assign("order", $order);
$mail_smarty->assign("customer", $userinfo);
if ($config['Email_Note']['eml_oc_notif_refunded'] == 'Y')
func_send_mail($userinfo['email'],"mail/order_customer_refunded_subj.tpl", "mail/order_customer_refunded.tpl", $config["Company"]["orders_department"], false);
|
You also need to make sure you add all the codes so that about a screen and a half upwards you get the following:
Quote:
# This function change order status in orders table
#
function func_change_order_status($orderids, $status, $advinfo="") {
global $config, $mail_smarty, $active_modules, $current_area;
global $sql_tbl;
global $session_failed_transaction;
$allowed_order_status = 'IQPBDFCXSRUK';
if (!strstr($allowed_order_status, $status))
return;
|
It's the allowed order status bit you need to match to your new statuses.
I hope that helps, alternatively if anyone wants a copy of my func.order.php to do a compare on then just ask and I will send it to you.
It's been a while since I updated this mod to make it work and I really should have documented it at the time, but it has worked flawlessly for me since I did it.
__________________
Chris Barber
Version 4.1.9
MOD - BCSE Shipping Estimator
MOD - Shopzilla Feed
MOD - Price Match with Captcha
MOD - Links Manager 2008
MOD - One Page Checkout
MOD - Sitemap
|