Jump to content

Email in order-confirmation


aquilaziale

Recommended Posts

Hello,

 

Is it possible to have the customer email in order-confirmation.php ? I need it for an affiliate tracking.

I used the module "affiliatetracking_0.2", that give me the orderId, the total paid, . . . but not the customer email.

 

So, I checked the module and I saw these line :

 

public function hookOrderConfirmation($params)
{
global $smarty;

$order = $params['objOrder'];
$currency = $params['currencyObj'];
$smarty->assign(array(
'orderId' => $order->id,
'total' => $order->total_paid - $order->total_shipping,
'totalPaid' => $order->total_paid,
'totalProducts' => $order->total_products,
'totalCommision' => $order->total_products * 10 / 100,
'currency' => $currency->iso_code
));

 

And I tried to add this one :

 

'email' => $customer->email

 

but it doesn't work. Could you help me ? Thank you very much.

Link to comment
Share on other sites

try adding this line as well

$customer = new Customer($order->id_customer);

 

so it should look like...

public function hookOrderConfirmation($params)
{
global $smarty;

$order = $params['objOrder'];
$customer = new Customer($order->id_customer);
$currency = $params['currencyObj'];
$smarty->assign(array(
'orderId' => $order->id,
'total' => $order->total_paid - $order->total_shipping,
'totalPaid' => $order->total_paid,
'totalProducts' => $order->total_products,
'totalCommision' => $order->total_products * 10 / 100,
'currency' => $currency->iso_code,
'email' => $customer->email
));

 

then you need to also edit the themes template file to show the email address

Edited by bellini13 (see edit history)
Link to comment
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...