Custom Field Data in Invoice/Orders

  • Posts: 31
  • Thank you received: 1
10 years 2 months ago #146939

-- url of the page with the problem -- : rhinorush.com
-- 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.

  • Posts: 2334
  • Thank you received: 403
10 years 2 months ago #146971

Hello,

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.

  • Posts: 31
  • Thank you received: 1
10 years 2 months ago #146999

I need to add data that's entered into CUSTOM FIELDS by my sales staff.
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.

  • Posts: 26019
  • Thank you received: 4005
  • MODERATOR
10 years 1 month ago #147170

Hi,

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.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 31
  • Thank you received: 1
10 years 1 month ago #147839

I see that there's the "order" column available, and I can add there, additional selects/values ie (payment terms) and these are set and displayed per invoice/order.
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.

  • Posts: 81604
  • Thank you received: 13082
  • MODERATOR
10 years 1 month ago #147862

Hi,

You can use the this->order->customer object for the custom user fields. So it would be:
echo $this->order->customer->column_name;

The following user(s) said Thank You: ichimonban

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

  • Posts: 31
  • Thank you received: 1
10 years 1 month ago #147921

That works rather well, The only thing is that it displays teh Raw Value of the column, is there a way to display the label value?

Regards


MicahFord.com
VOLT2.com | KLEANALL.com | GRAVITYMedia.co

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

  • Posts: 13201
  • Thank you received: 2322
10 years 1 month ago #148254

Hi,

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.

  • Posts: 31
  • Thank you received: 1
10 years 1 month ago #148258

Each Custom Field allows for a storage/db value and a label value

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.

  • Posts: 26019
  • Thank you received: 4005
  • MODERATOR
10 years 1 month ago #148336

Hi,

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.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

Time to create page: 0.090 seconds
Powered by Kunena Forum