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

#   User information in Invoice and order number

##

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

Less More

- Posts: 20
- Thank you received: 0
-
-

9 years 2 months ago [\#276095](#276095) by [web-tiki](/forum/user/45235-web-tiki "View web-tiki's Profile")  *[User information in Invoice and order number](/forum/35-orders-management/891550-user-information-in-invoice-and-order-number#276095 "-- HikaShop version -- : 3.1.1 -- Joomla version -- : 3.7.4 -- PHP version -- : 7.1  Hi, I need to add information from a custom field (in the user table) to the invoice and order numbers. Is this possible with HE?")* was created by *[web-tiki](/forum/user/45235-web-tiki "View web-tiki's Profile")*

-- HikaShop version -- : 3.1.1
-- Joomla version -- : 3.7.4
-- PHP version -- : 7.1

Hi,
I need to add information from a custom field (in the user table) to the invoice and order numbers.
Is this possible with HE?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50Lzg5MTU1MC11c2VyLWluZm9ybWF0aW9uLWluLWludm9pY2UtYW5kLW9yZGVyLW51bWJlcj90bXBsPW1hcmtkb3du) 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)
-

9 years 2 months ago [\#276097](#276097) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[User information in Invoice and order number](/forum/35-orders-management/891550-user-information-in-invoice-and-order-number#276097 "-- HikaShop version -- : 3.1.1 -- Joomla version -- : 3.7.4 -- PHP version -- : 7.1  Hi, I need to add information from a custom field (in the user table) to the invoice and order numbers. Is this possible with HE?")*

Hello,

Yes it is possible with HikaShop but it would require a little view override for your invoice view(s) (they are two invoices, one in front end an another for the backend).
[ www.hikashop.com/support/documentation/1...-display.html#layout](https://www.hikashop.com/support/documentation/153-customize-the-display.html#layout)

Front-end : order / show
Backend : order / invoice

And you can access to the customer object (and its custom fields) via : Code:

$this-&gt;element-&gt;customer-&gt;...

Regards,

---

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

The following user(s) said Thank You: [web-tiki](/forum/user/45235-web-tiki "View web-tiki's Profile")

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

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

Less More

- Posts: 20
- Thank you received: 0
-
-

9 years 2 months ago [\#276140](#276140) by [web-tiki](/forum/user/45235-web-tiki "View web-tiki's Profile")  Replied by *[web-tiki](/forum/user/45235-web-tiki "View web-tiki's Profile")* on topic *[User information in Invoice and order number](/forum/35-orders-management/891550-user-information-in-invoice-and-order-number#276140 "-- HikaShop version -- : 3.1.1 -- Joomla version -- : 3.7.4 -- PHP version -- : 7.1  Hi, I need to add information from a custom field (in the user table) to the invoice and order numbers. Is this possible with HE?")*

Thx for the answer, I see how to add the information to the invoice and order outputs.
But is it possible to change that number in the backend Where the orders are listed?
I would prefer to have the new order and invoice numbers stored in the database with the user information. Is that possible?
Is there a way to add custom user info in the order and invoice formats?
I saw [ here](https://www.hikashop.com/forum/4-how-to/22789-change-order-number-format.html#31728)Code:

{user user_vat}-{id size="3"}-{date format="m-Y"}

could be used as an order number but the topic is old and I had no succes trying.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50Lzg5MTU1MC11c2VyLWluZm9ybWF0aW9uLWluLWludm9pY2UtYW5kLW9yZGVyLW51bWJlcj90bXBsPW1hcmtkb3du) 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)
-

9 years 2 months ago [\#276158](#276158) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[User information in Invoice and order number](/forum/35-orders-management/891550-user-information-in-invoice-and-order-number#276158 "-- HikaShop version -- : 3.1.1 -- Joomla version -- : 3.7.4 -- PHP version -- : 7.1  Hi, I need to add information from a custom field (in the user table) to the invoice and order numbers. Is this possible with HE?")*

Hello,

Okay ; you want to change the order number format !
Because you were talking about add information to the invoices I thought that you wanted to customized the invoices.

So, yes in HikaShop Essential you can change the format for the "order number" and "invoice number".
And you can use a special tag to access to user data, as you wrote: Code:

{user user_vat}

Now if you want to use something from a user custom field, you need to replace "user_vat" but the namekey of your custom field.
The namekey is also called "column name" :
[ www.hikashop.com/support/documentation/1...ield-form.html#infos](https://www.hikashop.com/support/documentation/10-documentation/hikashop/42-hikashop-field-form.html#infos)

Afterwards, please note that when you change the format, it will not affect the old orders and you need to create new orders to see the result.

Regards,

---

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

The following user(s) said Thank You: [web-tiki](/forum/user/45235-web-tiki "View web-tiki's Profile")

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

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

Less More

- Posts: 20
- Thank you received: 0
-
-

9 years 2 months ago -  9 years 2 months ago [\#276290](#276290) by [web-tiki](/forum/user/45235-web-tiki "View web-tiki's Profile")  Replied by *[web-tiki](/forum/user/45235-web-tiki "View web-tiki's Profile")* on topic *[User information in Invoice and order number](/forum/35-orders-management/891550-user-information-in-invoice-and-order-number#276290 "-- HikaShop version -- : 3.1.1 -- Joomla version -- : 3.7.4 -- PHP version -- : 7.1  Hi, I need to add information from a custom field (in the user table) to the invoice and order numbers. Is this possible with HE?")*

Thx for the info. It works fine for the order number but it fails for the invoice number.
This is the format I gave to both of the numbers :

Order number : Code:

{user user_type} - {date format="y m"} {id size="6"}

Invoice number : Code:

{user user_type} - {date format="y m"} {order_id size="6"}

For the invoice number, Code:

{user user_type}

doesn't output anything. Is there a workaround?

Also adding the user info gives an error on the checkout end step (after payement) : Code:

Notice: Undefined property: stdClass::$order_user_id in SOMETHING_HERE\administrator\components\com_hikashop\helpers\helper.php on line 336

I'm testing this out with the cheque payement method.

Last edit: 9 years 2 months ago by [web-tiki](/forum/user/45235-web-tiki "View web-tiki's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50Lzg5MTU1MC11c2VyLWluZm9ybWF0aW9uLWluLWludm9pY2UtYW5kLW9yZGVyLW51bWJlcj90bXBsPW1hcmtkb3du) 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?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86315
- Thank you received: 14276
-
-

9 years 2 months ago [\#276350](#276350) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[User information in Invoice and order number](/forum/35-orders-management/891550-user-information-in-invoice-and-order-number#276350 "-- HikaShop version -- : 3.1.1 -- Joomla version -- : 3.7.4 -- PHP version -- : 7.1  Hi, I need to add information from a custom field (in the user table) to the invoice and order numbers. Is this possible with HE?")*

Hi,

Thanks for the details. The user tags are indeed no usable in some cases with the invoice number format setting.
Change the code: Code:

$userClass = hikashop_get('class.user'); $data-&gt;customer = $userClass-&gt;get($data-&gt;order_user_id);

to:
Code:

$order_user_id = 0; if(isset($data-&gt;order_user_id)) { $order_user_id = $data-&gt;order_user_id; } elseif(isset($data-&gt;old-&gt;order_user_id)) { $order_user_id = $data-&gt;old-&gt;order_user_id; } elseif(isset($data-&gt;order_id)) { $orderClass = hikashop_get('class.order'); $orderData = $orderClass-&gt;get($data-&gt;order_id); $order_user_id = $orderData-&gt;order_user_id; } if($order_user_id) { $userClass = hikashop_get('class.user'); $data-&gt;customer = $userClass-&gt;get($order_user_id); }

in the file administrator/components/com_hikashop/helpers/helper.php and that will fix the notice message and you'll be able to use the user tags in the invoice number format setting.

The following user(s) said Thank You: [web-tiki](/forum/user/45235-web-tiki "View web-tiki's Profile")

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

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

Less More

- Posts: 20
- Thank you received: 0
-
-

9 years 2 months ago [\#277048](#277048) by [web-tiki](/forum/user/45235-web-tiki "View web-tiki's Profile")  Replied by *[web-tiki](/forum/user/45235-web-tiki "View web-tiki's Profile")* on topic *[User information in Invoice and order number](/forum/35-orders-management/891550-user-information-in-invoice-and-order-number#277048 "-- HikaShop version -- : 3.1.1 -- Joomla version -- : 3.7.4 -- PHP version -- : 7.1  Hi, I need to add information from a custom field (in the user table) to the invoice and order numbers. Is this possible with HE?")*

Perfect thank you, this seems to works fine.
Will this change be pushed in the next hikashop release or will I have to redo this change after each update?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50Lzg5MTU1MC11c2VyLWluZm9ybWF0aW9uLWluLWludm9pY2UtYW5kLW9yZGVyLW51bWJlcj90bXBsPW1hcmtkb3du) 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?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86315
- Thank you received: 14276
-
-

9 years 2 months ago [\#277052](#277052) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[User information in Invoice and order number](/forum/35-orders-management/891550-user-information-in-invoice-and-order-number#277052 "-- HikaShop version -- : 3.1.1 -- Joomla version -- : 3.7.4 -- PHP version -- : 7.1  Hi, I need to add information from a custom field (in the user table) to the invoice and order numbers. Is this possible with HE?")*

Hi,

Yes, it will be included.

The following user(s) said Thank You: [web-tiki](/forum/user/45235-web-tiki "View web-tiki's Profile")

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

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

Less More

- Posts: 20
- Thank you received: 0
-
-

9 years 2 months ago [\#277194](#277194) by [web-tiki](/forum/user/45235-web-tiki "View web-tiki's Profile")  Replied by *[web-tiki](/forum/user/45235-web-tiki "View web-tiki's Profile")* on topic *[User information in Invoice and order number](/forum/35-orders-management/891550-user-information-in-invoice-and-order-number#277194 "-- HikaShop version -- : 3.1.1 -- Joomla version -- : 3.7.4 -- PHP version -- : 7.1  Hi, I need to add information from a custom field (in the user table) to the invoice and order numbers. Is this possible with HE?")*

Perfect,
Thx Nicolas and Jerome for your support.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50Lzg5MTU1MC11c2VyLWluZm9ybWF0aW9uLWluLWludm9pY2UtYW5kLW9yZGVyLW51bWJlcj90bXBsPW1hcmtkb3du) 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.142 seconds

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

[](#top)
