siomosp Posted June 19, 2013 Share Posted June 19, 2013 (edited) Hello, at PS 1.5 after editing an order at BO, the customer receives a mail ( order_changed.html ) How i can disable the e-mail notification? Meaning, no e-mail is sended to customer if order is changed at BO Thanks! Edited June 19, 2013 by siomosp (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted June 19, 2013 Share Posted June 19, 2013 you want to disable only this message? all other messages you want, right? Link to comment Share on other sites More sharing options...
benjamin utterback Posted June 19, 2013 Share Posted June 19, 2013 Hi siomosp, I think the solution would be go to Orders>Statuses>uncheck the column that says "Send E-mail to customer" 1 Link to comment Share on other sites More sharing options...
siomosp Posted June 19, 2013 Author Share Posted June 19, 2013 you want to disable only this message? all other messages you want, right? Hello , only this message! Link to comment Share on other sites More sharing options...
vekia Posted June 19, 2013 Share Posted June 19, 2013 okay! thanks for information! So I totally agree with Benjamin, you can turn on / off emails there: 1 Link to comment Share on other sites More sharing options...
siomosp Posted June 19, 2013 Author Share Posted June 19, 2013 (edited) okay! thanks for information! So I totally agree with Benjamin, you can turn on / off emails there: But at the table , there is no option to disable sending mails for changed order from admin at BO Edited June 19, 2013 by siomosp (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted June 19, 2013 Share Posted June 19, 2013 what prestashop version you use? 1.5.4.1? Link to comment Share on other sites More sharing options...
siomosp Posted June 19, 2013 Author Share Posted June 19, 2013 what prestashop version you use? 1.5.4.1? 1.5.4.0 ! Link to comment Share on other sites More sharing options...
vekia Posted June 19, 2013 Share Posted June 19, 2013 really weird i checked 1.5.4.0 and this feature is available on orders > statuses page Link to comment Share on other sites More sharing options...
siomosp Posted June 20, 2013 Author Share Posted June 20, 2013 (edited) No , there is not this status on orders > statuses page And the template ,order_changed, is not available for selection when adding a new status You know where is the code controling the status messages? Edited June 20, 2013 by siomosp (see edit history) Link to comment Share on other sites More sharing options...
siomosp Posted June 20, 2013 Author Share Posted June 20, 2013 ( My statuses screen) Link to comment Share on other sites More sharing options...
vekia Posted June 20, 2013 Share Posted June 20, 2013 here is an url: http://localhost/1541a/_ADMIN_DIR_/index.php?controller=AdminStatuses Link to comment Share on other sites More sharing options...
djmonkeyboy Posted June 27, 2013 Share Posted June 27, 2013 I think there is some confusion here as I would like to disable these messages as well. The issue is if on the back office on an order details page, if products are manually added to the existing order, an auto email is sent to the customer. So if 10 product changes are made, the customer annoyingly receives 10 separate emails. The status is not changed at all which is why as far as I can tell this issue cannot be toggled on the Orders / Statuses page. Link to comment Share on other sites More sharing options...
tomerg3 Posted June 27, 2013 Share Posted June 27, 2013 You'll have to override the controller that sends that email, as it does not look like you can simply disable it from the backend. See http://screencast.com/t/leJSNZemABb 2 Link to comment Share on other sites More sharing options...
djmonkeyboy Posted June 28, 2013 Share Posted June 28, 2013 Great, thanks for pointing me in the right direction. While DEVs are here though, I think it is worth pointing out the default is not very good. It would make more sense to have a toggle of some sort to send out a general "your order has been updated" email on demand rather than an auto email after every small change made. It is not crazy to expect 2 changes to one order and the problem just gets worse for larger wholesale orders. Link to comment Share on other sites More sharing options...
Christiaan_01 Posted July 24, 2013 Share Posted July 24, 2013 (edited) Thanks Tomerg3, it works! For those with the same problem. I found the file in /public_html/controllers/admin and then AdminOrdersController.php. On line 1746 I change the code to public function sendChangedNotification(Order $order = null) { return false; 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, null, null, null, null, _PS_MAIL_DIR_, true, (int)$order->id_shop); } Edited July 24, 2013 by Christiaan_01 (see edit history) 3 Link to comment Share on other sites More sharing options...
wondrik Posted November 14, 2013 Share Posted November 14, 2013 (edited) Hi, just delete/rename email template in ftp /mails/lc/order_changed.html and .txt (lc = language code). Tested on PrestaShop™ 1.5.4.1 Edited November 14, 2013 by wondrik (see edit history) 3 Link to comment Share on other sites More sharing options...
sabio Posted June 23, 2014 Share Posted June 23, 2014 Hi, We have problem. When order is cancel Prestashop is sending out an email with "your order has changed status", despite the "Send an email to the customer when his/her order status has changed." is not ticked? Link to comment Share on other sites More sharing options...
fransjaeger Posted March 25, 2015 Share Posted March 25, 2015 (edited) Would be simpler and smarter maybe to add a configuration option send email on all order changes -> on/offand maybe if ON, let manager deside whether to send email or not, by some alert('would you like customer to be notified by email about thie order has changed (its recommended to do this if you now have finished editing the order)')that way would be something i can live with (not queit as tottally stupid and brain dead)I can make the code that should go inside function sendChangedNotificationwho will make the code to control the ON/OFF ?who will make the alert() and make sure some option is sent along like send_mail=1 if mail should be sent we can sum it in a few files here https://github.com/michaelhjulskov/smart_order_changed_email Edited March 25, 2015 by michaelhjulskov (see edit history) Link to comment Share on other sites More sharing options...
fransjaeger Posted March 25, 2015 Share Posted March 25, 2015 okay first step has been taken to make an override https://github.com/michaelhjulskov/smart_order_changed_email we need to add PS_SEND_MAIL_ON_ORDER_CHANGE to the BO administration and add it to the menu somewhere who will continue that? and wee need to make some js confirm('would you like customer to be notified by email about thie order has changed (its recommended to do this if you now have finished editing the order)') if confirm is true, then add send_email to the request Link to comment Share on other sites More sharing options...
BZZYBI Posted July 28, 2015 Share Posted July 28, 2015 IF you would like to disable the send mail for order edit you need to go to modules "Mail Alerts". The problem I see with this module which I believe is a bug, is that if you have multi store the "Off" feature only works on one of the stores. Link to comment Share on other sites More sharing options...
Coloranti Posted September 7, 2015 Share Posted September 7, 2015 IF you would like to disable the send mail for order edit you need to go to modules "Mail Alerts". The problem I see with this module which I believe is a bug, is that if you have multi store the "Off" feature only works on one of the stores. Thanks BZZYBI, disabling the "Order edit" on "Customer notifications" area of the "mail alerts" plugin configuration should be the right solution. Also on PS 1.6 1 Link to comment Share on other sites More sharing options...
9smiths Posted October 19, 2015 Share Posted October 19, 2015 IF you would like to disable the send mail for order edit you need to go to modules "Mail Alerts". The problem I see with this module which I believe is a bug, is that if you have multi store the "Off" feature only works on one of the stores. I am having the same issue, so I tried this in 1.6 but it didn't work. It still keeps sending the emails after selecting NO to "Send a notification to the customer when an order is edited.." Link to comment Share on other sites More sharing options...
9smiths Posted October 20, 2015 Share Posted October 20, 2015 Thanks Tomerg3, it works! For those with the same problem. I found the file in /public_html/controllers/admin and then AdminOrdersController.php. On line 1746 I change the code to public function sendChangedNotification(Order $order = null) { return false; 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, null, null, null, null, _PS_MAIL_DIR_, true, (int)$order->id_shop); } Thanks, this worked for me! 1 1 Link to comment Share on other sites More sharing options...
ArturV Posted January 11, 2016 Share Posted January 11, 2016 (edited) 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, null, null, null, null, _PS_MAIL_DIR_, true, (int)$order->id_shop); } Hello, what i should change in this function if i want to get mails in my mailbox but not in clients ? For example somebody changes old order and i got mail of that change Edited January 12, 2016 by ArturV (see edit history) Link to comment Share on other sites More sharing options...
mauglee Posted February 26, 2016 Share Posted February 26, 2016 If this is still actual for someone, here are two bugs (see bellow for solution) in „Mail alerts“ module: 1. The module has setting Customer notifications: Order edit (Send a notification to the customer when an order is edited.). But this setting is not saved after change. 2. The hook „hookActionOrderEdited“ is ignoring this setting too. I have fix'ed the code and submitted a pull request in modules github repository. Hope it will be fixed soon. As for now you can create an override. Steps: 1. Create file /override/modules/mailalerts/mailalerts.php 2. Create override class with two overridden methods in this file. What was changed you can see here. Whole file: <?php if ( !defined( '_PS_VERSION_' ) ) { exit; } class MailAlertsOverride extends MailAlerts { /** * Send a mail when an order is modified. * * @param array $params Hook params. */ public function hookActionOrderEdited($params) { if ( !$this->order_edited || empty($this->order_edited) || !Configuration::get('MA_ORDER_EDIT') ) { return; } $order = $params['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', (int)$order->id_lang), $data, $order->getCustomer()->email, $order->getCustomer()->firstname.' '.$order->getCustomer()->lastname, null, null, null, null, _PS_MAIL_DIR_, true, (int)$order->id_shop); } protected function postProcess() { $errors = array(); if (Tools::isSubmit('submitMailAlert')) { if ( !Configuration::updateValue('MA_CUSTOMER_QTY', (int)Tools::getValue('MA_CUSTOMER_QTY')) || !Configuration::updateValue('MA_ORDER_EDIT', (int)Tools::getValue('MA_ORDER_EDIT')) ) { $errors[] = $this->l('Cannot update settings'); } } else if (Tools::isSubmit('submitMAMerchant')) { $emails = (string)Tools::getValue('MA_MERCHANT_MAILS'); if (!$emails || empty($emails)) $errors[] = $this->l('Please type one (or more) e-mail address'); else { $emails = str_replace(',', self::__MA_MAIL_DELIMITOR__, $emails); $emails = explode(self::__MA_MAIL_DELIMITOR__, $emails); foreach ($emails as $k => $email) { $email = trim($email); if (!empty($email) && !Validate::isEmail($email)) { $errors[] = $this->l('Invalid e-mail:').' '.Tools::safeOutput($email); break; } elseif (!empty($email) && count($email) > 0) $emails[$k] = $email; else unset($emails[$k]); } $emails = implode(self::__MA_MAIL_DELIMITOR__, $emails); if (!Configuration::updateValue('MA_MERCHANT_MAILS', (string)$emails)) $errors[] = $this->l('Cannot update settings'); elseif (!Configuration::updateValue('MA_MERCHANT_ORDER', (int)Tools::getValue('MA_MERCHANT_ORDER'))) $errors[] = $this->l('Cannot update settings'); elseif (!Configuration::updateValue('MA_MERCHANT_OOS', (int)Tools::getValue('MA_MERCHANT_OOS'))) $errors[] = $this->l('Cannot update settings'); elseif (!Configuration::updateValue('MA_LAST_QTIES', (int)Tools::getValue('MA_LAST_QTIES'))) $errors[] = $this->l('Cannot update settings'); elseif (!Configuration::updateGlobalValue('MA_MERCHANT_COVERAGE', (int)Tools::getValue('MA_MERCHANT_COVERAGE'))) $errors[] = $this->l('Cannot update settings'); elseif (!Configuration::updateGlobalValue('MA_PRODUCT_COVERAGE', (int)Tools::getValue('MA_PRODUCT_COVERAGE'))) $errors[] = $this->l('Cannot update settings'); elseif (!Configuration::updateGlobalValue('MA_ORDER_EDIT', (int)Tools::getValue('MA_ORDER_EDIT'))) $errors[] = $this->l('Cannot update settings'); elseif (!Configuration::updateGlobalValue('MA_RETURN_SLIP', (int)Tools::getValue('MA_RETURN_SLIP'))) $errors[] = $this->l('Cannot update settings'); } } if (count($errors) > 0) $this->html .= $this->displayError(implode('<br />', $errors)); else $this->html .= $this->displayConfirmation($this->l('Settings updated successfully')); $this->init(); } } 1 Link to comment Share on other sites More sharing options...
letrof Posted May 13, 2016 Share Posted May 13, 2016 If this is still actual for someone, here are two bugs (see bellow for solution) in „Mail alerts“ module: 1. The module has setting Customer notifications: Order edit (Send a notification to the customer when an order is edited.). But this setting is not saved after change. 2. The hook „hookActionOrderEdited“ is ignoring this setting too. I have fix'ed the code and submitted a pull request in modules github repository. Hope it will be fixed soon. As for now you can create an override. Steps: 1. Create file /override/modules/mailalerts/mailalerts.php 2. Create override class with two overridden methods in this file. What was changed you can see here. Whole file: <?php if ( !defined( '_PS_VERSION_' ) ) { exit; } class MailAlertsOverride extends MailAlerts { /** * Send a mail when an order is modified. * * @param array $params Hook params. */ public function hookActionOrderEdited($params) { if ( !$this->order_edited || empty($this->order_edited) || !Configuration::get('MA_ORDER_EDIT') ) { return; } $order = $params['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', (int)$order->id_lang), $data, $order->getCustomer()->email, $order->getCustomer()->firstname.' '.$order->getCustomer()->lastname, null, null, null, null, _PS_MAIL_DIR_, true, (int)$order->id_shop); } protected function postProcess() { $errors = array(); if (Tools::isSubmit('submitMailAlert')) { if ( !Configuration::updateValue('MA_CUSTOMER_QTY', (int)Tools::getValue('MA_CUSTOMER_QTY')) || !Configuration::updateValue('MA_ORDER_EDIT', (int)Tools::getValue('MA_ORDER_EDIT')) ) { $errors[] = $this->l('Cannot update settings'); } } else if (Tools::isSubmit('submitMAMerchant')) { $emails = (string)Tools::getValue('MA_MERCHANT_MAILS'); if (!$emails || empty($emails)) $errors[] = $this->l('Please type one (or more) e-mail address'); else { $emails = str_replace(',', self::__MA_MAIL_DELIMITOR__, $emails); $emails = explode(self::__MA_MAIL_DELIMITOR__, $emails); foreach ($emails as $k => $email) { $email = trim($email); if (!empty($email) && !Validate::isEmail($email)) { $errors[] = $this->l('Invalid e-mail:').' '.Tools::safeOutput($email); break; } elseif (!empty($email) && count($email) > 0) $emails[$k] = $email; else unset($emails[$k]); } $emails = implode(self::__MA_MAIL_DELIMITOR__, $emails); if (!Configuration::updateValue('MA_MERCHANT_MAILS', (string)$emails)) $errors[] = $this->l('Cannot update settings'); elseif (!Configuration::updateValue('MA_MERCHANT_ORDER', (int)Tools::getValue('MA_MERCHANT_ORDER'))) $errors[] = $this->l('Cannot update settings'); elseif (!Configuration::updateValue('MA_MERCHANT_OOS', (int)Tools::getValue('MA_MERCHANT_OOS'))) $errors[] = $this->l('Cannot update settings'); elseif (!Configuration::updateValue('MA_LAST_QTIES', (int)Tools::getValue('MA_LAST_QTIES'))) $errors[] = $this->l('Cannot update settings'); elseif (!Configuration::updateGlobalValue('MA_MERCHANT_COVERAGE', (int)Tools::getValue('MA_MERCHANT_COVERAGE'))) $errors[] = $this->l('Cannot update settings'); elseif (!Configuration::updateGlobalValue('MA_PRODUCT_COVERAGE', (int)Tools::getValue('MA_PRODUCT_COVERAGE'))) $errors[] = $this->l('Cannot update settings'); elseif (!Configuration::updateGlobalValue('MA_ORDER_EDIT', (int)Tools::getValue('MA_ORDER_EDIT'))) $errors[] = $this->l('Cannot update settings'); elseif (!Configuration::updateGlobalValue('MA_RETURN_SLIP', (int)Tools::getValue('MA_RETURN_SLIP'))) $errors[] = $this->l('Cannot update settings'); } } if (count($errors) > 0) $this->html .= $this->displayError(implode('<br />', $errors)); else $this->html .= $this->displayConfirmation($this->l('Settings updated successfully')); $this->init(); } } I have made an override, but it's still sending this annoying e-mail :/ Link to comment Share on other sites More sharing options...
vekia Posted May 14, 2016 Share Posted May 14, 2016 I have made an override, but it's still sending this annoying e-mail :/ maybe because prestashop still uses original module file remove class_index.php file to rebuild it with new paths to overides. Link to comment Share on other sites More sharing options...
letrof Posted October 1, 2016 Share Posted October 1, 2016 no, I deleted it. Link to comment Share on other sites More sharing options...
Zeryk Posted November 28, 2017 Share Posted November 28, 2017 I still didn't get it :-( Which file I should be editing? Where is the line which makes to send the email to the customer each time I make a change in BO ? Can I just put this line between /* ....*/ ? That should do the trick , no? Link to comment Share on other sites More sharing options...
Zeryk Posted November 28, 2017 Share Posted November 28, 2017 Ok, as above suggested , Delete or rename files called : order_changed.html and .txt Important! They are located in 2 places. 1) in your theme / mails / 2) in root / mails ...... You have to delete / edit both. If you using default bootstrap. If you just delete in one place, it will find a way to send the from 2nd place somehow. Im not sure if the function calling up for this email "order_changed.html " file which is not there anymore, if that is not going to make some mess , somewhere? Some error stuff or something? For the moment it works fine, but I would still prefer to find that line saying : send this "order _hanged.html" , and turn it off . Link to comment Share on other sites More sharing options...
ggaston Posted November 30, 2017 Share Posted November 30, 2017 (edited) On 28/11/2017 at 2:39 PM, Zeryk said: Ok, as above suggested , Delete or rename files called : order_changed.html and .txt Important! They are located in 2 places. 1) in your theme / mails / 2) in root / mails ...... You have to delete / edit both. If you using default bootstrap. If you just delete in one place, it will find a way to send the from 2nd place somehow. Im not sure if the function calling up for this email "order_changed.html " file which is not there anymore, if that is not going to make some mess , somewhere? Some error stuff or something? For the moment it works fine, but I would still prefer to find that line saying : send this "order _hanged.html" , and turn it off . Hi there, this worked out for me (On 1.7): On controllers\admin\AdminOrdersController.php, search for sendChangedNotification() function and just put a return false; before anything else. Edited November 30, 2017 by ggaston (see edit history) Link to comment Share on other sites More sharing options...
Zeryk Posted December 1, 2017 Share Posted December 1, 2017 17 hours ago, ggaston said: Hi there, this worked out for me (On 1.7): On controllers\admin\AdminOrdersController.php, search for sendChangedNotification() function and just put a return false; before anything else. Where should I type - false? } public function sendChangedNotification(Order $order = null) { if (is_null($order)) { $order = new Order(Tools::getValue('id_order')); } Hook::exec('actionOrderEdited', array('order' => $order)); } Link to comment Share on other sites More sharing options...
Zeryk Posted December 1, 2017 Share Posted December 1, 2017 (edited) I also having problems now with deleted email templates. I get warning sign that " order_changed.txt " is missing and doesn't allow me to save the changes:-( but then change applies somehow...really confusing. Changes are applied but I have to refresh the page all the time to see the difference. So still have to find the turn OFF option. Edited December 1, 2017 by Zeryk (see edit history) Link to comment Share on other sites More sharing options...
ggaston Posted December 1, 2017 Share Posted December 1, 2017 6 hours ago, Zeryk said: public function sendChangedNotification(Order $order = null) { if (is_null($order)) { $order = new Order(Tools::getValue('id_order')); } Hook::exec('actionOrderEdited', array('order' => $order)); } This is how I did it: public function sendChangedNotification(Order $order = null) { return false; if (is_null($order)) { $order = new Order(Tools::getValue('id_order')); } Hook::exec('actionOrderEdited', array('order' => $order)); } Link to comment Share on other sites More sharing options...
Zeryk Posted December 1, 2017 Share Posted December 1, 2017 3 hours ago, ggaston said: This is how I did it: public function sendChangedNotification(Order $order = null) { return false; if (is_null($order)) { $order = new Order(Tools::getValue('id_order')); } Hook::exec('actionOrderEdited', array('order' => $order)); } Good job! ..thanks a lot...works for me as well! :-) Link to comment Share on other sites More sharing options...
cerovic Posted February 13, 2019 Share Posted February 13, 2019 On 12/1/2017 at 2:32 PM, Zeryk said: Good job! ..thanks a lot...works for me as well! :-) On 12/1/2017 at 11:16 AM, ggaston said: This is how I did it: public function sendChangedNotification(Order $order = null) { return false; if (is_null($order)) { $order = new Order(Tools::getValue('id_order')); } Hook::exec('actionOrderEdited', array('order' => $order)); } works also for me in PS 1.6.1.23. thanks Link to comment Share on other sites More sharing options...
andersburn Posted August 2, 2020 Share Posted August 2, 2020 On 10/20/2015 at 11:15 PM, 9smiths said: Thanks, this worked for me! It works for 1.6.x.x too. Just comment out the send part. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now