Prestashop - 如何在订单确认页面上显示客户电子邮件

时间:2012-11-02 10:04:07

标签: php prestashop

在订单确认页面上,它显示“已使用此信息向您发送了一封电子邮件。”

我想向收件人发送电子邮件

'已使用此信息向您的电子邮件eee@example.com发送了一封电子邮件。

在何处更改

1 个答案:

答案 0 :(得分:0)

您需要使用以下代码覆盖OrderConfirmationController :: process():

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();
        }
    }

之后,您将能够使用{$customer->email}在主题的order-confirmation.tpl中接收客户的电子邮件。

此致