Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

extended order status with email notifications

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 04-10-2005, 02:15 PM
 
x-light x-light is offline
 

Member
  
Join Date: Mar 2005
Posts: 29
 

Default extended order status with email notifications

Hi all,

I have seen requests and solutions for bits and pieces of various order status along with email notifications all over the forum. I was also in need of this so I added more order status along with email notifications which can be enabled or disabled from email notificaitons menu in general settings from admin. This was modified for Version 4.0.13, but I imagine it should work with 4.xx unless there was some major changes to include/func.php 4.xx versions.

The functions are complete but the body of each email template is quite generic, just showing the order id, date and invoice. It would be nice to customize each template for each status to make it more meaniful for the customers. I don't have time to do this right now, however, if you already have something like this for various statuses shown below, I am sure everyone would appreciate it if you share your template code.

I am posting this mod in hope that everyone could benefit from this. It would be great if others can post additions to this mod of other status I haven't thought about or detailed HTML email templates for some of these status. Enjoy.

~x-light
---------- readme.txt ----------
Description: This mod adds additional order status along with email notifications to either customer and/or administrators. These notifications can also be enabled or disabled via the email notifications.

Key feature:
* added the following status
- cancelled, process shipping, back in stock, process return, refunded, fraud
* the cancel status has the same logic as declined or failed, that is quantities are automatically updated and/or coupons, giftcerts are rolled back
* the shipping has the same logic as queued, processed, or complete
* moved existing email options related with order under Order Notifications Options starting at orderby number 2000
(check update_tables.sql for details)

To Do:
* modify the body of the email templates to make each status message more meaniful to customers and administrators
* add body of the email templates for plain text (not really needed right now)

Modified for X-Cart Gold: Version 4.0.13 stock

Tested with: Version 4.0.13 stock
Apache 1.33, OpenSSL 0.9.6b, PHP 4.3.10, SQL 4.0.22

Intended Audience: This mod requires changes to various php, tpl files and some
sql table(s) as well as outlined in "General Overview" below. If you are a
store owner and have met the requirements for the modified and tested X-Cart
versions, you can follow the instructions below and it should work. However, if
you intend to make this mod work with previous X-Cart versions or make any
changes to this mod, it is recommended that you hire a developer with
development and coding knowledge to perform this task.

Disclaimer: This mod may work on other X-Cart versions, but it has not been
tested. Therefore, use it at your own risk. We are not responsible for any loss
in sales, time spent or damages that is direct or indirectly caused by this
modification to your store. By using this modification, you have agreed all the
terms to the license agreement and hold all personel indemfiable and harmless
including but not limited to owners, shareholders, stakeholders, employees,
contractors, or anyone else related to the business.

License: Standard Open Source / Freeware

As usual, always backup your current store or try it on a development store
before integrating this with production.

General Overview:

sql table modification
xcart_config
files modified application logic related:
include/func.php
template related:
skin1\main\order\order_status.tpl
various tpl files in skin1\mail
various tpl files in skin1\mail\html
language files:
lang.txt.csv (comma delimited)

each code section which has been modified has the comment header:
mod.extended.order.status

Instructions:

Prerequisites:
BACKUP, BACKUP, BACKUP!!

Installation:

1. update sql table using ssh or sql patch from admin menu
If using ssh, issue command:
"mysql -u username -p dbname < update_tables.sql"
If using sql patch just upload the update_tables.sql file

2. modify code
a. match the code section under the "find original code snippet" and "end original code snippet" with your source
b. replace original code section with the code section under the "replace modified code snippet"

3. repeat step 2 for each php and template files until all are done

4. import the language file used in this modifications "lang.txt.csv" under language settings in admin
---------- update_tables.sql ----------
Code:
# this script will update the 'orderby' field for all order status and # add new email notifications status records for new email notifications # table(s) affected # xcart_config # field(s) affected # orderby # update 'orderby' first UPDATE xcart_config SET orderby = '2010' where name = 'enable_init_order_notif_customer'; UPDATE xcart_config SET orderby = '2011' where name = 'enable_init_order_notif'; UPDATE xcart_config SET orderby = '2012' where name = 'send_notifications_to_provider'; UPDATE xcart_config SET orderby = '2015' where name = 'eml_order_p_notif_customer'; UPDATE xcart_config SET orderby = '2016' where name = 'eml_order_p_notif_admin'; UPDATE xcart_config SET orderby = '2017' where name = 'eml_order_p_notif_provider'; UPDATE xcart_config SET orderby = '2025' where name = 'eml_order_c_notif_customer'; UPDATE xcart_config SET orderby = '2035' where name = 'eml_order_d_notif_customer'; # new records INSERT INTO xcart_config (name,comment,value,category,orderby,type,defvalue) VALUES ('eml_order_notif_header',':__________Order Notification Options__________','N','Email_Note',2000,'','N'); INSERT INTO xcart_config (name,comment,value,category,orderby,type,defvalue) VALUES ('eml_oc_notif_process_shipping','\'Order in process shipping\' notification to customer','Y','Email_Note',2020,'checkbox','Y'); INSERT INTO xcart_config (name,comment,value,category,orderby,type,defvalue) VALUES ('eml_oc_notif_backordered','\'Order is backordered\' notification to customer','Y','Email_Note',2030,'checkbox','Y'); INSERT INTO xcart_config (name,comment,value,category,orderby,type,defvalue) VALUES ('eml_oc_notif_back_in_stock','\'Order is back in stock\' notification to customer','Y','Email_Note',2040,'checkbox','Y'); INSERT INTO xcart_config (name,comment,value,category,orderby,type,defvalue) VALUES ('eml_oc_notif_failed','\'Order has failed\' notification to customer','Y','Email_Note',2045,'checkbox','Y'); INSERT INTO xcart_config (name,comment,value,category,orderby,type,defvalue) VALUES ('eml_oa_notif_failed','\'Order has failed\' notification to orders department','Y','Email_Note',2046,'checkbox','Y'); INSERT INTO xcart_config (name,comment,value,category,orderby,type,defvalue) VALUES ('eml_oc_notif_cancelled','\'Order is cancelled\' notification to customer','Y','Email_Note',2050,'checkbox','Y'); INSERT INTO xcart_config (name,comment,value,category,orderby,type,defvalue) VALUES ('eml_oa_notif_cancelled','\'Order is cancelled\' notification to orders department','Y','Email_Note',2051,'checkbox','Y'); INSERT INTO xcart_config (name,comment,value,category,orderby,type,defvalue) VALUES ('eml_oc_notif_process_return','\'Order is being processed for return\' notification to customer','Y','Email_Note',2055,'checkbox','Y'); INSERT INTO xcart_config (name,comment,value,category,orderby,type,defvalue) VALUES ('eml_oc_notif_refunded','\'Order return accepted\' notification to customer','Y','Email_Note',2060,'checkbox','Y');
---------- lng.txt.csv ----------
Code:
"txt_thankyou_for","Thank-You for","Thank-You for","Text" "txt_tracking","Tracking","Tracking","Text" "txt_oa_processed","Processed","Processed","Text" "txt_oc_process_shipping","is scheduled for shipping","is scheduled for shipping","Text" "txt_oc_complete","has shipped!","has shipped!","Text" "txt_oc_backordered","item(s) out of stock","item(s) out of stock","Text" "txt_oc_back_in_stock","item(s) now in stock!","item(s) now in stock!","Text" "txt_oc_cancelled","has been cancelled","has been cancelled","Text" "txt_oa_cancelled","Cancelled","Cancelled","Text" "txt_oc_failed","unable to process","unable to process","Text" "txt_oa_failed","Failed","Failed","Text" "txt_oc_process_return","your return is being processed","your return is being processed","Text" "txt_oc_refunded","your return has been accepted","your return has been accepted","Text" "lbl_shipping","Shipping","Shipping","Labels" "lbl_back_in_stock","Back In Stock","Back In Stock","Labels" "lbl_cancelled","Cancelled","Cancelled","Labels" "lbl_process_return","Process Return","Process Return","Labels" "lbl_refunded","Refunded","Refunded","Labels" "lbl_fraud","Fraud","Fraud","Labels"
---------- main/order_status.tpl
Code:
{* $Id: order_status.tpl,v 1.4 2004/05/28 12:21:03 max Exp $ *} {if $extended eq "" and $status eq ""} {$lng.lbl_wrong_status} {else} {if $mode eq "select"} <SELECT name="{$name}" {$extra}> {if $extended ne ""}<OPTION value=""></OPTION>{/if} <OPTION value="I" {if $status eq "I"}selected{/if}>{$lng.lbl_not_finished}</OPTION> <OPTION value="Q" {if $status eq "Q"}selected{/if}>{$lng.lbl_queued}</OPTION> <OPTION value="P" {if $status eq "P"}selected{/if}>{$lng.lbl_processed}</OPTION> {* mod.extended.order.status *} <OPTION value="S" {if $status eq "S"}selected{/if}>{$lng.lbl_shipping}</OPTION> <OPTION value="C" {if $status eq "C"}selected{/if}>{$lng.lbl_complete}</OPTION> <OPTION value="B" {if $status eq "B"}selected{/if}>{$lng.lbl_backordered}</OPTION> <OPTION value="K" {if $status eq "K"}selected{/if}>{$lng.lbl_back_in_stock}</OPTION> <OPTION value="D" {if $status eq "D"}selected{/if}>{$lng.lbl_declined}</OPTION> <OPTION value="F" {if $status eq "F"}selected{/if}>{$lng.lbl_failed}</OPTION> {* mod.extended.order.status *} <OPTION value="X" {if $status eq "X"}selected{/if}>{$lng.lbl_cancelled}</OPTION> <OPTION value="R" {if $status eq "R"}selected{/if}>{$lng.lbl_process_return}</OPTION> <OPTION value="U" {if $status eq "U"}selected{/if}>{$lng.lbl_refunded}</OPTION> <OPTION value="Z" {if $status eq "Z"}selected{/if}>{$lng.lbl_fraud}</OPTION> </SELECT> {elseif $mode eq "static"} {* mod.extended.order.status *} {if $status eq "I"}{$lng.lbl_not_finished}{elseif $status eq "Q"}{$lng.lbl_queued}{elseif $status eq "P"}{$lng.lbl_processed}{elseif $status eq "S"}{$lng.lbl_shipping}{elseif $status eq "C"}{$lng.lbl_complete}{elseif $status eq "B"}{$lng.lbl_backordered}{elseif $status eq "K"}{$lng.lbl_back_in_stock}{elseif $status eq "D"}{$lng.lbl_declined}{elseif $status eq "F"}{$lng.lbl_failed}{elseif $status eq "X"}{$lng.lbl_cancelled}{elseif $status eq "R"}{$lng.lbl_process_return}{elseif $status eq "U"}{$lng.lbl_refunded}{elseif $status eq "Z"}{$lng.lbl_fraud}{/if} {*{if $status eq "I"}{$lng.lbl_not_finished}{elseif $status eq "Q"}{$lng.lbl_queued}{elseif $status eq "P"}{$lng.lbl_processed}{elseif $status eq "D"}{$lng.lbl_declined}{elseif $status eq "B"}{$lng.lbl_backordered}{elseif $status eq "F"}{$lng.lbl_failed}{elseif $status eq "C"}{$lng.lbl_complete}{/if}*} {/if} {/if}
---------- include/func.php ----------
Code:
---------- mod1 // find original code snippet in "function func_place_order..." # # Mail template processing # $admin_notify = (($order_status == "Q") || ($order_status == "I" && $config["Email_Note"]["enable_init_order_notif"] == "Y")); $customer_notify = (($order_status == "Q") || ($order_status == "I" && $config["Email_Note"]["enable_init_order_notif_customer"] == "Y")); // end original code snippet // replace modified code snippet # # Mail template processing # $admin_notify = (($order_status == "Q") || ($order_status == "I" && $config["Email_Note"]["enable_init_order_notif"] == "Y")); # mod.extended.order.status, force to check send email on initial order for customer $customer_notify = (($order_status == "Q" || $order_status == "I") && $config["Email_Note"]["enable_init_order_notif_customer"] == "Y"); // end modified code snippet ---------- mod 2 // find original code snippet in "function func_change_order_status..." elseif($status == "D" && $order["status"] != "D" && $order["status"] != "F") { func_decline_order($orderid, $status); } elseif($status == "F" && $order["status"] != "F" && $order["status"] != "D") { func_update_quantity($order_data["products"]); if($current_area == 'C') $session_failed_transaction++; } // end original code snippet // replace modified code snippet # mod.extended.order.status, add check for cancel elseif(($status == "D" && $order["status"] != "D" && $order["status"] != "F") || ($status == "X" && $order["status"] != "X" && $order["status"] != "D" && $order["status"] != "F")){ func_decline_order($orderid, $status); } # mod.extended.order.status, add check for cancel elseif(($status == "F" && $order["status"] != "F" && $order["status"] != "D" && $order["status"] != "X")){ func_update_quantity($order_data["products"]); if($current_area == 'C') $session_failed_transaction++; # mod.extended.order.status, email notifications for fail $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); // send email notifications to customer if($config['Email_Note']['eml_oc_notif_failed'] == 'Y'){ func_send_mail($userinfo['email'],"mail/order_customer_failed_subj.tpl", "mail/order_customer_failed.tpl", $config["Company"]["orders_department"], false); } // 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", ""); } } // end modified code snippet ---------- mod 3 // find original code snippet in "function func_change_order_status..." elseif ($status == "C" && $order["status"] != "C") { func_complete_order($orderid); } // end original code snippet // replace modified code snippet elseif ($status == "C" && $order["status"] != "C") { func_complete_order($orderid); } # mod.extended.order.status, check extended status and send email notifications for shipping, backordered, # back in stock, process_return, refunded if($status == "S" || $status == "B" || $status == "K" || $status == "R" || $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); } switch($status){ //(S)hipping case "S": if ($order["status"] != "S") { 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); } break; //(B)ackordered case "B": if ($order["status"] != "B") { 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); } break; //(K) Back in Stock case "K": if ($order["status"] != "K") { 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); } break; //(R) Process Return case "R": if ($order["status"] != "R") { 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); } break; //(U) Refunded case "U": if ($order["status"] != "U") { 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); } break; default: break; } // switch // end modified code snippet ---------- mod 4 // find original code snippet in "function func_change_order_status..." # # Decrease quantity in stock when "declined" or "failed" order is became "completed", "processed" or "queued" # if ($status != $order["status"] && strpos("DF",$order["status"])!==false && strpos("CPQ",$status)!==false) { func_update_quantity($order_data["products"],false); } // end original code snippet // replace modified code snippet # # Decrease quantity in stock when "declined" or "failed" order is became "completed", "processed" or "queued" # # mod.extended.order.status, added cancelled and shipping to this check if ($status != $order["status"] && strpos("DFX",$order["status"])!==false && strpos("CPQS",$status)!==false) { func_update_quantity($order_data["products"],false); } // end modified code snippet ---------- mod 5 // find original code snippet in "function func_process_order..." if($config['Email_Note']['eml_order_p_notif_admin'] == 'Y') { func_send_mail($config["Company"]["orders_department"], "mail/order_notification_subj.tpl", "mail/order_notification_admin.tpl", $config["Company"]["orders_department"], true, true); } // end original code snippet // replace modified code snippet if($config['Email_Note']['eml_order_p_notif_admin'] == 'Y') { # mod.extended.order.status, changed email template for processed func_send_mail($config["Company"]["orders_department"], "mail/order_admin_processed_subj.tpl", "mail/order_admin_processed.tpl", $config["Company"]["orders_department"], true, true); } // end modified code snippet ---------- mod 6 // find original code snippet in "function func_decline_order..." if(($status != "D") && ($status != "F")) return; // end original code snippet // replace modified code snippet # mod.extended.order.status, permit cancel if(($status != "D") && ($status != "F") && ($status != "X")) return; // end modified code snippet ---------- mod 7 // find original code snippet in "function func_decline_order..." if($status == "D") { $mail_smarty->assign("customer",$userinfo); $mail_smarty->assign("products",$products); $mail_smarty->assign("giftcerts",$giftcerts); $mail_smarty->assign("order",$order); if($config['Email_Note']['eml_order_d_notif_customer'] == 'Y') { $to_customer = func_query_first_cell ("SELECT language FROM $sql_tbl[customers] WHERE login='$userinfo[login]'"); if(empty($to_customer)) $to_customer = $config['default_customer_language']; $mail_smarty->assign("products", func_translate_products($products, $to_customer)); func_send_mail($userinfo["email"], "mail/decline_notification_subj.tpl","mail/decline_notification.tpl", $config["Company"]["orders_department"], false); } } // end original code snippet // replace modified code snippet if($status == "D") { $mail_smarty->assign("customer",$userinfo); $mail_smarty->assign("products",$products); $mail_smarty->assign("giftcerts",$giftcerts); $mail_smarty->assign("order",$order); if($config['Email_Note']['eml_order_d_notif_customer'] == 'Y') { $to_customer = func_query_first_cell ("SELECT language FROM $sql_tbl[customers] WHERE login='$userinfo[login]'"); if(empty($to_customer)) $to_customer = $config['default_customer_language']; $mail_smarty->assign("products", func_translate_products($products, $to_customer)); func_send_mail($userinfo["email"], "mail/decline_notification_subj.tpl","mail/decline_notification.tpl", $config["Company"]["orders_department"], false); } } # mod.extended.order.status, send email notifications for cancel else if($status == "X"){ $mail_smarty->assign("customer",$userinfo); $mail_smarty->assign("products",$products); $mail_smarty->assign("giftcerts",$giftcerts); $mail_smarty->assign("order",$order); $to_customer = func_query_first_cell ("SELECT language FROM $sql_tbl[customers] WHERE login='$userinfo[login]'"); if(empty($to_customer)) $to_customer = $config['default_customer_language']; $mail_smarty->assign("products", func_translate_products($products, $to_customer)); // send email notification to customer if($config['Email_Note']['eml_oc_notif_cancelled'] == 'Y') { func_send_mail($userinfo["email"], "mail/order_customer_cancelled_subj.tpl","mail/order_customer_cancelled.tpl", $config["Company"]["orders_department"], false); } // send email notification to admin if($config['Email_Note']['eml_oc_notif_cancelled'] == 'Y') { $mail_smarty->assign("show_order_details", "Y"); func_send_mail($config["Company"]["orders_department"], "mail/order_admin_cancelled_subj.tpl", "mail/order_admin_cancelled.tpl", $config["Company"]["orders_department"], true, true); $mail_smarty->assign("show_order_details", ""); } } // end modified code snippet

---------- ALL EMAIL SUBJECT TEMPLATES (skin1/mail) ----------
---------- decline_notification_subj.tpl ----------
Code:
{* mod.extended.order.status *} {config_load file="$skin_config"}{$lng.lbl_your_order} #{$order.orderid} {$lng.eml_sbj_order_declined} {*{config_load file="$skin_config"}{$config.Company.company_name}: {$lng.lbl_your_order} #{$order.orderid} {$lng.eml_sbj_order_declined}*}
---------- order_admin_cancelled_subj.tpl ---------
Code:
{* mod.extended.order.status templates *} {config_load file="$skin_config"}{ $config.Company.company_name }: {$lng.lbl_order_receipt} #{$order.orderid} - {$lng.txt_oa_cancelled}
---------- order_admin_failed_subj.tpl ---------
Code:
{* mod.extended.order.status templates *} {config_load file="$skin_config"}{ $config.Company.company_name }: {$lng.lbl_order} #{$order.orderid} - {$lng.txt_oa_failed}
---------- order_admin_processed_subj.tpl ----------
Code:
{* mod.extended.order.status templates *} {config_load file="$skin_config"}{ $config.Company.company_name }: {$lng.lbl_order} #{$order.orderid} - {$lng.txt_oa_processed}
---------- order_cust_complete_subj.tpl ----------
Code:
{* mod.extended.order.status *} {config_load file="$skin_config"}{$lng.lbl_your_order} #{$order.orderid} {$lng.txt_oc_complete}{if $order.tracking} {$lng.txt_tracking} #{$order.tracking}{/if} {*{config_load file="$skin_config"}{ $config.Company.company_name }: {$lng.lbl_your_order} #{$order.orderid} {$lng.txt_has_been_complete}*}
---------- order_cust_processed_subj.tpl ----------
Code:
{* mod.extended.order.status *} {config_load file="$skin_config"}{$lng.lbl_your_order} #{$order.orderid} {$lng.txt_has_been_processed} {*{config_load file="$skin_config"}{ $config.Company.company_name }: {$lng.lbl_your_order} #{$order.orderid} {$lng.txt_has_been_processed}*}
---------- order_customer_back_in_stock_subj.tpl ----------
Code:
{* mod.extended.order.status templates *} {config_load file="$skin_config"}{$lng.lbl_your_order} #{$order.orderid}, {$lng.txt_oc_back_in_stock}
---------- order_customer_backordered_subj.tpl ----------
Code:
{* mod.extended.order.status templates *} {config_load file="$skin_config"}{$lng.lbl_your_order} #{$order.orderid}, {$lng.txt_oc_backordered}
---------- order_customer_cancelled_subj.tpl ----------
Code:
{* mod.extended.order.status templates *} {config_load file="$skin_config"}{$lng.lbl_your_order} #{$order.orderid} {$lng.txt_oc_cancelled}
---------- order_customer_failed_subj.tpl ----------
Code:
{* mod.extended.order.status templates *} {config_load file="$skin_config"}{$lng.lbl_your_order} #{$order.orderid}, {$lng.txt_oc_failed}
---------- order_customer_process_return_subj.tpl ----------
Code:
{* mod.extended.order.status templates *} {config_load file="$skin_config"}{$lng.lbl_your_order} #{$order.orderid}, {$lng.txt_oc_process_return}
---------- order_customer_process_shipping_subj.tpl ----------
Code:
{* mod.extended.order.status templates *} {config_load file="$skin_config"}{$lng.lbl_your_order} #{$order.orderid} {$lng.txt_oc_process_shipping}
---------- order_customer_refunded_subj.tpl ----------
Code:
{* mod.extended.order.status templates *} {config_load file="$skin_config"}{$lng.lbl_your_order} #{$order.orderid}, {$lng.txt_oc_refunded}
---------- order_customer_subj.tpl ----------
Code:
{* mod.extended.order.status *} {config_load file="$skin_config"}{$lng.txt_thankyou_for} {$lng.lbl_your_order|lower} #{$order.orderid} {*{config_load file="$skin_config"}{ $config.Company.company_name }: {$lng.lbl_order_receipt} #{$order.orderid}*}

---------- ALL HTML EMAIL BODY TEMPLATES (skin1/mail/html) ----------
Warning, some of these templates are hard coded in US language and rather incomplete. Please check them before using them in your real store!
---------- order_admin_cancelled.tpl ----------
Code:
{* mod.extended.order.status templates - order_admin_cancelled.tpl *} {* arthur: x-light *} {* work derived from Ruslan R. Fazliev, www.x-cart.com *} {* version 1.00, 4/08/05 *} {config_load file="$skin_config"} {include file="mail/html/mail_header.tpl"} {assign var=where value="A"} {$lng.eml_this_is_order} #{$order.orderid} - order cancelled Order has been cancelled either by admin or customer <HR size="1" noshade> <TABLE border="0" cellpadding="2" cellspacing="1" width="100%"> <TR> <TD width="20%">{$lng.lbl_order_id}:</TD> <TD width="10"></TD> <TD width="80%"><TT>#{$order.orderid}</TT></TD> </TR> <TR> <TD>{$lng.lbl_order_date}:</TD> <TD width="10"></TD> <TD><TT>{$order.date|date_format:$config.Appearance.datetime_format}</TT></TD> </TR> <TR> <TD colspan="3">{include file="mail/html/order_data.tpl"}</TD> </TR> </TABLE> {include file="mail/html/order_invoice.tpl" to_admin="Y"} {include file="mail/html/signature.tpl"}
---------- order_admin_failed.tpl ----------
Code:
{* mod.extended.order.status templates - order_admin_failed.tpl *} {* arthur: x-light *} {* work derived from Ruslan R. Fazliev, www.x-cart.com *} {* version 1.00, 4/08/05 *} {config_load file="$skin_config"} {include file="mail/html/mail_header.tpl"} {assign var=where value="A"} {$lng.eml_this_is_order} #{$order.orderid} - order failed Customer order failed for the following reasons: [*]list reason 1[*]list reason 2 {include file="mail/html/order_invoice.tpl" to_admin="Y"} {include file="mail/html/signature.tpl"}
---------- order_admin_processed.tpl ----------
Code:
{* mod.extended.order.status templates - order_admin_processed.tpl *} {* arthur: x-light *} {* work derived from Ruslan R. Fazliev, www.x-cart.com *} {* version 1.00, 4/08/05 *} {config_load file="$skin_config"} {include file="mail/html/mail_header.tpl"} {assign var=where value="A"} {$lng.eml_this_is_order} #{$order.orderid} - order has been processed {include file="mail/html/order_invoice.tpl" to_admin="Y"} {include file="mail/html/signature.tpl"}
---------- order_customer_back_in_stock.tpl ----------
Code:
{* mod.extended.order.status templates - order_customer_back_in_stock.tpl *} {* arthur: x-light *} {* work derived from Ruslan R. Fazliev, www.x-cart.com *} {* version 1.00, 4/09/05 *} {config_load file="$skin_config"} {include file="mail/html/mail_header.tpl"} {$lng.lbl_dear} {$customer.title} {$customer.firstname} {$customer.lastname}, items now back in stock, you can continue with this order or cancel <HR size="1" noshade> <TABLE border="0" cellpadding="2" cellspacing="1" width="100%"> <TR> <TD width="20%">{$lng.lbl_order_id}:</TD> <TD width="10"></TD> <TD width="80%"><TT>#{$order.orderid}</TT></TD> </TR> <TR> <TD>{$lng.lbl_order_date}:</TD> <TD width="10"></TD> <TD><TT>{$order.date|date_format:$config.Appearance.datetime_format}</TT></TD> </TR> {if $order.tracking} <TR> <TD>{$lng.lbl_tracking_number}:</TD> <TD width="10"></TD> <TD><TT>{$order.tracking}</TT></TD> </TR> {/if} <TR> <TD colspan="3">{include file="mail/html/order_data.tpl"}</TD> </TR> </TABLE> {include file="mail/html/order_invoice.tpl"} {include file="mail/html/signature.tpl"}
---------- order_customer_backordered.tpl ----------
Code:
{* mod.extended.order.status templates - order_customer_backordered.tpl *} {* arthur: x-light *} {* work derived from Ruslan R. Fazliev, www.x-cart.com *} {* version 1.00, 4/08/05 *} {config_load file="$skin_config"} {include file="mail/html/mail_header.tpl"} {$lng.lbl_dear} {$customer.title} {$customer.firstname} {$customer.lastname}, order has been backordered <HR size="1" noshade> <TABLE border="0" cellpadding="2" cellspacing="1" width="100%"> <TR> <TD width="20%">{$lng.lbl_order_id}:</TD> <TD width="10"></TD> <TD width="80%"><TT>#{$order.orderid}</TT></TD> </TR> <TR> <TD>{$lng.lbl_order_date}:</TD> <TD width="10"></TD> <TD><TT>{$order.date|date_format:$config.Appearance.datetime_format}</TT></TD> </TR> {if $order.tracking} <TR> <TD>{$lng.lbl_tracking_number}:</TD> <TD width="10"></TD> <TD><TT>{$order.tracking}</TT></TD> </TR> {/if} <TR> <TD colspan="3">{include file="mail/html/order_data.tpl"}</TD> </TR> </TABLE> {include file="mail/html/order_invoice.tpl"} {include file="mail/html/signature.tpl"}
---------- order_customer_cancelled.tpl ----------
Code:
{* mod.extended.order.status templates - order_customer_cancelled.tpl *} {* arthur: x-light *} {* work derived from Ruslan R. Fazliev, www.x-cart.com *} {* version 1.00, 4/08/05 *} {config_load file="$skin_config"} {include file="mail/html/mail_header.tpl"} {$lng.lbl_dear} {$customer.firstname} {$customer.lastname}, Your order was cancelled <HR size="1" noshade> <TABLE border="0" cellpadding="2" cellspacing="1" width="100%"> <TR> <TD width="20%">{$lng.lbl_order_id}:</TD> <TD width="10"></TD> <TD width="80%"><TT>#{$order.orderid}</TT></TD> </TR> <TR> <TD>{$lng.lbl_order_date}:</TD> <TD width="10"></TD> <TD><TT>{$order.date|date_format:$config.Appearance.datetime_format}</TT></TD> </TR> <TR> <TD colspan="3">{include file="mail/html/order_data.tpl"}</TD> </TR> </TABLE> {include file="mail/html/order_invoice.tpl"} {include file="mail//html/signature.tpl"}
---------- order_customer_failed.tpl ----------
Code:
{* mod.extended.order.status templates - order_customer_failed.tpl *} {* arthur: x-light *} {* work derived from Ruslan R. Fazliev, www.x-cart.com *} {* version 1.00, 4/08/05 *} {config_load file="$skin_config"} {include file="mail/html/mail_header.tpl"} {$lng.lbl_dear} {$customer.title} {$customer.firstname} {$customer.lastname}, Your order has not been processed sucessfully for the following reasons: [*]list reason 1[*]list reason 2 {include file="mail/html/order_invoice.tpl"} {$lng.eml_thankyou_for_order} {include file="mail/html/signature.tpl"}
---------- order_customer_process_return.tpl ----------
Code:
{* mod.extended.order.status templates - order_customer_process_return.tpl *} {* arthur: x-light *} {* work derived from Ruslan R. Fazliev, www.x-cart.com *} {* version 1.00, 4/08/05 *} {config_load file="$skin_config"} {include file="mail/html/mail_header.tpl"} {$lng.lbl_dear} {$customer.title} {$customer.firstname} {$customer.lastname}, order is being processed for returns <HR size="1" noshade> <TABLE border="0" cellpadding="2" cellspacing="1" width="100%"> <TR> <TD width="20%">{$lng.lbl_order_id}:</TD> <TD width="10"></TD> <TD width="80%"><TT>#{$order.orderid}</TT></TD> </TR> <TR> <TD>{$lng.lbl_order_date}:</TD> <TD width="10"></TD> <TD><TT>{$order.date|date_format:$config.Appearance.datetime_format}</TT></TD> </TR> {if $order.tracking} <TR> <TD>{$lng.lbl_tracking_number}:</TD> <TD width="10"></TD> <TD><TT>{$order.tracking}</TT></TD> </TR> {/if} <TR> <TD colspan="3">{include file="mail/html/order_data.tpl"}</TD> </TR> </TABLE> {include file="mail/html/order_invoice.tpl"} {include file="mail/html/signature.tpl"}
---------- order_customer_process_shipping.tpl ----------
Code:
{* mod.extended.order.status templates - order_customer_process_shipping.tpl *} {* arthur: x-light *} {* work derived from Ruslan R. Fazliev, www.x-cart.com *} {* version 1.00, 4/08/05 *} {config_load file="$skin_config"} {include file="mail/html/mail_header.tpl"} {$lng.lbl_dear} {$customer.title} {$customer.firstname} {$customer.lastname}, order is scheduled for shipping <HR size="1" noshade> <TABLE border="0" cellpadding="2" cellspacing="1" width="100%"> <TR> <TD width="20%">{$lng.lbl_order_id}:</TD> <TD width="10"></TD> <TD width="80%"><TT>#{$order.orderid}</TT></TD> </TR> <TR> <TD>{$lng.lbl_order_date}:</TD> <TD width="10"></TD> <TD><TT>{$order.date|date_format:$config.Appearance.datetime_format}</TT></TD> </TR> {if $order.tracking} <TR> <TD>{$lng.lbl_tracking_number}:</TD> <TD width="10"></TD> <TD><TT>{$order.tracking}</TT></TD> </TR> {/if} <TR> <TD colspan="3">{include file="mail/html/order_data.tpl"}</TD> </TR> </TABLE> {include file="mail/html/order_invoice.tpl"} {include file="mail/html/signature.tpl"}
---------- order_customer_refunded.tpl ----------
Code:
{* mod.extended.order.status templates - order_customer_refunded.tpl *} {* arthur: x-light *} {* work derived from Ruslan R. Fazliev, www.x-cart.com *} {* version 1.00, 4/08/05 *} {config_load file="$skin_config"} {include file="mail/html/mail_header.tpl"} {$lng.lbl_dear} {$customer.title} {$customer.firstname} {$customer.lastname}, your return has been accepted, a credit of _blank_ has been issued to you <HR size="1" noshade> <TABLE border="0" cellpadding="2" cellspacing="1" width="100%"> <TR> <TD width="20%">{$lng.lbl_order_id}:</TD> <TD width="10"></TD> <TD width="80%"><TT>#{$order.orderid}</TT></TD> </TR> <TR> <TD>{$lng.lbl_order_date}:</TD> <TD width="10"></TD> <TD><TT>{$order.date|date_format:$config.Appearance.datetime_format}</TT></TD> </TR> {if $order.tracking} <TR> <TD>{$lng.lbl_tracking_number}:</TD> <TD width="10"></TD> <TD><TT>{$order.tracking}</TT></TD> </TR> {/if} <TR> <TD colspan="3">{include file="mail/html/order_data.tpl"}</TD> </TR> </TABLE> {include file="mail/html/order_invoice.tpl"} {include file="mail/html/signature.tpl"}
__________________
X-Cart 4.xx Gold
Enterprise Linux
Reply With Quote

The following user thanks x-light for this useful post:
Mish (12-09-2012)
  #2  
Old 05-03-2005, 05:48 PM
 
x-online x-online is offline
 

Senior Member
  
Join Date: Apr 2004
Location: Australia, Sydney
Posts: 189
 

Default

Thank you for your HUGEEEE writing dude. Eventho i might not do it but it is impressive custom mods and great attribution.
__________________
X-Cart version 4.x (Most likely will be the latest version)
Reply With Quote
  #3  
Old 05-04-2005, 06:25 PM
 
jmell jmell is offline
 

Senior Member
  
Join Date: Sep 2003
Posts: 127
 

Default

Has anyone tried this ????
It sounds really great.
__________________
X-Cart 4.1.9
Reply With Quote
  #4  
Old 05-05-2005, 11:26 PM
 
x-light x-light is offline
 

Member
  
Join Date: Mar 2005
Posts: 29
 

Default

Hello x-online,

Quote:
Thank you for your HUGEEEE writing dude. Eventho i might not do it but it is impressive custom mods and great attribution.

Your welcome. I developed these mods since I need them for my store as well. I am sharing them so hopefully people can benefit from them, give their opinions and even improve on them. Also, it would be great if someone can start customizing the contents of some of these email messages. I just don't have the time to do this, but if I ever get to it, I will post them as well.

Hi jmell,

Quote:
Has anyone tried this ????
It sounds really great.

Unfortunately I can't say I have since I only have access to the latest 4.0.x branch. However if the sql fields for config table is the same and the code in func.php is similar. You may have to do some slight modifications to make it work. If you follow the code in how and where these notifications are being sent in the func.php, it should all make more sense. Good luck.

~x-light
__________________
X-Cart 4.xx Gold
Enterprise Linux
Reply With Quote
  #5  
Old 09-02-2005, 06:11 PM
 
jcnelson jcnelson is offline
 

Newbie
  
Join Date: Feb 2003
Posts: 6
 

Default

We just installed this in X-Cart version 4.0.14 and it works perfect. Thank you so much for posting this.

Awesome work!!
Reply With Quote
  #6  
Old 09-02-2005, 10:56 PM
 
x-light x-light is offline
 

Member
  
Join Date: Mar 2005
Posts: 29
 

Default

Hello jcnelson,

Your welcome. I am glad it worked for 4.0.14 as well.

~x-light
__________________
X-Cart 4.xx Gold
Enterprise Linux
Reply With Quote
  #7  
Old 10-14-2005, 12:55 AM
  eaglemobiles's Avatar 
eaglemobiles eaglemobiles is offline
 

Senior Member
  
Join Date: Jan 2005
Posts: 167
 

Default

Hi,
Its a really great mod, but I cant find the places where to put codes in func.php i searched allot but cant find it.
__________________
X-Cart Gold 4.3.2
X-Cart Gold 4.4.1
Unix

High Quality CCTV DVRs & Cameras
http://www.eaglemobiles.co.uk/CCTV
Reply With Quote
  #8  
Old 10-14-2005, 06:31 PM
 
x-light x-light is offline
 

Member
  
Join Date: Mar 2005
Posts: 29
 

Default

Hello eaglemobiles,

Humm... Are you using 4.0.11 for your cart? This mod was tested with 4.0.13, but I can't imagine that the func.php in 4.0.11 is that different from the 4.0.13.

~x-light
__________________
X-Cart 4.xx Gold
Enterprise Linux
Reply With Quote
  #9  
Old 11-19-2005, 09:13 PM
  davidsaldana's Avatar 
davidsaldana davidsaldana is offline
 

Senior Member
  
Join Date: Oct 2005
Posts: 187
 

Default

Has anybody done this for 4.0.16
__________________
4.4
Code:
Hello World
Reply With Quote
  #10  
Old 12-03-2005, 01:55 PM
  HWT's Avatar 
HWT HWT is offline
 

eXpert
  
Join Date: Jan 2005
Location: Massachusetts, USA
Posts: 392
 

Default

I have implimented this successfully in 4.0.13 and 4.0.15 stores. Took about an hour for me to do both stores. All I can say is "WOW"! My orders department NEEDED this! It is obvious that a lot of thought, time, effort and energy was put into this mod. Thanks for sharing!!
__________________
x-cart 4.0.13 and 4.1.7 and 4.1.10
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 06:38 AM.

   

 
X-Cart forums © 2001-2020