Skip to main content

How to include customer's email address on invoice

More
14 years 10 months ago #29539 by tomh73
Hi,

How can I include the customer's e-mail address on the invoice?
Probably very simple but I cannot figure it out.

regards,

Tom

Please Log in or Create an account to join the conversation.

More
14 years 10 months ago #29553 by nicolas
Hi,

You need to edit the file "invoice" via the menu Display->Views and add the line:
<?php echo $this->element->customer->user_email; ?>
The following user(s) said Thank You: woonydanny

Please Log in or Create an account to join the conversation.

More
14 years 10 months ago #29566 by tomh73
Hi,

this will add the mail address to the invoice at the back-end, but I need to add it to the invoice that is e-mailed to the customer.
I hope you can help.

regards,Tom

Please Log in or Create an account to join the conversation.

More
14 years 10 months ago #29567 by nicolas
Hi,

For that, you can edit the order status/creation notification emails via the menu System->Emails (Business edition only) and add something like that:
<?php echo $data->customer->user_email; ?>

Please Log in or Create an account to join the conversation.

More
14 years 10 months ago #29574 by tomh73
Hi,

Almost there....
I have added it to order_creation_notification.html.php and it works perfectly, but when I also add it to the order_admin_notification.html.php, It displays "Array" in the e-mail instead of the e-mail address.

Do I have to add something else than: <?php echo $data->customer->user_email; ?> for the admin order notification email?

regards,
Tom

Please Log in or Create an account to join the conversation.

More
14 years 10 months ago #29578 by nicolas
Yes. The admin notification is sent to the admin, not to the customer.
That's why you need another code:
<?php
$userClass = hiakshop_get('class.user');
$user = $userClass->get($data->order_user_id);
echo $user->user_email; ?>

I understand that you modified the email files directly. Please note that, unlike when you edit the emails via the interface, you will loose your changes when you update as new versions of these will replace them.

Please Log in or Create an account to join the conversation.

More
14 years 10 months ago #29581 by tomh73
Sorry, now it hangs during checkout on http://....nl/component/hikashop/checkout/step/step-1.html, showing a white screen with the invoice.

regards,
Tom

Please Log in or Create an account to join the conversation.

More
14 years 10 months ago #29584 by nicolas
The is a typo in my code. It should be hikashop_get and not hiakshop_get
That's maybe why.

Please Log in or Create an account to join the conversation.

More
14 years 10 months ago #29587 by tomh73
sorry, I already tried that.
I still get the same white screen with the invoice.

regards,Tom

Please Log in or Create an account to join the conversation.

More
14 years 10 months ago #29589 by nicolas
Then it means that you didn't add the modification properly in the code

Please Log in or Create an account to join the conversation.

More
14 years 10 months ago #30120 by tomh73
I am sorry, I have tried many times, but your code is not working.
Does someone else know how I can do this very simple thing?
I like to add the customer's email address to the Order creation notification e-mail.

Please Log in or Create an account to join the conversation.

More
14 years 10 months ago #30151 by nicolas
Please do a screenshot of how you added your code and we might be able to tell you what is wrong.

Also, you could try to increase the error reporting option of the joomla configuration and try to send the email again, that might display the error message instead of the white screen and that would help us tell you what to do.

Please Log in or Create an account to join the conversation.

More
14 years 9 months ago #33155 by tomh73
Hi,

Here is a screenshot on how I added the code to order_admin_notification.html.php in order to add the e-mail address into the e-mail.

It hangs during checkout. I hope you can tell me what I am doing wrong.

Best regards,

Tom

Please Log in or Create an account to join the conversation.

More
14 years 9 months ago #33196 by nicolas
There is a typo in the class name.
You wrote hikakshop_get instead of hikashop_get

Please Log in or Create an account to join the conversation.

More
14 years 9 months ago #33290 by tomh73
Thank you, the white screen is gone but in the admin email, it does not return the customers e-mail address, instead of an email address it returns "Array" (see attachment of a screenshot)

Please Log in or Create an account to join the conversation.

More
14 years 9 months ago #33311 by nicolas
Please use that code instead:
<?php
$userClass = hikashop_get('class.user');
$userClass->get(false);
$user = $userClass->get($data->order_user_id);
echo $user->user_email;
?>
The following user(s) said Thank You: woonydanny

Please Log in or Create an account to join the conversation.

More
14 years 9 months ago #33316 by tomh73
Thank you very much, it works perfectly!

Best regards,
Tom

Please Log in or Create an account to join the conversation.

More
14 years 9 months ago #33353 by alexintras
Great!
Exactly what I was need!
Can you help also with code for "selected payment method"?

Please Log in or Create an account to join the conversation.

More
14 years 9 months ago #33386 by nicolas

Please Log in or Create an account to join the conversation.

More
14 years 3 months ago #54724 by Mat
What is the difference between the order creation notification and order status notification emails?

Which do I edit for the customer's receipt of purchase.

Please Log in or Create an account to join the conversation.

Time to create page: 0.287 seconds
Powered by Kunena Forum