sailing123 Posted March 20, 2017 Share Posted March 20, 2017 Hi, Macro {$DATA.link} does not work if used in the email template of the CANCELLED order status. How can I fix it please ? Thanks S. Quote Link to comment Share on other sites More sharing options...
bsmither Posted March 20, 2017 Share Posted March 20, 2017 The Admin Notify Status list of statuses in Store Settings, Features tab was an enhancement over the original two choices (Pending or Processing) that if any plugin were to add any additional statuses, then they would show up in this list without any coding changes. Unfortunately, the enhancement made it so that all statuses, actually usable or not, ended up in this list. But the code that sends emails to the admin of an order that changes status was not enhanced beyond the original two choices: Pending or Processing. There is, however, a hook one can use to add the capability of sending an email to any other status. Regarding what is made available to the email templates for Order Declined, Order Failed, and Order Cancelled, the code does not make details about the order available. But that can be fixed. I will have edits for you shortly. Quote Link to comment Share on other sites More sharing options...
bsmither Posted March 20, 2017 Share Posted March 20, 2017 In the file /classes/order.class.php Near line 483, find: case self::ORDER_DECLINED: // Nothing to do, but leave the option here for hooks & such break; case self::ORDER_FAILED: // Email the customer to explain their order failed fraud review $content = $mailer->loadContent('cart.payment_fraud', $order_summary['lang'], $this->_order_summary); break; case self::ORDER_CANCELLED: // Cancelled $content = $mailer->loadContent('cart.order_cancelled', $order_summary['lang'], $this->_order_summary); break; Change to: case self::ORDER_DECLINED: // Nothing to do, but leave the option here for hooks & such break; case self::ORDER_FAILED: // Email the customer to explain their order failed fraud review $this->assignOrderDetails(); $content = $mailer->loadContent('cart.payment_fraud', $order_summary['lang'], $this->_order_summary); break; case self::ORDER_CANCELLED: // Cancelled $this->assignOrderDetails(); $content = $mailer->loadContent('cart.order_cancelled', $order_summary['lang'], $this->_order_summary); break; The related email templates will need to have the macros added -- you can copy the contents from another template. 1 Quote Link to comment Share on other sites More sharing options...
sailing123 Posted March 20, 2017 Author Share Posted March 20, 2017 (edited) Codes amended and admin now receives a copy of cancelled status. Great, thanks. Macro {$DATA.link} still does not work in that specific email template but reading your reply in previous thread, you did say that no DATA is assigned to the Order Declined, Failed, and Cancelled statuses so a request will be made in the Github requesting that DATA is to be made available to be assigned in these statuses. So I conclude that we have to wait for the next system upgrade. Edited March 20, 2017 by sailing123 Quote Link to comment Share on other sites More sharing options...
bsmither Posted March 20, 2017 Share Posted March 20, 2017 " Macro {$DATA.link} still does not work in that specific email template " I see what's going on. Try this version: Change to: case self::ORDER_DECLINED: // Nothing to do, but leave the option here for hooks & such break; case self::ORDER_FAILED: // Email the customer to explain their order failed fraud review $this->assignOrderDetails(); $content = $mailer->loadContent('cart.payment_fraud', $order_summary['lang']); // removed $this->_order_summary) so that assigned details will not be overwritten break; case self::ORDER_CANCELLED: // Cancelled $this->assignOrderDetails(); $content = $mailer->loadContent('cart.order_cancelled', $order_summary['lang']); // removed $this->_order_summary) so that assigned details will not be overwritten break; 1 Quote Link to comment Share on other sites More sharing options...
sailing123 Posted March 20, 2017 Author Share Posted March 20, 2017 Fantastique !!!! Thank you. ALL RESOLVED again :-) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.