Jump to content

Howto show customer email on order-confirmation page


Recommended Posts

  • 3 weeks later...

Hi,

 

at first text 'An e-mail has been sent to you with this information.' is not a part of order-confirmation.tpl but payment-return.tpl files of your payment modules (bankwire, cheque...).

So you need to delete that text from payment-return.tpl then add something like this into order-confirmation.tpl

<p>{l s='An e-mail has been sent to your email '}{$email}{l s=' with this information.'}</p>

 

Next little OrderConfirmationController.php modification

change or override original function

public function initContent()
{
 parent::initContent();
 $this->context->smarty->assign(array(
  'is_guest' => $this->context->customer->is_guest,
  'HOOK_ORDER_CONFIRMATION' => $this->displayOrderConfirmation(),
  'HOOK_PAYMENT_RETURN' => $this->displayPaymentReturn()
 ));
 if ($this->context->customer->is_guest)
 {
  $this->context->smarty->assign(array(
'id_order' => $this->id_order,
'reference_order' => $this->reference,
'id_order_formatted' => sprintf('#%06d', $this->id_order),
'email' => $this->context->customer->email  // works only if customer is guest
  ));
  /* If guest we clear the cookie for security reason */
  $this->context->customer->mylogout();
 }
 $this->setTemplate(_PS_THEME_DIR_.'order-confirmation.tpl');
}

 

with this

public function initContent()
{
 parent::initContent();
 $this->context->smarty->assign(array(
  'is_guest' => $this->context->customer->is_guest,
  'HOOK_ORDER_CONFIRMATION' => $this->displayOrderConfirmation(),
  'HOOK_PAYMENT_RETURN' => $this->displayPaymentReturn(),
  'email' => $this->context->customer->email // works for registered and guest customers
 ));
 if ($this->context->customer->is_guest)
 {
  $this->context->smarty->assign(array(
'id_order' => $this->id_order,
'reference_order' => $this->reference,
'id_order_formatted' => sprintf('#%06d', $this->id_order),  
  ));
  /* If guest we clear the cookie for security reason */
  $this->context->customer->mylogout();
 }
 $this->setTemplate(_PS_THEME_DIR_.'order-confirmation.tpl');
}

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

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...