ppokrovsky Posted August 23, 2014 Share Posted August 23, 2014 Hi. What would be to your opinion the best way to work around this situation: If customer chose to pay with cash (cashondelivery module) - standard confirmation email needs to be sent immediatelly If order is paid with something, other than cash (e.g. credit card) - standard confirmation email needs to be sent only after order is set to specific status ('paid' for instance)? I'm thinking about few ways, such as overriding PaymentModule class, validateOrder method, but they seem to be too complicated for such primitive task. Any suggestions? Thanks! Link to comment Share on other sites More sharing options...
El Patron Posted August 23, 2014 Share Posted August 23, 2014 when paid by cc, then module should set order status to 'paid' and sent email. for pending payment, then no order confirmation (i.e. paid is sent). I do not see that what you seek is not already handled. see back office-->orders-->statuses Link to comment Share on other sites More sharing options...
ppokrovsky Posted August 23, 2014 Author Share Posted August 23, 2014 in 1.6.0.8 method validateOrder is implemented in PaymentModule class and is supposed to be called from any payment module. This method actually converts cart to order and among everything it has this piece of code if (Validate::isEmail($this->context->customer->email)) Mail::Send( (int)$order->id_lang, 'order_conf', Mail::l('Order confirmation', (int)$order->id_lang), $data, $this->context->customer->email, $this->context->customer->firstname.' '.$this->context->customer->lastname, null, null, $file_attachement, null, _PS_MAIL_DIR_, false, (int)$order->id_shop ); Which, I presume, actually sends email everytime this method is called. Link to comment Share on other sites More sharing options...
El Patron Posted August 23, 2014 Share Posted August 23, 2014 email is determied by order status, edit any order status in back office, here you can see 1) if email will be sent and 2) tempalte Link to comment Share on other sites More sharing options...
ppokrovsky Posted August 24, 2014 Author Share Posted August 24, 2014 what version are you using? In my case status is set to 'In preparation'. This status has no notification emails attached in BO, nevertheless email with order_conf template is sent each time order is created. This template, btw, is not attached to any order status in BO either. 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