- Posts: 7
- Thank you received: 0
Adding custom order field to emails
-- 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>> email to modify as I tried adding the following
<p style="border-bottom:1px solid #ddd;padding-bottom:10px;">
{VAR:ACTIVATION_CODE}
</p>
and before the line
<!--{ENDIF:ORDER_SUMMARY}-->
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 or Create an account to join the conversation.
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
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
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 or Create an account to join the conversation.
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 or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
There is nothing to put in the preload for these tags to work. The are already handled by the preload.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
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 & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
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 or Create an account to join the conversation.
Link what, link how ?
Please provide more details.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
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
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
so at the end of the preload all I need to add is:
Please Log in or Create an account to join the conversation.
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 & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
Do I have to declare it in the Preload? If so how?
Please Log in or Create an account to join the conversation.
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 & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
I only put it in capitals because everything else was in capitals. The actually field uses lowercase.
Please Log in or Create an account to join the conversation.
So you need to edit the order_admin_notification preload and replace
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 & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
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
Please Log in or Create an account to join the conversation.