How to include customer's email address on invoice

  • Posts: 25
  • Thank you received: 0
12 years 11 months ago #29539

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.

  • Posts: 82727
  • Thank you received: 13342
  • MODERATOR
12 years 11 months ago #29553

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.

  • Posts: 25
  • Thank you received: 0
12 years 11 months ago #29566

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.

  • Posts: 82727
  • Thank you received: 13342
  • MODERATOR
12 years 11 months ago #29567

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.

  • Posts: 25
  • Thank you received: 0
12 years 11 months ago #29574

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.

  • Posts: 82727
  • Thank you received: 13342
  • MODERATOR
12 years 11 months ago #29578

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.

  • Posts: 25
  • Thank you received: 0
12 years 11 months ago #29581

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.

  • Posts: 82727
  • Thank you received: 13342
  • MODERATOR
12 years 11 months ago #29584

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.

  • Posts: 25
  • Thank you received: 0
12 years 11 months ago #29587

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.

  • Posts: 82727
  • Thank you received: 13342
  • MODERATOR
12 years 11 months ago #29589

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.

  • Posts: 25
  • Thank you received: 0
12 years 11 months ago #30120

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.

  • Posts: 82727
  • Thank you received: 13342
  • MODERATOR
12 years 11 months ago #30151

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.

  • Posts: 25
  • Thank you received: 0
12 years 10 months ago #33155

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

Attachments:

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

  • Posts: 82727
  • Thank you received: 13342
  • MODERATOR
12 years 10 months ago #33196

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.

  • Posts: 25
  • Thank you received: 0
12 years 10 months ago #33290

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)

Attachments:

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

  • Posts: 82727
  • Thank you received: 13342
  • MODERATOR
12 years 10 months ago #33311

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.

  • Posts: 25
  • Thank you received: 0
12 years 10 months ago #33316

Thank you very much, it works perfectly!

Best regards,
Tom

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

  • Posts: 32
  • Thank you received: 0
12 years 10 months ago #33353

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.

  • Posts: 82727
  • Thank you received: 13342
  • MODERATOR
12 years 10 months ago #33386

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

  • Posts: 217
  • Thank you received: 1
12 years 4 months ago #54724

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.112 seconds
Powered by Kunena Forum