budsaipan Posted July 15, 2011 Share Posted July 15, 2011 I'm looking for the php file that sends the order confirmation after the order is made/paid. I'd like to send out emails by the carriers (shipping) they select. I just cant find the file to modify.. Link to comment Share on other sites More sharing options...
shokinro Posted July 15, 2011 Share Posted July 15, 2011 I’m looking for the php file that sends the order confirmation after the order is made/paid. I’d like to send out emails by the carriers (shipping) they select. I just cant find the file to modify.. Please look into file /classes/PaymentModule.php file, it should be there.but for your purpose, it is better to override the calss instead of modifying existing one if you are using 1.4x Link to comment Share on other sites More sharing options...
budsaipan Posted July 15, 2011 Author Share Posted July 15, 2011 Can you be more specific of which part needs to be override? Let me be more specific of what I'm trying to do.I would like to be able to send out order confirmation to certain emails depending on the carrier’s selected when check out. I’d like it so that when customer picks carrier 1 and confirms the order, the confirmation mail will be sent to [email protected]. If customer picks carrier 2, it will go to [email protected].Which part of the code in PaymentModule.php file should I concentrate on? Link to comment Share on other sites More sharing options...
budsaipan Posted July 15, 2011 Author Share Posted July 15, 2011 It looks like maybe this needs to be modified? How do I make it validate carrier and send email to [email protected] ? if (Validate::isEmail($customer->email)) Mail::Send((int)($order->id_lang), 'order_conf', Mail::l('Order confirmation'), $data, $customer->email, $customer->firstname.' '.$customer->lastname, NULL, NULL, $fileAttachment); } Link to comment Share on other sites More sharing options...
budsaipan Posted July 15, 2011 Author Share Posted July 15, 2011 Is it possible to add value to each carrier that I created or is that generated by the database??Another question. Is there a way to modify the subject line on the order confirmation email? Link to comment Share on other sites More sharing options...
shokinro Posted July 15, 2011 Share Posted July 15, 2011 I don't know how much programming skill/experiences you have, if could be easy, also could be difficult.Basic idea is to create a new class inherits the PaymentModule class, then override the function ValidateOrder().1. You have to create a with following file name under /override/classes/ folder_PaymentModule.php 2. In this file, you must extends original PaymentModule class class PaymentModule extends PaymentModuleCore { } 3. in the above class, you need overide the ValidateOrder function as following public function validateOrder($id_cart, $id_order_state, $amountPaid, $paymentMethod = 'Unknown', $message = NULL, $extraVars = array(), $currency_special = NULL, $dont_touch_amount = false, $secure_key = false) { global $cart; parent::validateOrder(list up all the parameters here); /*put your code to send emails to carriers.*/ } but payment module is very critical class, you need to do it very carefully. Link to comment Share on other sites More sharing options...
Recommended Posts