[Skip to main content](#vessel-content)

#   Adding custom order field to emails

##

- **[cnc](/forum/user/31447-cnc "View cnc's Profile")**
- [![cnc's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/31447-cnc "View cnc's Profile") Topic Author
- [ Offline](/forum/user/31447-cnc)

Less More

- Posts: 7
- Thank you received: 0
-
-

12 years 3 weeks ago [\#174425](#174425) by [cnc](/forum/user/31447-cnc "View cnc's Profile")  *[Adding custom order field to emails](/forum/35-orders-management/872113-adding-custom-order-field-to-emails#174425 "-- HikaShop version -- : 2.3.3 -- Joomla version -- : 2.5.27  Hi All new to this and learning as I go. I have created a custom text field called &quot;activation&#95;code&quot; to the orders table which I want to use to enter and send a code to the customer after I have received payment in the confirmed/shipping email to the customer. I have read various topics in the board but still rather confused which system&gt;&gt; email to modify as I tried adding the following   {VAR:ACTIVATION&#95;CODE}  and before the line  into the status notification email just after the section on &quot;additional text&quot; but the information did not show in the email.  Would someone please give me some simple instructions to how to achieve this. Thanks")* was created by *[cnc](/forum/user/31447-cnc "View cnc's Profile")*

-- HikaShop version -- : 2.3.3
-- Joomla version -- : 2.5.27

Hi
All new to this and learning as I go.
I have created a custom text field called "activation_code" to the orders table which I want to use to enter and send a code to the customer after I have received payment in the confirmed/shipping email to the customer. I have read various topics in the board but still rather confused which system&gt;&gt; email to modify as I tried adding the following

&lt;p style="border-bottom:1px solid #ddd;padding-bottom:10px;"&gt;
{VAR:ACTIVATION_CODE}
&lt;/p&gt;
and before the line
&lt;!--{ENDIF:ORDER_SUMMARY}--&gt;
into the status notification email just after the section on "additional text" but the information did not show in the email.

Would someone please give me some simple instructions to how to achieve this. Thanks

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL29yZGVycy1tYW5hZ2VtZW50Lzg3MjExMy1hZGRpbmctY3VzdG9tLW9yZGVyLWZpZWxkLXRvLWVtYWlscz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26394
- Thank you received: 4078
-
- [](http://obsi.dev)
-

12 years 3 weeks ago [\#174436](#174436) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Adding custom order field to emails](/forum/35-orders-management/872113-adding-custom-order-field-to-emails#174436 "-- HikaShop version -- : 2.3.3 -- Joomla version -- : 2.5.27  Hi All new to this and learning as I go. I have created a custom text field called &quot;activation&#95;code&quot; to the orders table which I want to use to enter and send a code to the customer after I have received payment in the confirmed/shipping email to the customer. I have read various topics in the board but still rather confused which system&gt;&gt; email to modify as I tried adding the following   {VAR:ACTIVATION&#95;CODE}  and before the line  into the status notification email just after the section on &quot;additional text&quot; but the information did not show in the email.  Would someone please give me some simple instructions to how to achieve this. Thanks")*

Hi,

What do you means with "custom text field" ?
{VAR:ACTIVATION_CODE} will display the variable ACTIVATION_CODE that you have to create in the email preload.
If you want to display an element from the order, the product or the item ; you have to use Code:

{VAR:order.my_order_custom_field} {LINEVAR:product.my_product_custom_field} {LINEVAR:item.my_item_custom_field}

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL29yZGVycy1tYW5hZ2VtZW50Lzg3MjExMy1hZGRpbmctY3VzdG9tLW9yZGVyLWZpZWxkLXRvLWVtYWlscz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[cnc](/forum/user/31447-cnc "View cnc's Profile")**
- [![cnc's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/31447-cnc "View cnc's Profile") Topic Author
- [ Offline](/forum/user/31447-cnc)

Less More

- Posts: 7
- Thank you received: 0
-
-

12 years 3 weeks ago [\#174555](#174555) by [cnc](/forum/user/31447-cnc "View cnc's Profile")  Replied by *[cnc](/forum/user/31447-cnc "View cnc's Profile")* on topic *[Adding custom order field to emails](/forum/35-orders-management/872113-adding-custom-order-field-to-emails#174555 "-- HikaShop version -- : 2.3.3 -- Joomla version -- : 2.5.27  Hi All new to this and learning as I go. I have created a custom text field called &quot;activation&#95;code&quot; to the orders table which I want to use to enter and send a code to the customer after I have received payment in the confirmed/shipping email to the customer. I have read various topics in the board but still rather confused which system&gt;&gt; email to modify as I tried adding the following   {VAR:ACTIVATION&#95;CODE}  and before the line  into the status notification email just after the section on &quot;additional text&quot; but the information did not show in the email.  Would someone please give me some simple instructions to how to achieve this. Thanks")*

I mean that I went to Display menu in Hikashop and then choose custom field from the drop down menu and then created a new custom field called activation_code of type text in the orders table.

what is the difference between LINEVAR and VAR?

so in the email preload box for the status notification email I type in {VAR:order.activiation_code} and the activation code will now appear in the email message?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL29yZGVycy1tYW5hZ2VtZW50Lzg3MjExMy1hZGRpbmctY3VzdG9tLW9yZGVyLWZpZWxkLXRvLWVtYWlscz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

12 years 2 weeks ago [\#174595](#174595) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Adding custom order field to emails](/forum/35-orders-management/872113-adding-custom-order-field-to-emails#174595 "-- HikaShop version -- : 2.3.3 -- Joomla version -- : 2.5.27  Hi All new to this and learning as I go. I have created a custom text field called &quot;activation&#95;code&quot; to the orders table which I want to use to enter and send a code to the customer after I have received payment in the confirmed/shipping email to the customer. I have read various topics in the board but still rather confused which system&gt;&gt; email to modify as I tried adding the following   {VAR:ACTIVATION&#95;CODE}  and before the line  into the status notification email just after the section on &quot;additional text&quot; but the information did not show in the email.  Would someone please give me some simple instructions to how to achieve this. Thanks")*

Hi,

You have to use this tag in the html part of the email, not in the preload one.

The difference between var and linevar is that var display one value, there is only one value for the activation code in the order, but for the product or item custom fields, as there is possibly many products in the order we use linevar to display the value for each products.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL29yZGVycy1tYW5hZ2VtZW50Lzg3MjExMy1hZGRpbmctY3VzdG9tLW9yZGVyLWZpZWxkLXRvLWVtYWlscz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[cnc](/forum/user/31447-cnc "View cnc's Profile")**
- [![cnc's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/31447-cnc "View cnc's Profile") Topic Author
- [ Offline](/forum/user/31447-cnc)

Less More

- Posts: 7
- Thank you received: 0
-
-

12 years 2 weeks ago [\#174700](#174700) by [cnc](/forum/user/31447-cnc "View cnc's Profile")  Replied by *[cnc](/forum/user/31447-cnc "View cnc's Profile")* on topic *[Adding custom order field to emails](/forum/35-orders-management/872113-adding-custom-order-field-to-emails#174700 "-- HikaShop version -- : 2.3.3 -- Joomla version -- : 2.5.27  Hi All new to this and learning as I go. I have created a custom text field called &quot;activation&#95;code&quot; to the orders table which I want to use to enter and send a code to the customer after I have received payment in the confirmed/shipping email to the customer. I have read various topics in the board but still rather confused which system&gt;&gt; email to modify as I tried adding the following   {VAR:ACTIVATION&#95;CODE}  and before the line  into the status notification email just after the section on &quot;additional text&quot; but the information did not show in the email.  Would someone please give me some simple instructions to how to achieve this. Thanks")*

So what do I put in the pre-load part?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL29yZGVycy1tYW5hZ2VtZW50Lzg3MjExMy1hZGRpbmctY3VzdG9tLW9yZGVyLWZpZWxkLXRvLWVtYWlscz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86290
- Thank you received: 14268
-
-

12 years 2 weeks ago [\#174611](#174611) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Adding custom order field to emails](/forum/35-orders-management/872113-adding-custom-order-field-to-emails#174611 "-- HikaShop version -- : 2.3.3 -- Joomla version -- : 2.5.27  Hi All new to this and learning as I go. I have created a custom text field called &quot;activation&#95;code&quot; to the orders table which I want to use to enter and send a code to the customer after I have received payment in the confirmed/shipping email to the customer. I have read various topics in the board but still rather confused which system&gt;&gt; email to modify as I tried adding the following   {VAR:ACTIVATION&#95;CODE}  and before the line  into the status notification email just after the section on &quot;additional text&quot; but the information did not show in the email.  Would someone please give me some simple instructions to how to achieve this. Thanks")*

Hi,

There is nothing to put in the preload for these tags to work. The are already handled by the preload.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL29yZGVycy1tYW5hZ2VtZW50Lzg3MjExMy1hZGRpbmctY3VzdG9tLW9yZGVyLWZpZWxkLXRvLWVtYWlscz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[cnc](/forum/user/31447-cnc "View cnc's Profile")**
- [![cnc's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/31447-cnc "View cnc's Profile") Topic Author
- [ Offline](/forum/user/31447-cnc)

Less More

- Posts: 7
- Thank you received: 0
-
-

12 years 2 weeks ago [\#174762](#174762) by [cnc](/forum/user/31447-cnc "View cnc's Profile")  Replied by *[cnc](/forum/user/31447-cnc "View cnc's Profile")* on topic *[Adding custom order field to emails](/forum/35-orders-management/872113-adding-custom-order-field-to-emails#174762 "-- HikaShop version -- : 2.3.3 -- Joomla version -- : 2.5.27  Hi All new to this and learning as I go. I have created a custom text field called &quot;activation&#95;code&quot; to the orders table which I want to use to enter and send a code to the customer after I have received payment in the confirmed/shipping email to the customer. I have read various topics in the board but still rather confused which system&gt;&gt; email to modify as I tried adding the following   {VAR:ACTIVATION&#95;CODE}  and before the line  into the status notification email just after the section on &quot;additional text&quot; but the information did not show in the email.  Would someone please give me some simple instructions to how to achieve this. Thanks")*

I added {VAR:order.activiation_code} into the html part and nothing is showing in the email when i press the email button after going into the order and adding the activation code number

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL29yZGVycy1tYW5hZ2VtZW50Lzg3MjExMy1hZGRpbmctY3VzdG9tLW9yZGVyLWZpZWxkLXRvLWVtYWlscz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26394
- Thank you received: 4078
-
- [](http://obsi.dev)
-

12 years 2 weeks ago [\#174781](#174781) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Adding custom order field to emails](/forum/35-orders-management/872113-adding-custom-order-field-to-emails#174781 "-- HikaShop version -- : 2.3.3 -- Joomla version -- : 2.5.27  Hi All new to this and learning as I go. I have created a custom text field called &quot;activation&#95;code&quot; to the orders table which I want to use to enter and send a code to the customer after I have received payment in the confirmed/shipping email to the customer. I have read various topics in the board but still rather confused which system&gt;&gt; email to modify as I tried adding the following   {VAR:ACTIVATION&#95;CODE}  and before the line  into the status notification email just after the section on &quot;additional text&quot; but the information did not show in the email.  Would someone please give me some simple instructions to how to achieve this. Thanks")*

Hi,

Did you put the code in the email "order notification" ?
This email is used when you click on on the "email" button in the backend.

I personally re-test the feature using an order custom field and the content {VAR:order.my_order_custom_field} and I displayed the content of my text order custom field.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL29yZGVycy1tYW5hZ2VtZW50Lzg3MjExMy1hZGRpbmctY3VzdG9tLW9yZGVyLWZpZWxkLXRvLWVtYWlscz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[cnc](/forum/user/31447-cnc "View cnc's Profile")**
- [![cnc's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/31447-cnc "View cnc's Profile") Topic Author
- [ Offline](/forum/user/31447-cnc)

Less More

- Posts: 7
- Thank you received: 0
-
-

12 years 2 weeks ago [\#174851](#174851) by [cnc](/forum/user/31447-cnc "View cnc's Profile")  Replied by *[cnc](/forum/user/31447-cnc "View cnc's Profile")* on topic *[Adding custom order field to emails](/forum/35-orders-management/872113-adding-custom-order-field-to-emails#174851 "-- HikaShop version -- : 2.3.3 -- Joomla version -- : 2.5.27  Hi All new to this and learning as I go. I have created a custom text field called &quot;activation&#95;code&quot; to the orders table which I want to use to enter and send a code to the customer after I have received payment in the confirmed/shipping email to the customer. I have read various topics in the board but still rather confused which system&gt;&gt; email to modify as I tried adding the following   {VAR:ACTIVATION&#95;CODE}  and before the line  into the status notification email just after the section on &quot;additional text&quot; but the information did not show in the email.  Would someone please give me some simple instructions to how to achieve this. Thanks")*

Yes.
Finally, worked it out by putting it just in front of {TXT:ORDER_END_MESSAGE} in the html. I guess it did not show before as it was inside one of the conditional IF clauses.

Now I have worked that one out, the next question is there a way using Hikashop Business to have this linked to a specific product or category of products, e.g. software products or ticket for an event?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL29yZGVycy1tYW5hZ2VtZW50Lzg3MjExMy1hZGRpbmctY3VzdG9tLW9yZGVyLWZpZWxkLXRvLWVtYWlscz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26394
- Thank you received: 4078
-
- [](http://obsi.dev)
-

12 years 2 weeks ago [\#174854](#174854) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Adding custom order field to emails](/forum/35-orders-management/872113-adding-custom-order-field-to-emails#174854 "-- HikaShop version -- : 2.3.3 -- Joomla version -- : 2.5.27  Hi All new to this and learning as I go. I have created a custom text field called &quot;activation&#95;code&quot; to the orders table which I want to use to enter and send a code to the customer after I have received payment in the confirmed/shipping email to the customer. I have read various topics in the board but still rather confused which system&gt;&gt; email to modify as I tried adding the following   {VAR:ACTIVATION&#95;CODE}  and before the line  into the status notification email just after the section on &quot;additional text&quot; but the information did not show in the email.  Would someone please give me some simple instructions to how to achieve this. Thanks")*

Hi,

Link what, link how ?
Please provide more details.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL29yZGVycy1tYW5hZ2VtZW50Lzg3MjExMy1hZGRpbmctY3VzdG9tLW9yZGVyLWZpZWxkLXRvLWVtYWlscz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[cnc](/forum/user/31447-cnc "View cnc's Profile")**
- [![cnc's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/31447-cnc "View cnc's Profile") Topic Author
- [ Offline](/forum/user/31447-cnc)

Less More

- Posts: 7
- Thank you received: 0
-
-

12 years 2 weeks ago [\#174923](#174923) by [cnc](/forum/user/31447-cnc "View cnc's Profile")  Replied by *[cnc](/forum/user/31447-cnc "View cnc's Profile")* on topic *[Adding custom order field to emails](/forum/35-orders-management/872113-adding-custom-order-field-to-emails#174923 "-- HikaShop version -- : 2.3.3 -- Joomla version -- : 2.5.27  Hi All new to this and learning as I go. I have created a custom text field called &quot;activation&#95;code&quot; to the orders table which I want to use to enter and send a code to the customer after I have received payment in the confirmed/shipping email to the customer. I have read various topics in the board but still rather confused which system&gt;&gt; email to modify as I tried adding the following   {VAR:ACTIVATION&#95;CODE}  and before the line  into the status notification email just after the section on &quot;additional text&quot; but the information did not show in the email.  Would someone please give me some simple instructions to how to achieve this. Thanks")*

currently the activation code field appears in every order for every product. How do I get the activation code field (or any custom field) just to be shown for one specific product or even one category of products?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL29yZGVycy1tYW5hZ2VtZW50Lzg3MjExMy1hZGRpbmctY3VzdG9tLW9yZGVyLWZpZWxkLXRvLWVtYWlscz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26394
- Thank you received: 4078
-
- [](http://obsi.dev)
-

12 years 2 weeks ago [\#175162](#175162) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Adding custom order field to emails](/forum/35-orders-management/872113-adding-custom-order-field-to-emails#175162 "-- HikaShop version -- : 2.3.3 -- Joomla version -- : 2.5.27  Hi All new to this and learning as I go. I have created a custom text field called &quot;activation&#95;code&quot; to the orders table which I want to use to enter and send a code to the customer after I have received payment in the confirmed/shipping email to the customer. I have read various topics in the board but still rather confused which system&gt;&gt; email to modify as I tried adding the following   {VAR:ACTIVATION&#95;CODE}  and before the line  into the status notification email just after the section on &quot;additional text&quot; but the information did not show in the email.  Would someone please give me some simple instructions to how to achieve this. Thanks")*

Hi,

I see, you only want to display the field when this field is not empty. Right ?
The best at this moment is to add some code in the preload in order to create a "conditional" value you can would be able to use that in the email Code:

&lt;!--{IF:MY_ORDER_CUSTOM_FIELD}--&gt; My order custom field: {VAR:order.my_order_custom_field} &lt;!--{ENDIF:MY_ORDER_CUSTOM_FIELD}--&gt;

To create that conditional variable, you have to add some code in the end of the "preload" in order to create the variable. Code:

$vars['MY_ORDER_CUSTOM_FIELD'] = !empty($data-&gt;cart-&gt;my_order_custom_field);

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL29yZGVycy1tYW5hZ2VtZW50Lzg3MjExMy1hZGRpbmctY3VzdG9tLW9yZGVyLWZpZWxkLXRvLWVtYWlscz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[cnc](/forum/user/31447-cnc "View cnc's Profile")**
- [![cnc's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/31447-cnc "View cnc's Profile") Topic Author
- [ Offline](/forum/user/31447-cnc)

Less More

- Posts: 7
- Thank you received: 0
-
-

12 years 2 weeks ago -  12 years 2 weeks ago [\#175266](#175266) by [cnc](/forum/user/31447-cnc "View cnc's Profile")  Replied by *[cnc](/forum/user/31447-cnc "View cnc's Profile")* on topic *[Adding custom order field to emails](/forum/35-orders-management/872113-adding-custom-order-field-to-emails#175266 "-- HikaShop version -- : 2.3.3 -- Joomla version -- : 2.5.27  Hi All new to this and learning as I go. I have created a custom text field called &quot;activation&#95;code&quot; to the orders table which I want to use to enter and send a code to the customer after I have received payment in the confirmed/shipping email to the customer. I have read various topics in the board but still rather confused which system&gt;&gt; email to modify as I tried adding the following   {VAR:ACTIVATION&#95;CODE}  and before the line  into the status notification email just after the section on &quot;additional text&quot; but the information did not show in the email.  Would someone please give me some simple instructions to how to achieve this. Thanks")*

That will do.
so at the end of the preload all I need to add is: Code:

$vars['ACTIVATION_CODE'] = !empty($data-&gt;cart-&gt;activation_code);

and if there is a value in the activation_code field it will display and if not the field and its label will not show?

Last edit: 12 years 2 weeks ago by [Jerome](/forum/user/80-jerome "View Jerome's Profile"). Reason: [code] is nice !

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL29yZGVycy1tYW5hZ2VtZW50Lzg3MjExMy1hZGRpbmctY3VzdG9tLW9yZGVyLWZpZWxkLXRvLWVtYWlscz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26394
- Thank you received: 4078
-
- [](http://obsi.dev)
-

12 years 2 weeks ago [\#175294](#175294) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Adding custom order field to emails](/forum/35-orders-management/872113-adding-custom-order-field-to-emails#175294 "-- HikaShop version -- : 2.3.3 -- Joomla version -- : 2.5.27  Hi All new to this and learning as I go. I have created a custom text field called &quot;activation&#95;code&quot; to the orders table which I want to use to enter and send a code to the customer after I have received payment in the confirmed/shipping email to the customer. I have read various topics in the board but still rather confused which system&gt;&gt; email to modify as I tried adding the following   {VAR:ACTIVATION&#95;CODE}  and before the line  into the status notification email just after the section on &quot;additional text&quot; but the information did not show in the email.  Would someone please give me some simple instructions to how to achieve this. Thanks")*

Hi,

I really don't know what I can answer you.
But if you have to paste some code in the forum, please use the "[ code ]" tag, it's better otherwise some elements between brackets won't be displayed in the forum.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL29yZGVycy1tYW5hZ2VtZW50Lzg3MjExMy1hZGRpbmctY3VzdG9tLW9yZGVyLWZpZWxkLXRvLWVtYWlscz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[KeithBlow](/forum/user/33695-keithblow "View KeithBlow's Profile")**
- [![KeithBlow's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/33695-keithblow "View KeithBlow's Profile")
- [ Offline](/forum/user/33695-keithblow)

Less More

- Posts: 38
- Thank you received: 0
-
-

11 years 9 months ago -  11 years 9 months ago [\#185517](#185517) by [KeithBlow](/forum/user/33695-keithblow "View KeithBlow's Profile")  Replied by *[KeithBlow](/forum/user/33695-keithblow "View KeithBlow's Profile")* on topic *[Adding custom order field to emails](/forum/35-orders-management/872113-adding-custom-order-field-to-emails#185517 "-- HikaShop version -- : 2.3.3 -- Joomla version -- : 2.5.27  Hi All new to this and learning as I go. I have created a custom text field called &quot;activation&#95;code&quot; to the orders table which I want to use to enter and send a code to the customer after I have received payment in the confirmed/shipping email to the customer. I have read various topics in the board but still rather confused which system&gt;&gt; email to modify as I tried adding the following   {VAR:ACTIVATION&#95;CODE}  and before the line  into the status notification email just after the section on &quot;additional text&quot; but the information did not show in the email.  Would someone please give me some simple instructions to how to achieve this. Thanks")*

I'm trying to add a custom field too. What am I doing wrong?
Code:

&lt;span style="font-weight: bold;"&gt;Cost Center Number:&lt;/span&gt; {VAR:USER.COSTCENTERNUMBER}

Do I have to declare it in the Preload? If so how?

Last edit: 11 years 9 months ago by [KeithBlow](/forum/user/33695-keithblow "View KeithBlow's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL29yZGVycy1tYW5hZ2VtZW50Lzg3MjExMy1hZGRpbmctY3VzdG9tLW9yZGVyLWZpZWxkLXRvLWVtYWlscz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26394
- Thank you received: 4078
-
- [](http://obsi.dev)
-

11 years 9 months ago [\#185555](#185555) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Adding custom order field to emails](/forum/35-orders-management/872113-adding-custom-order-field-to-emails#185555 "-- HikaShop version -- : 2.3.3 -- Joomla version -- : 2.5.27  Hi All new to this and learning as I go. I have created a custom text field called &quot;activation&#95;code&quot; to the orders table which I want to use to enter and send a code to the customer after I have received payment in the confirmed/shipping email to the customer. I have read various topics in the board but still rather confused which system&gt;&gt; email to modify as I tried adding the following   {VAR:ACTIVATION&#95;CODE}  and before the line  into the status notification email just after the section on &quot;additional text&quot; but the information did not show in the email.  Would someone please give me some simple instructions to how to achieve this. Thanks")*

Hi KeithBlow,

In which email do you want to add this line (order creation / order notification / ...) ?

Just to be sure, what kind of custom field is "COSTCENTERNUMBER" ?
Does his name is in uppercase ?

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL29yZGVycy1tYW5hZ2VtZW50Lzg3MjExMy1hZGRpbmctY3VzdG9tLW9yZGVyLWZpZWxkLXRvLWVtYWlscz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[KeithBlow](/forum/user/33695-keithblow "View KeithBlow's Profile")**
- [![KeithBlow's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/33695-keithblow "View KeithBlow's Profile")
- [ Offline](/forum/user/33695-keithblow)

Less More

- Posts: 38
- Thank you received: 0
-
-

11 years 9 months ago [\#185658](#185658) by [KeithBlow](/forum/user/33695-keithblow "View KeithBlow's Profile")  Replied by *[KeithBlow](/forum/user/33695-keithblow "View KeithBlow's Profile")* on topic *[Adding custom order field to emails](/forum/35-orders-management/872113-adding-custom-order-field-to-emails#185658 "-- HikaShop version -- : 2.3.3 -- Joomla version -- : 2.5.27  Hi All new to this and learning as I go. I have created a custom text field called &quot;activation&#95;code&quot; to the orders table which I want to use to enter and send a code to the customer after I have received payment in the confirmed/shipping email to the customer. I have read various topics in the board but still rather confused which system&gt;&gt; email to modify as I tried adding the following   {VAR:ACTIVATION&#95;CODE}  and before the line  into the status notification email just after the section on &quot;additional text&quot; but the information did not show in the email.  Would someone please give me some simple instructions to how to achieve this. Thanks")*

I want it sent to the admin so they can see the number.

I only put it in capitals because everything else was in capitals. The actually field uses lowercase.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL29yZGVycy1tYW5hZ2VtZW50Lzg3MjExMy1hZGRpbmctY3VzdG9tLW9yZGVyLWZpZWxkLXRvLWVtYWlscz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26394
- Thank you received: 4078
-
- [](http://obsi.dev)
-

11 years 9 months ago [\#185664](#185664) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Adding custom order field to emails](/forum/35-orders-management/872113-adding-custom-order-field-to-emails#185664 "-- HikaShop version -- : 2.3.3 -- Joomla version -- : 2.5.27  Hi All new to this and learning as I go. I have created a custom text field called &quot;activation&#95;code&quot; to the orders table which I want to use to enter and send a code to the customer after I have received payment in the confirmed/shipping email to the customer. I have read various topics in the board but still rather confused which system&gt;&gt; email to modify as I tried adding the following   {VAR:ACTIVATION&#95;CODE}  and before the line  into the status notification email just after the section on &quot;additional text&quot; but the information did not show in the email.  Would someone please give me some simple instructions to how to achieve this. Thanks")*

Hi,

So you need to edit the order_admin_notification preload and replace Code:

'order' =&gt; $data-&gt;cart, 'billing_address' =&gt; @$data-&gt;cart-&gt;billing_address, 'shipping_address' =&gt; @$data-&gt;cart-&gt;shipping_address,

By Code:

'order' =&gt; $data-&gt;cart, 'user' =&gt; $userInfos, 'billing_address' =&gt; @$data-&gt;cart-&gt;billing_address, 'shipping_address' =&gt; @$data-&gt;cart-&gt;shipping_address,

Then you will be able to use the tag Code:

{VAR:user.mycustomfieldname}

in the HTML part in order to display the content of a user custom field.
If the custom field name is in lowercase, you have to write it in lowercase too.

In the mails, we generally use the variables in uppercase when it's a pre-compile data ; when we deal with HikaShop objects (like the order object, the addresses objects, etc) we decided to write the name in lowercase ; so we can see easily the difference in the mail content.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL29yZGVycy1tYW5hZ2VtZW50Lzg3MjExMy1hZGRpbmctY3VzdG9tLW9yZGVyLWZpZWxkLXRvLWVtYWlscz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[KeithBlow](/forum/user/33695-keithblow "View KeithBlow's Profile")**
- [![KeithBlow's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/33695-keithblow "View KeithBlow's Profile")
- [ Offline](/forum/user/33695-keithblow)

Less More

- Posts: 38
- Thank you received: 0
-
-

11 years 8 months ago -  11 years 8 months ago [\#190111](#190111) by [KeithBlow](/forum/user/33695-keithblow "View KeithBlow's Profile")  Replied by *[KeithBlow](/forum/user/33695-keithblow "View KeithBlow's Profile")* on topic *[Adding custom order field to emails](/forum/35-orders-management/872113-adding-custom-order-field-to-emails#190111 "-- HikaShop version -- : 2.3.3 -- Joomla version -- : 2.5.27  Hi All new to this and learning as I go. I have created a custom text field called &quot;activation&#95;code&quot; to the orders table which I want to use to enter and send a code to the customer after I have received payment in the confirmed/shipping email to the customer. I have read various topics in the board but still rather confused which system&gt;&gt; email to modify as I tried adding the following   {VAR:ACTIVATION&#95;CODE}  and before the line  into the status notification email just after the section on &quot;additional text&quot; but the information did not show in the email.  Would someone please give me some simple instructions to how to achieve this. Thanks")*

While your solutions worked perfectly, it turns out this is not what I need, which is my fault.

I used the Purchase Order plugin to create a payment where customer's add their number to it. I changed the name of it to "Cost Center No" and all. How do I get THAT number on the admin email?

---

Edit

---

Nevermind, found the answer here: [ www.hikashop.com/forum/payment-methods/8...r-option.html#173352](http://www.hikashop.com/forum/payment-methods/870746-purchase-order-option.html#173352)

Last edit: 11 years 8 months ago by [KeithBlow](/forum/user/33695-keithblow "View KeithBlow's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL29yZGVycy1tYW5hZ2VtZW50Lzg3MjExMy1hZGRpbmctY3VzdG9tLW9yZGVyLWZpZWxkLXRvLWVtYWlscz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop- Install &amp; Update- Product &amp; Category Display- Content Creation- Sales and Orders- - Orders management- - Reports &amp; Statistics- Customers- Checkout- Payment Methods- Shipping Methods- Import &amp; Export (CSV, XLS…)- Specific Features- - Affilation- - Taxes- - Wishlist- - Vote- - Carousel &amp; Slider- - Mass Actions- - Filters &amp; Search- - Discount &amp; Coupon- - Feature Request- Integrations- Showcase- General Talk about HikaShop- Development- - HikaShop 3.0 Beta- Translation- Commercial Jobs HikaShop Components- HikaMarket- - Market: Feature requests- - Market: How to?- - Market: Bug Report- HikaSerial- - General talk about HikaSerial- - Serial: Bug Report- - Serial: How to?- - Support en Français de HikaSerial (French Support)- - HikaSubscription- HikaAuction- - Auction: Feature requests- - Auction: How to?- - Auction: Bug report Hikashop around the world- Support en Français (French Support)- Russian- - FAQ. Курс выживания с Hikashop. Частые вопросы и о- - Расширения Hikashop- - Наши сайты на Hikashop- 日本語版サポート(Japanese Support)- Thai- German Archives- Bug Report- How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.528 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)

[](#top)
