Add Community Builder custom field value to email

  • Posts: 75
  • Thank you received: 7
9 years 3 months ago #212071

-- HikaShop version -- : 2.5.0
-- Joomla version -- : 3.3.6
-- PHP version -- : 5.4.41
-- Browser(s) name and version -- : Chrome 44.0.2403.155

Hi all,

I'm not quite sure if this is entirely a Hikashop question.

We're using Hikashop Business Edition. We have Community Builder integration for the users.

We have a custom field for users to fill out, let's say it's "Company".

In our email templates, how can I get the value of the "Company" field to appear in the subject line of the order emails.

Right now the "NEW_ORDER_SUBJECT" language constant is in place for the subject, but I'm not sure how to grab the value from the Community Builder custom field to add it there.

Is there a way for Hikashop to get the value of the custom field, or is this more of a Community Builder issue?

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

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
9 years 3 months ago #212124

Hi,

The subject is generated with the line:

$order->mail->subject = JText::sprintf('NEW_ORDER_SUBJECT',$order->order_number,HIKASHOP_LIVE);
in the file administrator/components/com_hikashop/classes/order.php
If you want to have other dynamic data in the subject, you'll have to modify that line of code.
If you want to have the company of the user in CB, you'll have to load that from the CB table where that is stored with a MySQL query.
The exact MySQL query would be something to ask to CB support.
Just note that you can get the user id in the variable: $order->customer->id
It will be useful in the MySQL query to CB.

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

  • Posts: 75
  • Thank you received: 7
9 years 3 months ago #212173

OK thanks, this puts me on the right track.

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

Time to create page: 0.056 seconds
Powered by Kunena Forum