Hi there,
Is there a possibility to include the customer name and phone number into the order email template? I’ve tried the solutions from the OC forum but I am still unable to make it to work.
It would be great if you could help.
Thanks.
|
|
Hi,
in order to achieve this, you need to make modifications in catalog/model/checkout/order.php . The method responsible for the email is public function confirm() . Find this row $template->data['ip'] = $order_info['ip']; and insert this after it:
$template->data['order_info'] = $order_info;
Then in your template catalog/view/theme/default/template/mail/order.tpl you can display the name and the phone like so:
<?php echo $order_info['firstname']; ?>
<?php echo $order_info['lastname']; ?>
<?php echo $order_info['telephone']; ?>
I didn’t test this, so I hope it would work.
Regards!
|
|
sorry i meant to say in the subject title of the order confirmation. Currently the title is MyStore – Order 5340 . Is it possible to change it to something like MyStore – Order 5340 – John Doe – 1234567 ? 1234567 being the phone number
I really appreaciate your help on this matter even though this may not be theme related. really a big thank you.
|
|
Yes, this question is not related to Shoppica, but I will try to give you some hints.
You must first edit the language file catalog/language/english/mail/order.php
Change
$_['text_new_subject'] = '%s - Order %s';
to
$_['text_new_subject'] = '%s - Order %s - %s - %s';
Then open catalog/model/checkout/order.php in order to change the email title/subject. GoTo line 212, which should contain:
$subject = sprintf($language->get('text_new_subject'), $order_info['store_name'], $order_id);
and change it to:
$subject = sprintf($language->get('text_new_subject'), $order_info['store_name'], $order_id, $order_info['firstname'] . $order_info['lastname'], $order_info['telephone']);
Then GoTo line 217, which should contain:
$template->data['title'] = sprintf($language->get('text_new_subject'), html_entity_decode($order_info['store_name'], ENT_QUOTES, 'UTF-8'), $order_id);
and change it to:
$template->data['title'] = sprintf($language->get('text_new_subject'), html_entity_decode($order_info['store_name'], ENT_QUOTES, 'UTF-8'), $order_id, $order_info['firstname'] . $order_info['lastname'], $order_info['telephone']);
Check if this works.
|
|
Thanks!!!!! Very very happy now.
That solves it. I really appreciate your help.
|
|