- Posts: 62
- Thank you received: 0
Email Customisation
So with this in mind I have a couple of questions.
1. When are the following emails sent and to whom are they sent?
Order administrator notification
Order creation notification
Order status notification
Order notification
User account
2. Within these templates I see that the variable $data is used to obtain order_number, order_payment_method, order_full_price ect. Can you please point me in the direction of where this is all declared so I can get a comprehensive list of what data is available to call upon when customising the emails? For example I would like to include the coupon code, customer email and tax codes used.
Thank You
Please Log in or Create an account to join the conversation.
Order administrator notification -> to the admin when the order is created
Order creation notification -> to the user when the order is created
Order status notification -> to the user when the order is confirmed
Order notification -> to the user when the admin send an email for an order from the back end
User account -> to the user when he creates a new account on HikaShop registration page/checkout page
2.
The $data comes from different places. One example is in the after_confirm function of the file components/com_hikashop/controller/checkout.php
The coupon code is in: $data->order_discount_code
The email is in: $data->customer->user_email
What do you mean by tax code ?
Please Log in or Create an account to join the conversation.
By Tax codes I just meant which Tax rate was applied.
This should be ok though as I only have one and therefore if there is a Tax value then I know the tax rate.
Please Log in or Create an account to join the conversation.
echo 'Email: '.$data->customer->user_email.' returns Email: Array
What code is required to return the email string?
I would also like the same for the customer phone number.
Please Log in or Create an account to join the conversation.
echo 'Email: '.$data->customer->user_email[0];
For the phone number you can do like that:
$address = $data->order_addresses[$data->cart->billing_address->address_id];
echo 'Phone: '.$address->address_phone;
Please Log in or Create an account to join the conversation.
This does not return the customers email it returns the administrator email. In other words the email to which the notification is being sent.
I would like to display the email address of the customer who bought the products.
Please Log in or Create an account to join the conversation.
For the admin email, you need to use the code:
$user = hikashop::loadUser(true);
echo $user->user_email;
Please Log in or Create an account to join the conversation.
echo 'Email: '.$user->user_email[0];
This has returned the same result. Admin email address.
Please Log in or Create an account to join the conversation.
You could try like that:
$userCMS =& JFactory::getUser();
echo $userCMS->get('email');
Please Log in or Create an account to join the conversation.
All my email customisations are now complete.
Please Log in or Create an account to join the conversation.
- Posts: 11
- Thank you received: 0
Thanks
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
- Posts: 102
- Thank you received: 0
$userCMS =& JFactory::getUser();
echo $userCMS->get('email');
returns null.
the others returned exactly what divine said. an array and then the admin email.
i am using the business edition (latest). joomla 1.5.23
can you help?
thanks liz
Please Log in or Create an account to join the conversation.
$userCMS =& JFactory::getUser();
echo $userCMS->get('email');
will only return null if the user is not logged in. So I presume that it's the case ?
alternatively, you can try that:
$userClass = hiakshop_get('class.user');
$user = $userClass->get($data->order_user_id);
echo $user->user_email;
Please Log in or Create an account to join the conversation.
- Posts: 102
- Thank you received: 0
Call to undefined function hiakshop_get() in /..mypathhere../media/com_hikashop/mail/order_admin_notification.html.modified.php on line 10
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
- Posts: 102
- Thank you received: 0
when i dump the array it returns only one item. our email address not the customers email address.
help!
we really need this.
thanks, Liz
Please Log in or Create an account to join the conversation.
$userClass = hiakshop_get('class.user');
$userClass->get(false);
$user = $userClass->get($data->order_user_id);
echo $user->user_email;
That will reset the cache before loading the user information from the database.
Please Log in or Create an account to join the conversation.
- Posts: 13
- Thank you received: 1
$userClass = hikashop_get('class.user');
$userClass->get(false);
$user = $userClass->get($data->order_user_id);
echo $user->user_email;
This gotta work for u..
Please Log in or Create an account to join the conversation.