diff --git a/classes/Language.php b/classes/Language.php index 43556c716..b33575970 100644 --- a/classes/Language.php +++ b/classes/Language.php @@ -295,7 +295,8 @@ class LanguageCore extends ObjectModel 'shipped.html', 'shipped.txt', 'test.html', 'test.txt', 'voucher.html', 'voucher.txt', - 'voucher_new.html', 'voucher_new.txt' + 'voucher_new.html', 'voucher_new.txt', + 'order_changed.html', 'order_changed.txt' ); $number = -1; diff --git a/classes/order/Order.php b/classes/order/Order.php index fa0faaa24..10a2919f0 100644 --- a/classes/order/Order.php +++ b/classes/order/Order.php @@ -975,6 +975,20 @@ class OrderCore extends ObjectModel } return $return; } + + /** + * Get order customer + * + * @return Customer $customer + */ + public function getCustomer() + { + static $customer = null; + if (is_null($customer)) + $customer = new Customer((int)$this->id_customer); + + return $customer; + } /** * Get customer orders number diff --git a/controllers/admin/AdminOrdersController.php b/controllers/admin/AdminOrdersController.php index 97e6a03cf..263c4b9d0 100755 --- a/controllers/admin/AdminOrdersController.php +++ b/controllers/admin/AdminOrdersController.php @@ -1715,6 +1715,8 @@ class AdminOrdersControllerCore extends AdminController 'link' => Context::getContext()->link, 'current_index' => self::$currentIndex )); + + $this->sendChangedNotification($order); die(Tools::jsonEncode(array( 'result' => true, @@ -1727,6 +1729,27 @@ class AdminOrdersControllerCore extends AdminController 'discount_form_html' => $this->createTemplate('_discount_form.tpl')->fetch() ))); } + + public function sendChangedNotification(Order $order = null) + { + if (is_null($order)) + $order = new Order(Tools::getValue('id_order')); + + $data = array( + '{lastname}' => $order->getCustomer()->lastname, + '{firstname}' => $order->getCustomer()->firstname, + '{id_order}' => (int)$order->id, + '{order_name}' => $order->getUniqReference() + ); + + Mail::Send( + (int)$order->id_lang, + 'order_changed', + Mail::l('Your order has been changed', $order->id_lang), + $data, + $order->getCustomer()->email, + $order->getCustomer()->firstname.' '.$order->getCustomer()->lastname); + } public function ajaxProcessLoadProductInformation() { @@ -1902,6 +1925,8 @@ class AdminOrdersControllerCore extends AdminController $view = $this->createTemplate('_customized_data.tpl')->fetch(); else $view = $this->createTemplate('_product_line.tpl')->fetch(); + + $this->sendChangedNotification($order); die(Tools::jsonEncode(array( 'result' => $res, @@ -1973,6 +1998,8 @@ class AdminOrdersControllerCore extends AdminController 'link' => Context::getContext()->link, 'current_index' => self::$currentIndex )); + + $this->sendChangedNotification($order); die(Tools::jsonEncode(array( 'result' => $res, diff --git a/mails/de/order_changed.html b/mails/de/order_changed.html new file mode 100644 index 000000000..5f22d193e --- /dev/null +++ b/mails/de/order_changed.html @@ -0,0 +1,49 @@ + + + + + Message from {shop_name} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{shop_name}
 
Hi {firstname} {lastname},
 
Your order with the reference {order_name} - Order changed
 
Your order with the reference {order_name} from {shop_name} has been changed by the merchant.
 
You can review your order and download your invoice from the "Order history" section of your customer account by clicking "My account" on our shop.

If you have guest account, you can follow your order via the "Guest Tracking" section on our shop.
 
{shop_name} powered by PrestaShop™
+ + \ No newline at end of file diff --git a/mails/de/order_changed.txt b/mails/de/order_changed.txt new file mode 100644 index 000000000..3e460a8d3 --- /dev/null +++ b/mails/de/order_changed.txt @@ -0,0 +1,11 @@ +Hi {firstname} {lastname}, + +Your order with the reference {order_name} from {shop_name} has been changed by the merchant. + +You can review your order and download your invoice from the "Order history" section of your customer account by clicking "My account" on our shop. + +If you have guest account, you can follow your order using this link: {shop_url}?controller=guest-tracking + +{shop_name} - {shop_url} + +{shop_url} powered by PrestaShop™ \ No newline at end of file diff --git a/mails/en/order_changed.html b/mails/en/order_changed.html new file mode 100644 index 000000000..5f22d193e --- /dev/null +++ b/mails/en/order_changed.html @@ -0,0 +1,49 @@ + + + + + Message from {shop_name} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{shop_name}
 
Hi {firstname} {lastname},
 
Your order with the reference {order_name} - Order changed
 
Your order with the reference {order_name} from {shop_name} has been changed by the merchant.
 
You can review your order and download your invoice from the "Order history" section of your customer account by clicking "My account" on our shop.

If you have guest account, you can follow your order via the "Guest Tracking" section on our shop.
 
{shop_name} powered by PrestaShop™
+ + \ No newline at end of file diff --git a/mails/en/order_changed.txt b/mails/en/order_changed.txt new file mode 100644 index 000000000..3e460a8d3 --- /dev/null +++ b/mails/en/order_changed.txt @@ -0,0 +1,11 @@ +Hi {firstname} {lastname}, + +Your order with the reference {order_name} from {shop_name} has been changed by the merchant. + +You can review your order and download your invoice from the "Order history" section of your customer account by clicking "My account" on our shop. + +If you have guest account, you can follow your order using this link: {shop_url}?controller=guest-tracking + +{shop_name} - {shop_url} + +{shop_url} powered by PrestaShop™ \ No newline at end of file diff --git a/mails/es/order_changed.html b/mails/es/order_changed.html new file mode 100644 index 000000000..5f22d193e --- /dev/null +++ b/mails/es/order_changed.html @@ -0,0 +1,49 @@ + + + + + Message from {shop_name} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{shop_name}
 
Hi {firstname} {lastname},
 
Your order with the reference {order_name} - Order changed
 
Your order with the reference {order_name} from {shop_name} has been changed by the merchant.
 
You can review your order and download your invoice from the "Order history" section of your customer account by clicking "My account" on our shop.

If you have guest account, you can follow your order via the "Guest Tracking" section on our shop.
 
{shop_name} powered by PrestaShop™
+ + \ No newline at end of file diff --git a/mails/es/order_changed.txt b/mails/es/order_changed.txt new file mode 100644 index 000000000..3e460a8d3 --- /dev/null +++ b/mails/es/order_changed.txt @@ -0,0 +1,11 @@ +Hi {firstname} {lastname}, + +Your order with the reference {order_name} from {shop_name} has been changed by the merchant. + +You can review your order and download your invoice from the "Order history" section of your customer account by clicking "My account" on our shop. + +If you have guest account, you can follow your order using this link: {shop_url}?controller=guest-tracking + +{shop_name} - {shop_url} + +{shop_url} powered by PrestaShop™ \ No newline at end of file diff --git a/mails/fr/lang.php b/mails/fr/lang.php index 62425d7c2..af164eaf2 100644 --- a/mails/fr/lang.php +++ b/mails/fr/lang.php @@ -12,6 +12,7 @@ $_LANGMAIL['Fwd: Customer message'] = 'TR: Message d\'un client'; $_LANGMAIL['Your guest account has been transformed to customer account'] = 'Votre compte invité a été transformé en compte client'; $_LANGMAIL['Package in transit'] = 'Livraison en cours'; $_LANGMAIL['Log: You have a new alert from your shop'] = 'Log : Vous avez un nouveau message d\'alerte dans votre boutique'; +$_LANGMAIL['Your order has been changed'] = 'Votre commande a été modifiée'; $_LANGMAIL['Order confirmation'] = 'Confirmation de commande'; $_LANGMAIL['Message from a customer'] = 'Message d\'un client'; $_LANGMAIL['New message regarding your order'] = 'Nouveau message concernant votre commande'; diff --git a/mails/fr/order_changed.html b/mails/fr/order_changed.html new file mode 100644 index 000000000..e9477b07f --- /dev/null +++ b/mails/fr/order_changed.html @@ -0,0 +1,49 @@ + + + + + Message de {shop_name} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{shop_name}
 
Bonjour {firstname} {lastname},
 
Historique de votre commande ayant pour référence {order_name}
 
Votre commande a été a été modifiée par le marchand.
 
Vous pouvez consulter votre commande et télécharger votre facture dans "Historique des commandes" de la rubrique "Mon compte" sur notre site.
Si vous avez un compte invité, vous pouvez consulter votre commande dans la section "Suivi invité" de notre site.
 
{shop_name} réalisé avec PrestaShop™
+ + \ No newline at end of file diff --git a/mails/fr/order_changed.txt b/mails/fr/order_changed.txt new file mode 100644 index 000000000..475fb85df --- /dev/null +++ b/mails/fr/order_changed.txt @@ -0,0 +1,12 @@ +Bonjour {firstname} {lastname}, + +Votre commande ayant pour référence {order_name} a été modifiée par le marchand. + +Vous pouvez à tout moment consulter votre commande dans "Historique des commandes" de la rubrique "Mon compte" sur notre site {shop_name}. +Si vous avez un compte invité, vous pouvez consulter votre commande à cette adresse : {shop_url}?controller=guest-tracking + +{shop_name} - {shop_url} + + + +{shop_url} réalisé avec PrestaShop™ \ No newline at end of file diff --git a/mails/it/order_changed.html b/mails/it/order_changed.html new file mode 100644 index 000000000..5f22d193e --- /dev/null +++ b/mails/it/order_changed.html @@ -0,0 +1,49 @@ + + + + + Message from {shop_name} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{shop_name}
 
Hi {firstname} {lastname},
 
Your order with the reference {order_name} - Order changed
 
Your order with the reference {order_name} from {shop_name} has been changed by the merchant.
 
You can review your order and download your invoice from the "Order history" section of your customer account by clicking "My account" on our shop.

If you have guest account, you can follow your order via the "Guest Tracking" section on our shop.
 
{shop_name} powered by PrestaShop™
+ + \ No newline at end of file diff --git a/mails/it/order_changed.txt b/mails/it/order_changed.txt new file mode 100644 index 000000000..3e460a8d3 --- /dev/null +++ b/mails/it/order_changed.txt @@ -0,0 +1,11 @@ +Hi {firstname} {lastname}, + +Your order with the reference {order_name} from {shop_name} has been changed by the merchant. + +You can review your order and download your invoice from the "Order history" section of your customer account by clicking "My account" on our shop. + +If you have guest account, you can follow your order using this link: {shop_url}?controller=guest-tracking + +{shop_name} - {shop_url} + +{shop_url} powered by PrestaShop™ \ No newline at end of file