- Posts: 157
- Thank you received: 8
How to add customer's email address to invoice
Anyone know what the code needs to be to accomplish this?
Please Log in or Create an account to join the conversation.
<?php echo $this->order->customer->user_email; ?>
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Does this still work?
I tried adding <?php echo $this->order->customer->user_email; ?> to the invoice.php pdf file and it doesnt return anything, I was hoping to have Dear 'Name' (email), thank you for your purchase...
Kind regards
Alex
Please Log in or Create an account to join the conversation.
As Nicolas said previously, are you sure you are editing the file for the right template?
You can simply add a var_dump($this); in the code if you want to see all the variable available.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
<?php echo $order->customer->user_email; ?>
Please Log in or Create an account to join the conversation.
I believe this is the display > view section of the billing/shipping address where I would like the email address to come after:
current output: Mr. Customer
123 Main St.
92081 Vista, CA
United States of America
Telephone: 619.345.3422
Add email Here xxxxxxxxxx
Please Log in or Create an account to join the conversation.
You can add your code just before the tag </fieldset> in that piece of code.
Note however that it's not :
<?php echo $this->order->customer->user_email; ?>
but:
<?php echo $this->element->customer->user_email; ?>
that you should now use.
Also note that even if you make a mistake in a view file, you can click on the bin icon on the listing for that view file to revert to the default code. So you can do modifications by trial and error in the view files for small modifications like that.
Please Log in or Create an account to join the conversation.
After updating Hikashop to 3.2.2 and the new attach invoice plugin this line stops working.
i tried to add $this->order or $this->element befor </fieldset> but both result in empty.
Can you have a look at it? Thanks!
Please Log in or Create an account to join the conversation.
This will work for me:
<?php echo $order->customer->user_email; ?>
Please Log in or Create an account to join the conversation.