Custom Field Data in Invoice/Orders
- ichimonban
-
Topic Author
- Offline
-- HikaShop version -- : 2.2.3 Business
-- Joomla version -- : 3.2.2
-- PHP version -- : 5.3.27
-- Browser(s) name and version -- : Chrome, 33.0.750
-- Error-message(debug-mod must be tuned on) -- : NA
I need to add data from custom fields, and I cannot locate documentation as to accomplish this task.
I have added terms of service, company name for user, notes to customer etc. and what else i've found in the forum and wiki doesn't apply and or function. Please advise.
I've got additional data fileds in user, address, and info
As well why is there now means to appy an existing address for a client as the shipping address
MicahFord.com
VOLT2.com | KLEANALL.com | GRAVITYMedia.co
Please Log in or Create an account to join the conversation.
I'm sorry but I really don't understand what you mean by "add data from custom fields". What do you want to add these data to?
Pleas be a bit more specific so we can help you with this
Please Log in or Create an account to join the conversation.
- ichimonban
-
Topic Author
- Offline
These are a few of the custome fields I've added.
terms of service / user_terms
company name / user_company
Order Notes (for client) / order_notes
Rep / user_rep & address_ rep.
I am using Hikashop as part of CRM solution, so my Sales team can create invoices for clients etc.
I've been trying to modify the "Views" ie "invoice" etc to bring the data from these fields into the invoices that are sent to the clients after an order is created.
I've tried to ass using "this->order->column_name" etc in a few variations that I've located in the forum but they aren't working. And I don't see any documents detailing how to get this functionality working.
MicahFord.com
VOLT2.com | KLEANALL.com | GRAVITYMedia.co
Please Log in or Create an account to join the conversation.
All depend on the type of custom field.
The order custom field can be read directly in the order object. For the user custom field, you have to read them in the "order->user".
Displaying a custom field might require the hikashop field class to format them. The custom field only contains the value and if you have some special custom field (like a drop down) you will want to display the associated string for the value.
That is the goal of the function "display" of the field class.
If you do not have special custom field (text / textarea), you can display the raw value, it will work fine.
If you look at the HikaShop code if you want to have sample on "how display a custom field". But like said just before, it will depend on the type of the custom field.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
- ichimonban
-
Topic Author
- Offline
Therefore I created a drop select with my values and column "order_terms"
It would be beneficial to set this same value (payment terms) ie 2/10 Net 30 instead in the user column with the "User/Customer" info ie (user_terms) and then have that display on any invoice created where the customer selected/set has also the value for "user_terms" set. This way I or my Sales Monkeys can set the payment terms once in client settings,and not have to set it for every order.
As well I'm working on created a drip system where my clients have an option to choose a regular purchase/ship interval and when their invoices/orders are created these values set with the "customer/user" are displayed on all of their invoices/ orders.
is there an example of the code I would need to place in the view for invoices to display the set values?
Regards
MicahFord.com
VOLT2.com | KLEANALL.com | GRAVITYMedia.co
Please Log in or Create an account to join the conversation.
You can use the this->order->customer object for the custom user fields. So it would be:
echo $this->order->customer->column_name;
Please Log in or Create an account to join the conversation.
- ichimonban
-
Topic Author
- Offline
Regards
MicahFord.com
VOLT2.com | KLEANALL.com | GRAVITYMedia.co
Please Log in or Create an account to join the conversation.
What do you mean by raw value and label value ?
There is only one value stored in database for this kind of field.
Please Log in or Create an account to join the conversation.
- ichimonban
-
Topic Author
- Offline
When I use the suggested code, the "storage/db" value is displayed on the invoice not the " label value
for instance:
i have created a field called user_terms (terms of payment set for each client)
there are several values; 0 = imediate | 1 = Due Upon Receipt | 2 - 2/10 Net30 etc...
So on the invoice for a client that pays Net 30, printed to the invoice is the storage/db value of "2" when I would prefer "2/10 Net30"
MicahFord.com
VOLT2.com | KLEANALL.com | GRAVITYMedia.co
Please Log in or Create an account to join the conversation.
Displaying a custom field might require the hikashop field class to format them. The custom field only contains the value and if you have some special custom field (like a drop down) you will want to display the associated string for the value.
That is the goal of the function "display" of the field class.
If you do not have special custom field (text / textarea), you can display the raw value, it will work fine.
You can look at the HikaShop code if you want to have sample on "how display a custom field". But like said just before, it will depend on the type of the custom field.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.