Inserting DB info to custom emails

  • Posts: 136
  • Thank you received: 1
13 years 8 months ago #11331

Hi guys,

I've heavily modified the Order_status_notification email to send details to the buyer. I've sent a few forum posts to you which have been incredibly helpful!

I need to repeat the customer user name but am unable to get it to display again. I've tried various things as listed below.

<?php echo JText::sprintf('HI_CUSTOMER',@$data->customer->name); ?> - copied the code you have in the beginning of the email.

Then tried these.....

Test 1<?php echo JText::sprintf('HI_CUSTOMER',@$data->customer->name); ?> </br>
Test 2<?php echo $data->customer->name; ?></br>
Test 3<?php echo $data->customer->user_email; ?> </br>
Name: <?php echo $data->recipient_name; ?></br>
Voucher #: <?php echo $data->order_id; ?><br />

And finally.....

<?php
/*
Goals: to display both the purchaser's name and the gift recipients' name
*/

//$productClass = hikashop::get('class.users');
//echo JText::sprintf('HI_CUSTOMER',@$data->customer->user);
//echo $data->customer->user_id;

$class = hikashop::get('class.order');
echo "This is the user_id in hikashop>order table: " . $data->order_user_id . "<br />";

//echo $data->customer->user_id;
//$class = hikashop::get('class.user');
//echo "name " .$data->customer->user;
?>


How can I display the user name?

I hope this is enough detail, I have also attached a screenshot of the mock up layout. I have the majority of the information now, it's just a matter of getting the user name or gift recipient to display.

Thank you in advance,

Attachments:

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
13 years 8 months ago #11332

Hi you want to display the name of the buyer then $data->customer->name should work.
If you want to display the name of the recipient, it will depend on how you added the input box to ask the name of the recipient...
If you created a custom order field, then you can do like this: echo $data->CUSTOM_FIELD_COLUMN_NAME;

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

  • Posts: 38
  • Thank you received: 0
13 years 8 months ago #11392

Hello.

I'm trying to do something very similar but I'd like the details of the user placing the order sent to the admin instead. Right now I have been able to add the e-mail address but I'd like the admin notification e-mail to also show the name and city of the user placing the order (and possibly some other details).

How can this be done?

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
13 years 8 months ago #11393

You can find on that post www.hikashop.com/en/support/forum/5-supp...e-commande.html#8788 the content to put in the order admin notification email if you want the admin to receive all the order details, like in the email sent to the user.

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

  • Posts: 38
  • Thank you received: 0
13 years 8 months ago #11394

Blazing fast support, thanks so much!

I'm a very happy user. :0)

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

  • Posts: 20
  • Thank you received: 0
13 years 8 months ago #11468

Hello Nicolas,

What file do we modify to include custom DB fields for administrators. I'm having trouble finding the correct file.

thanks

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

  • Posts: 20
  • Thank you received: 0
13 years 8 months ago #11469

Hello Nicolas,

What file do we modify to include custom DB fields for administrators. I'm having trouble finding the correct file.

thanks

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
13 years 8 months ago #11471

echo $data->customer->CUSTOM_FIELD_COLUMN_NAME;

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

  • Posts: 20
  • Thank you received: 0
13 years 8 months ago #11474

Thanks, but in what file is the format for the admin notification email located?

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
13 years 8 months ago #11475

You need to go in the menu System->Emails and edit the email "order admin notification". That functionality is available in the business edition of hikashop.

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

Time to create page: 0.084 seconds
Powered by Kunena Forum