Jump to content
Hicham Alami

modification mail recovery carte

Recommended Posts

Bonjour,

 

J'ai besoin de votre aide pour creer un template du mail quand la commande est abandonnée, le client reçoit un mail par défaut comme c'est affiché en P.J

 

dd.png.878fefb8cc50497186b6065ccef51e4e.png

 

J'ai trouvé un code dans le fichier \classes\controller\FrontController.php mais je n'arrive pas à trouver comment  faire pour modifier le contenu du mail envoyé

* Recovers cart information.
     *
     * @return int|false
     */
    protected function recoverCart()
    {
        if (($id_cart = (int) Tools::getValue('recover_cart')) && Tools::getValue('token_cart') == md5(_COOKIE_KEY_ . 'recover_cart_' . $id_cart)) {
            $cart = new Cart((int) $id_cart);
            if (Validate::isLoadedObject($cart)) {
                $customer = new Customer((int) $cart->id_customer);
                if (Validate::isLoadedObject($customer)) {
                    $customer->logged = 1;
                    $this->context->customer = $customer;
                    $this->context->cookie->id_customer = (int) $customer->id;
                    $this->context->cookie->customer_lastname = $customer->lastname;
                    $this->context->cookie->customer_firstname = $customer->firstname;
                    $this->context->cookie->logged = 1;
                    $this->context->cookie->check_cgv = 1;
                    $this->context->cookie->is_guest = $customer->isGuest();
                    $this->context->cookie->passwd = $customer->passwd;
                    $this->context->cookie->email = $customer->email;

                    return $id_cart;
                }
            }
        } else {
            return false;
        }
    }

 

\controllers\admin\AdminOrdersController.php

 public function ajaxProcessSendMailValidateOrder()
    {
        if ($this->access('edit')) {
            $cart = new Cart((int) Tools::getValue('id_cart'));
            if (Validate::isLoadedObject($cart)) {
                $customer = new Customer((int) $cart->id_customer);
                if (Validate::isLoadedObject($customer)) {
                    $mailVars = array(
                        '{order_link}' => Context::getContext()->link->getPageLink('order', false, (int) $cart->id_lang, 'step=3&recover_cart=' . (int) $cart->id . '&token_cart=' . md5(_COOKIE_KEY_ . 'recover_cart_' . (int) $cart->id)),
                        '{firstname}' => $customer->firstname,
                        '{lastname}' => $customer->lastname,
                    );
                    $cartLanguage = new Language((int) $cart->id_lang);
                    if (
                        Mail::Send(
                            (int) $cart->id_lang,
                            'backoffice_order',
                            $this->trans(
                                'Process the payment of your order',
                                array(),
                                'Emails.Subject',
                                $cartLanguage->locale
                            ),
                            $mailVars,
                            $customer->email,
                            $customer->firstname . ' ' . $customer->lastname,
                            null,
                            null,
                            null,
                            null,
                            _PS_MAIL_DIR_,
                            true,
                            $cart->id_shop
                        )
                    ) {
                        die(json_encode(array('errors' => false, 'result' => $this->trans('The email was sent to your customer.', array(), 'Admin.Orderscustomers.Notification'))));
                    }
                }
            }
            $this->content = json_encode(array('errors' => true, 'result' => $this->trans('Error in sending the email to your customer.', array(), 'Admin.Orderscustomers.Notification')));
        }
    }

 

 

Cordialement,

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More