Custom fields in administrator email notification

  • Posts: 71
  • Thank you received: 0
10 years 9 months ago #138748

-- url of the page with the problem -- : demo.soloweb.es
-- HikaShop version -- : 2.2.3
-- Joomla version -- : 3.2.1
-- PHP version -- : 5.3.10
-- Browser(s) name and version -- : XXXXX x.x.x
-- Error-message(debug-mod must be tuned on) -- : Error_message

Hi
I have some custom fields in table user.
How I can see in the ORDER_ADMIN_NOTIFICATION_SUBJECT, ORDER_CREATION_NOTIFICATION_SUBJECT and ORDER_STATUS_NOTIFICATION_SUBJECT include the custom fields in the table "user"


Thanks

Regards

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

  • Posts: 12953
  • Thank you received: 1778
10 years 9 months ago #138773

Hi,
There is no option to do that, so the solution will be to edit the file "administrator\components\com_hikashop\classes\order.php" and edit this line :

$order->mail->subject = JText::sprintf($order->mail->subject,$order->order_number,$mail_status,HIKASHOP_LIVE);

The following user(s) said Thank You: vaughan

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

  • Posts: 71
  • Thank you received: 0
10 years 9 months ago #139100

Thanks for your help.

Could you help with the code, please? the custom fileds in User Table are "Name, Last Name, VAT number, Address and City)
Yes, these field are same the adress table, but I need use this fields in the User table with custom fields :blush:

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

  • Posts: 13201
  • Thank you received: 2322
10 years 9 months ago #139199

Hi,

Do you want to add them in the subject of the email or in the email body ?
If it is in the body, you can use code like:

{VAR:user.custom_field_name}

The following user(s) said Thank You: vaughan

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

  • Posts: 71
  • Thank you received: 0
10 years 9 months ago #139246

Thanks Xavier.

Yes in the email body. This CODE is in the class order.php or in the email template? Where in the code?

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

  • Posts: 82723
  • Thank you received: 13338
  • MODERATOR
10 years 9 months ago #139343

This code is to be added in the email template via the menu System>Emails.

The following user(s) said Thank You: vaughan

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

  • Posts: 71
  • Thank you received: 0
10 years 9 months ago #139373

I try to use this code but it don't works, show blank
I got it using this code:

<?php echo JText::sprintf(@$data->customer->custom_field);?>

It's correct too?

Thanks

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

  • Posts: 13201
  • Thank you received: 2322
10 years 9 months ago #139433

Hi,

Yes it's correct too.

The following user(s) said Thank You: vaughan

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

  • Posts: 28
  • Thank you received: 0
8 years 7 months ago #233678

Hi

Do you want to add them in the subject of the email or in the email body ?
If it is in the body, you can use code like:
{VAR:user.custom_field_name}


Following your example, I added this code in the order admin notification email body :
<br/>Infos utiles : {VAR:address.infosutiles}
Like this :


infosutiles is the name of my address custom field.

But I only see the text "Infos utiles :" but nothing else in the notification email...

I also tried : {VAR:user.infosutiles} and {VAR:user.address.infosutiles}. None of them are working.

Can you help on this ?
Thanks !

Last edit: 8 years 7 months ago by AntinJH.

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

  • Posts: 82723
  • Thank you received: 13338
  • MODERATOR
8 years 7 months ago #233712

Hi,

Remember that you can have both a billing and a shipping address.
Because of that, we had to separate them.
So you can do either:
{VAR:billing_address.infosutiles}
or:
{VAR:shipping_address.infosutiles}

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

  • Posts: 28
  • Thank you received: 0
8 years 7 months ago #234497

It works perfectly ! THANKS !

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

Time to create page: 0.092 seconds
Powered by Kunena Forum