Jump to content

Mail alert


Recommended Posts

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

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

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

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

×
×
  • Create New...