John Smith
John Smith

Reputation: 21

Prestashop - Howto show customer email on order-confirmation page

On order-confirmation page, it says 'An e-mail has been sent to you with this information.'

I want to show the recievers email

'An e-mail has been sent to your email [email protected] with this information.

Where to change this

Upvotes: 2

Views: 7142

Answers (1)

Alexander Simonchik
Alexander Simonchik

Reputation: 966

You need override OrderConfirmationController::process() with this code:

public function process()
    {
        parent::process();
        self::$smarty->assign(array(
            'is_guest' => self::$cookie->is_guest,
            'HOOK_ORDER_CONFIRMATION' => Hook::orderConfirmation((int)($this->id_order)),
            'HOOK_PAYMENT_RETURN' => Hook::paymentReturn((int)($this->id_order), (int)($this->id_module))
        ));

        $order = new Order((int)($this->id_order)); //create order object
        $customer = new Customer((int)($order->id_customer)); //create customer object

        if (self::$cookie->is_guest)
        {
            self::$smarty->assign(array(
                'id_order' => $this->id_order,
                'customer' => $customer, //assign variable
                'id_order_formatted' => sprintf('#%06d', $this->id_order)
            ));
            /* If guest we clear the cookie for security reason */
            self::$cookie->mylogout();
        }
    }

After that you'll be able to use {$customer->email} for receiving customers e-mail in order-confirmation.tpl of your theme.

Regards

Upvotes: 0

Related Questions