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

#   Custom Field Display Problem in Invoice

##

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

Less More

- Posts: 575
- Thank you received: 11
-
-

10 years 4 months ago -  10 years 4 months ago [\#244390](#244390) by [ler@singmuiheng.com](/forum/user/3330-ler-singmuiheng-com "View ler@singmuiheng.com's Profile")  *[Custom Field Display Problem in Invoice](/forum/35-orders-management/885341-custom-field-display-problem-in-invoice#244390 "-- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.5.1 -- PHP version -- : 5.4.45  We have a custom field display limited to &quot;both eye - different problem&quot; it did work well by not display all the while at checkout process and front end order as well as backend order detail page  however, when we click on invoice, this field come out from nowhere and have a value do not know come from where and same problem occur for field limited to &quot;same power&quot;  please see screen shot below  We did a check on order&#95;product if there is any value in database, but we are sure it is empty and fine as expected  and this is the setting of the problem field which should not display in invoice  the main point of this problem is the left eye field should have no reason to display in invoice")* was created by *[ler@singmuiheng.com](/forum/user/3330-ler-singmuiheng-com "View ler@singmuiheng.com's Profile")*

-- HikaShop version -- : 2.6.3
-- Joomla version -- : 3.5.1
-- PHP version -- : 5.4.45

We have a custom field display limited to "both eye - different problem"
it did work well by not display all the while at checkout process and front end order as well as backend order detail page

however, when we click on invoice, this field come out from nowhere and have a value do not know come from where and same problem occur for field limited to "same power"

please see screen shot below
[ ![Lensfit&#95;-&#95;Administration&#95;-&#95;Order&#95;1.png](/forum/attachment/32397) ](/forum/attachment/32397 "...&#95;-&#95;Order&#95;1.png")

[ ![Lensfit&#95;-&#95;Administration&#95;-&#95;Order&#95;2.png](/forum/attachment/32400) ](/forum/attachment/32400 "...&#95;-&#95;Order&#95;2.png")

We did a check on order_product if there is any value in database, but we are sure it is empty and fine as expected
[ ![lensesfit&#95;com&#95;&#95;&#95;localhost&#95;&#95;&#95;lensesfit&#95;main&#95;&#95;&#95;lnfzh&#95;hikashop&#95;order&#95;product&#95;&#95;&#95;phpMyAdmin&#95;4&#95;4&#95;15&#95;4.png](/forum/attachment/32398) ](/forum/attachment/32398 "...n&#95;4&#95;4&#95;15&#95;4.png")

and this is the setting of the problem field which should not display in invoice

[ ![Lensfit&#95;-&#95;Administration&#95;-&#95;Field&#95;&#95;&#95;left2.png](/forum/attachment/32399) ](/forum/attachment/32399 "...ld&#95;&#95;&#95;left2.png")

the main point of this problem is the left eye field should have no reason to display in invoice

- [ ![Lensfit&#95;-&#95;Administration&#95;-&#95;Order&#95;1.png](/forum/attachment/32397) ](/forum/attachment/32397 "...&#95;-&#95;Order&#95;1.png") [ ](/forum/attachment/32397?download=1 "...&#95;-&#95;Order&#95;1.png")
- [ ![lensesfit&#95;com&#95;&#95;&#95;localhost&#95;&#95;&#95;lensesfit&#95;main&#95;&#95;&#95;lnfzh&#95;hikashop&#95;order&#95;product&#95;&#95;&#95;phpMyAdmin&#95;4&#95;4&#95;15&#95;4.png](/forum/attachment/32398) ](/forum/attachment/32398 "...n&#95;4&#95;4&#95;15&#95;4.png") [ ](/forum/attachment/32398?download=1 "...n&#95;4&#95;4&#95;15&#95;4.png")
- [ ![Lensfit&#95;-&#95;Administration&#95;-&#95;Field&#95;&#95;&#95;left2.png](/forum/attachment/32399) ](/forum/attachment/32399 "...ld&#95;&#95;&#95;left2.png") [ ](/forum/attachment/32399?download=1 "...ld&#95;&#95;&#95;left2.png")
- [ ![Lensfit&#95;-&#95;Administration&#95;-&#95;Order&#95;2.png](/forum/attachment/32400) ](/forum/attachment/32400 "...&#95;-&#95;Order&#95;2.png") [ ](/forum/attachment/32400?download=1 "...&#95;-&#95;Order&#95;2.png")

Last edit: 10 years 4 months ago by [ler@singmuiheng.com](/forum/user/3330-ler-singmuiheng-com "View ler@singmuiheng.com's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50Lzg4NTM0MS1jdXN0b20tZmllbGQtZGlzcGxheS1wcm9ibGVtLWluLWludm9pY2U/dG1wbD1tYXJrZG93bg==) 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: 86583
- Thank you received: 14324
-
-

10 years 4 months ago [\#244470](#244470) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Custom Field Display Problem in Invoice](/forum/35-orders-management/885341-custom-field-display-problem-in-invoice#244470 "-- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.5.1 -- PHP version -- : 5.4.45  We have a custom field display limited to &quot;both eye - different problem&quot; it did work well by not display all the while at checkout process and front end order as well as backend order detail page  however, when we click on invoice, this field come out from nowhere and have a value do not know come from where and same problem occur for field limited to &quot;same power&quot;  please see screen shot below  We did a check on order&#95;product if there is any value in database, but we are sure it is empty and fine as expected  and this is the setting of the problem field which should not display in invoice  the main point of this problem is the left eye field should have no reason to display in invoice")*

Hi,

From what I can see in the code of the invoice, the custom fields display if there is a value in them:
[ take.ms/lj6gC](http://take.ms/lj6gC)
And there should only be a value when displayed on the product page.

And your screenshots are not consistent, so we're not sure that the field is not empty.
In your custom field settings screenshot, you're displaying the field "left2", but that column is not in your screenshot of your phpmyadmin.

What strange though is that in that case, you should get the same result on the order details page.
So I've checked the code there too, and the only change I could see is that it uses the line:
if(empty($product-&gt;$namekey) &#124;&#124; !strlen($product-&gt;$namekey)){
instead of the line:
if(empty($product-&gt;$namekey) &amp;&amp; !strlen($product-&gt;$namekey)){
So try changing that in your invoice view file and see if that helps.

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

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

Less More

- Posts: 575
- Thank you received: 11
-
-

10 years 4 months ago -  10 years 4 months ago [\#244511](#244511) by [ler@singmuiheng.com](/forum/user/3330-ler-singmuiheng-com "View ler@singmuiheng.com's Profile")  Replied by *[ler@singmuiheng.com](/forum/user/3330-ler-singmuiheng-com "View ler@singmuiheng.com's Profile")* on topic *[Custom Field Display Problem in Invoice](/forum/35-orders-management/885341-custom-field-display-problem-in-invoice#244511 "-- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.5.1 -- PHP version -- : 5.4.45  We have a custom field display limited to &quot;both eye - different problem&quot; it did work well by not display all the while at checkout process and front end order as well as backend order detail page  however, when we click on invoice, this field come out from nowhere and have a value do not know come from where and same problem occur for field limited to &quot;same power&quot;  please see screen shot below  We did a check on order&#95;product if there is any value in database, but we are sure it is empty and fine as expected  and this is the setting of the problem field which should not display in invoice  the main point of this problem is the left eye field should have no reason to display in invoice")*

Thanks for your kind help nicolas

We did follow your suggestion to modify the invoice view however, it is still the same

attached the database screen shot, this is quite obvious the left2 is empty, we also quite suprise how did the script find the value and enable it to be display

where can we check if there is anything wrong in getfield function as we print_r the $itemFields, the value is already taken in
"$itemFields = $this-&gt;fieldsClass-&gt;getFields($item_type,$product,'item')"

P/S : this happen only when we update to 2.6.3, before that all are normal

- [ ![lensesfit&#95;com&#95;&#95;&#95;localhost&#95;&#95;&#95;lensesfit&#95;main&#95;&#95;&#95;lnfzh&#95;hikashop&#95;order&#95;product&#95;&#95;&#95;phpMyAdmin&#95;4&#95;4&#95;15&#95;4&#95;1.png](/forum/attachment/32427) ](/forum/attachment/32427 "...4&#95;4&#95;15&#95;4&#95;1.png") [ ](/forum/attachment/32427?download=1 "...4&#95;4&#95;15&#95;4&#95;1.png")

Last edit: 10 years 4 months ago by [ler@singmuiheng.com](/forum/user/3330-ler-singmuiheng-com "View ler@singmuiheng.com's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50Lzg4NTM0MS1jdXN0b20tZmllbGQtZGlzcGxheS1wcm9ibGVtLWluLWludm9pY2U/dG1wbD1tYXJrZG93bg==) 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: 86583
- Thank you received: 14324
-
-

10 years 4 months ago [\#244517](#244517) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Custom Field Display Problem in Invoice](/forum/35-orders-management/885341-custom-field-display-problem-in-invoice#244517 "-- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.5.1 -- PHP version -- : 5.4.45  We have a custom field display limited to &quot;both eye - different problem&quot; it did work well by not display all the while at checkout process and front end order as well as backend order detail page  however, when we click on invoice, this field come out from nowhere and have a value do not know come from where and same problem occur for field limited to &quot;same power&quot;  please see screen shot below  We did a check on order&#95;product if there is any value in database, but we are sure it is empty and fine as expected  and this is the setting of the problem field which should not display in invoice  the main point of this problem is the left eye field should have no reason to display in invoice")*

Hi,

The fact that the field is in $itemFields is normal since that field can be potentially displayed based on what the customer selects.
However, if the data is empty in the database for the field, then $product-&gt;left2 should be empty. And that's what the system bases itself on to display or not the value. So check on that variable as I'm not able to reproduce the problem on our end.

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

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

Less More

- Posts: 575
- Thank you received: 11
-
-

10 years 4 months ago [\#244982](#244982) by [ler@singmuiheng.com](/forum/user/3330-ler-singmuiheng-com "View ler@singmuiheng.com's Profile")  Replied by *[ler@singmuiheng.com](/forum/user/3330-ler-singmuiheng-com "View ler@singmuiheng.com's Profile")* on topic *[Custom Field Display Problem in Invoice](/forum/35-orders-management/885341-custom-field-display-problem-in-invoice#244982 "-- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.5.1 -- PHP version -- : 5.4.45  We have a custom field display limited to &quot;both eye - different problem&quot; it did work well by not display all the while at checkout process and front end order as well as backend order detail page  however, when we click on invoice, this field come out from nowhere and have a value do not know come from where and same problem occur for field limited to &quot;same power&quot;  please see screen shot below  We did a check on order&#95;product if there is any value in database, but we are sure it is empty and fine as expected  and this is the setting of the problem field which should not display in invoice  the main point of this problem is the left eye field should have no reason to display in invoice")*

Dear Nicolas

We are very sure that $product-left2 is empty as per screenshoot provided earlier

Any else place we can check on it?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50Lzg4NTM0MS1jdXN0b20tZmllbGQtZGlzcGxheS1wcm9ibGVtLWluLWludm9pY2U/dG1wbD1tYXJrZG93bg==) 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")
- [ Away](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26401
- Thank you received: 4081
-
- [](http://obsi.dev)
-

10 years 4 months ago [\#245004](#245004) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Custom Field Display Problem in Invoice](/forum/35-orders-management/885341-custom-field-display-problem-in-invoice#245004 "-- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.5.1 -- PHP version -- : 5.4.45  We have a custom field display limited to &quot;both eye - different problem&quot; it did work well by not display all the while at checkout process and front end order as well as backend order detail page  however, when we click on invoice, this field come out from nowhere and have a value do not know come from where and same problem occur for field limited to &quot;same power&quot;  please see screen shot below  We did a check on order&#95;product if there is any value in database, but we are sure it is empty and fine as expected  and this is the setting of the problem field which should not display in invoice  the main point of this problem is the left eye field should have no reason to display in invoice")*

Hi,

> if the data is empty in the database for the field, then $product-&gt;left2 should be empty

> We are very sure that $product-left2 is empty

I'm afraid that I can't understand your question.

Regards,

---

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

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

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

Less More

- Posts: 575
- Thank you received: 11
-
-

10 years 4 months ago -  10 years 4 months ago [\#245064](#245064) by [ler@singmuiheng.com](/forum/user/3330-ler-singmuiheng-com "View ler@singmuiheng.com's Profile")  Replied by *[ler@singmuiheng.com](/forum/user/3330-ler-singmuiheng-com "View ler@singmuiheng.com's Profile")* on topic *[Custom Field Display Problem in Invoice](/forum/35-orders-management/885341-custom-field-display-problem-in-invoice#245064 "-- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.5.1 -- PHP version -- : 5.4.45  We have a custom field display limited to &quot;both eye - different problem&quot; it did work well by not display all the while at checkout process and front end order as well as backend order detail page  however, when we click on invoice, this field come out from nowhere and have a value do not know come from where and same problem occur for field limited to &quot;same power&quot;  please see screen shot below  We did a check on order&#95;product if there is any value in database, but we are sure it is empty and fine as expected  and this is the setting of the problem field which should not display in invoice  the main point of this problem is the left eye field should have no reason to display in invoice")*

Please see this screen shot, we are sure that database is empty, if not the order detail part would not show correctly, however, during invoice detail it display the empty field with a default value, all these problem arise when using the "display limited to" function

[ ![Lensfit&#95;-&#95;Administration&#95;-&#95;Order&#95;2&#95;2016-07-08.png](/forum/attachment/32542) ](/forum/attachment/32542 "...2016-07-08.png")

May we know what is the "view" file name for the order detail that display correctly? we would like to compare this two view as the problem lies at $itemFields = $this-&gt;fieldsClass-&gt;getFields($item_type,$product,'item');

- [ ![Lensfit&#95;-&#95;Administration&#95;-&#95;Order&#95;2&#95;2016-07-08.png](/forum/attachment/32542) ](/forum/attachment/32542 "...2016-07-08.png") [ ](/forum/attachment/32542?download=1 "...2016-07-08.png")

Last edit: 10 years 4 months ago by [ler@singmuiheng.com](/forum/user/3330-ler-singmuiheng-com "View ler@singmuiheng.com's Profile").

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

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

Less More

- Posts: 575
- Thank you received: 11
-
-

10 years 4 months ago [\#245495](#245495) by [ler@singmuiheng.com](/forum/user/3330-ler-singmuiheng-com "View ler@singmuiheng.com's Profile")  Replied by *[ler@singmuiheng.com](/forum/user/3330-ler-singmuiheng-com "View ler@singmuiheng.com's Profile")* on topic *[Custom Field Display Problem in Invoice](/forum/35-orders-management/885341-custom-field-display-problem-in-invoice#245495 "-- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.5.1 -- PHP version -- : 5.4.45  We have a custom field display limited to &quot;both eye - different problem&quot; it did work well by not display all the while at checkout process and front end order as well as backend order detail page  however, when we click on invoice, this field come out from nowhere and have a value do not know come from where and same problem occur for field limited to &quot;same power&quot;  please see screen shot below  We did a check on order&#95;product if there is any value in database, but we are sure it is empty and fine as expected  and this is the setting of the problem field which should not display in invoice  the main point of this problem is the left eye field should have no reason to display in invoice")*

it has been one week since last post.... and no counter measure was found yet......

We are very sure that the database value is empty for the printed error field

Kindly help to advise the location of getFields function so that we can help to have a check on this if your side can not reproduce this problem

or we can pass u a akeeba copy of this site??

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

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

Less More

- Posts: 575
- Thank you received: 11
-
-

10 years 4 months ago [\#246149](#246149) by [ler@singmuiheng.com](/forum/user/3330-ler-singmuiheng-com "View ler@singmuiheng.com's Profile")  Replied by *[ler@singmuiheng.com](/forum/user/3330-ler-singmuiheng-com "View ler@singmuiheng.com's Profile")* on topic *[Custom Field Display Problem in Invoice](/forum/35-orders-management/885341-custom-field-display-problem-in-invoice#246149 "-- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.5.1 -- PHP version -- : 5.4.45  We have a custom field display limited to &quot;both eye - different problem&quot; it did work well by not display all the while at checkout process and front end order as well as backend order detail page  however, when we click on invoice, this field come out from nowhere and have a value do not know come from where and same problem occur for field limited to &quot;same power&quot;  please see screen shot below  We did a check on order&#95;product if there is any value in database, but we are sure it is empty and fine as expected  and this is the setting of the problem field which should not display in invoice  the main point of this problem is the left eye field should have no reason to display in invoice")*

any update for this problem?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50Lzg4NTM0MS1jdXN0b20tZmllbGQtZGlzcGxheS1wcm9ibGVtLWluLWludm9pY2U/dG1wbD1tYXJrZG93bg==) 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")
- [ Away](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26401
- Thank you received: 4081
-
- [](http://obsi.dev)
-

10 years 4 months ago [\#246190](#246190) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Custom Field Display Problem in Invoice](/forum/35-orders-management/885341-custom-field-display-problem-in-invoice#246190 "-- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.5.1 -- PHP version -- : 5.4.45  We have a custom field display limited to &quot;both eye - different problem&quot; it did work well by not display all the while at checkout process and front end order as well as backend order detail page  however, when we click on invoice, this field come out from nowhere and have a value do not know come from where and same problem occur for field limited to &quot;same power&quot;  please see screen shot below  We did a check on order&#95;product if there is any value in database, but we are sure it is empty and fine as expected  and this is the setting of the problem field which should not display in invoice  the main point of this problem is the left eye field should have no reason to display in invoice")*

Hi,

We are still not able to understand your message and we already gave you some elements but your screenshots from your database do not give any proof which could help.

Now you can read that post which talk about a similar subject :
[ www.hikashop.com/forum/3-bug-report/8855...?limitstart=0#245874](https://www.hikashop.com/forum/3-bug-report/885510-fake-custom-fields-appeared.html?limitstart=0#245874)

Regards,

---

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

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

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

Less More

- Posts: 575
- Thank you received: 11
-
-

10 years 4 months ago [\#246194](#246194) by [ler@singmuiheng.com](/forum/user/3330-ler-singmuiheng-com "View ler@singmuiheng.com's Profile")  Replied by *[ler@singmuiheng.com](/forum/user/3330-ler-singmuiheng-com "View ler@singmuiheng.com's Profile")* on topic *[Custom Field Display Problem in Invoice](/forum/35-orders-management/885341-custom-field-display-problem-in-invoice#246194 "-- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.5.1 -- PHP version -- : 5.4.45  We have a custom field display limited to &quot;both eye - different problem&quot; it did work well by not display all the while at checkout process and front end order as well as backend order detail page  however, when we click on invoice, this field come out from nowhere and have a value do not know come from where and same problem occur for field limited to &quot;same power&quot;  please see screen shot below  We did a check on order&#95;product if there is any value in database, but we are sure it is empty and fine as expected  and this is the setting of the problem field which should not display in invoice  the main point of this problem is the left eye field should have no reason to display in invoice")*

the bug is clearly shown as per earlier screen shot

i had also tried what is mentioned in the related post given
1. rebuild category
2. modify the line of code

and it make the scenario worst

please see below screen shot, after rebuild category, more unexpected field is shown in invoice

[ ![Lensfit&#95;-&#95;Administration&#95;-&#95;Order&#95;3.png](/forum/attachment/32764) ](/forum/attachment/32764 "...&#95;-&#95;Order&#95;3.png")

i have send a link download the full akeeba backup of the site from contact form, can nicolas help to check on it (since nicolas have better understanding on this kind of bug)? or it is prefer to pass you the joomla access ?

- [ ![Lensfit&#95;-&#95;Administration&#95;-&#95;Order&#95;3.png](/forum/attachment/32764) ](/forum/attachment/32764 "...&#95;-&#95;Order&#95;3.png") [ ](/forum/attachment/32764?download=1 "...&#95;-&#95;Order&#95;3.png")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50Lzg4NTM0MS1jdXN0b20tZmllbGQtZGlzcGxheS1wcm9ibGVtLWluLWludm9pY2U/dG1wbD1tYXJrZG93bg==) 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")
- [ Away](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26401
- Thank you received: 4081
-
- [](http://obsi.dev)
-

10 years 4 months ago [\#246223](#246223) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Custom Field Display Problem in Invoice](/forum/35-orders-management/885341-custom-field-display-problem-in-invoice#246223 "-- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.5.1 -- PHP version -- : 5.4.45  We have a custom field display limited to &quot;both eye - different problem&quot; it did work well by not display all the while at checkout process and front end order as well as backend order detail page  however, when we click on invoice, this field come out from nowhere and have a value do not know come from where and same problem occur for field limited to &quot;same power&quot;  please see screen shot below  We did a check on order&#95;product if there is any value in database, but we are sure it is empty and fine as expected  and this is the setting of the problem field which should not display in invoice  the main point of this problem is the left eye field should have no reason to display in invoice")*

Hi,

Please understand that if there is no value in the database, the field won't be display in the invoice.
You must have these "0.50 / -0.50" values in your database to display them. HikaShop can't create them from nothing.
We don't know what are your screenshots and if the order is recent or not. If his data is already corrupted you need to fix them once and for all ; and specially made new orders to be sure that the storage in the database is now working fine.

Regards,

---

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

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

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

Less More

- Posts: 575
- Thank you received: 11
-
-

10 years 4 months ago [\#246257](#246257) by [ler@singmuiheng.com](/forum/user/3330-ler-singmuiheng-com "View ler@singmuiheng.com's Profile")  Replied by *[ler@singmuiheng.com](/forum/user/3330-ler-singmuiheng-com "View ler@singmuiheng.com's Profile")* on topic *[Custom Field Display Problem in Invoice](/forum/35-orders-management/885341-custom-field-display-problem-in-invoice#246257 "-- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.5.1 -- PHP version -- : 5.4.45  We have a custom field display limited to &quot;both eye - different problem&quot; it did work well by not display all the while at checkout process and front end order as well as backend order detail page  however, when we click on invoice, this field come out from nowhere and have a value do not know come from where and same problem occur for field limited to &quot;same power&quot;  please see screen shot below  We did a check on order&#95;product if there is any value in database, but we are sure it is empty and fine as expected  and this is the setting of the problem field which should not display in invoice  the main point of this problem is the left eye field should have no reason to display in invoice")*

Dear jerome

we have pass you the full website in contact form, please have a FULL check on it

as per mentioned and in screenshot
[ www.hikashop.com/media/kunena/attachment...ration\_-\_Order\_3.png](http://www.hikashop.com/media/kunena/attachments/3330/Lensfit_-_Administration_-_Order_3.png)

1. in order detail - all the custom field display correctly
2. in invoice view - the custom field come out from nowhere (this is already a bug when order detail do not match invoice detail)
3. we check thru the database
[ www.hikashop.com/media/kunena/attachment...MyAdmin\_4\_4\_15\_4.png](http://www.hikashop.com/media/kunena/attachments/3330/lensesfit_com___localhost___lensesfit_main___lnfzh_hikashop_order_product___phpMyAdmin_4_4_15_4.png)
and sure the come out from no where field is empty

and as per mention as well

we have initially only one "come out from no where" field

1. after apply "rebuild category" as per suggest in another thread
more "come out from no where field" appear

i believe you can understand from now?

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

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

Less More

- Posts: 4820
- Thank you received: 652
-
-

10 years 3 months ago -  10 years 3 months ago [\#246308](#246308) by [Philip](/forum/user/34318-philip "View Philip's Profile")  Replied by *[Philip](/forum/user/34318-philip "View Philip's Profile")* on topic *[Custom Field Display Problem in Invoice](/forum/35-orders-management/885341-custom-field-display-problem-in-invoice#246308 "-- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.5.1 -- PHP version -- : 5.4.45  We have a custom field display limited to &quot;both eye - different problem&quot; it did work well by not display all the while at checkout process and front end order as well as backend order detail page  however, when we click on invoice, this field come out from nowhere and have a value do not know come from where and same problem occur for field limited to &quot;same power&quot;  please see screen shot below  We did a check on order&#95;product if there is any value in database, but we are sure it is empty and fine as expected  and this is the setting of the problem field which should not display in invoice  the main point of this problem is the left eye field should have no reason to display in invoice")*

Hello,

I get it ! This case was totally new for us !
Thanks for provide your website that allow us to get a bug, and add a fix !

In order to correct it, follow these steps :
- Get your file **field.php**, here in **...\\administrator\\components\\com\_hikashop\\classes**
find this arround line **440** : Code:

case 'item': $order_id = (int)@$data-&gt;order_id; if($order_id &gt; 0){ $orderClass = hikashop_get('class.order'); $order = $orderClass-&gt;get($order_id); $user_id = (int)@$order-&gt;order_user_id; } else { $user_id = 0; } break;

And this **$id = 'product\_id';** just before **break**; to get this : Code:

case 'item': $order_id = (int)@$data-&gt;order_id; if($order_id &gt; 0){ $orderClass = hikashop_get('class.order'); $order = $orderClass-&gt;get($order_id); $user_id = (int)@$order-&gt;order_user_id; } else { $user_id = 0; } $id = 'product_id'; break;

And in **...\\administrator\\components\\com\_hikashop\\views\\order\\tmpl**, get **invoice.php** and find this around line **200** : Code:

if(!empty($itemFields)) { foreach($itemFields as $field){ $namekey = $field-&gt;field_namekey; if(empty($product-&gt;$namekey) &amp;&amp; !strlen($product-&gt;$namekey)){ continue; }

And replace  **if(empty($product-&gt;$namekey) &amp;&amp; !strlen($product-&gt;$namekey)){**
by this  **if(empty($product-&gt;$namekey) &amp;&amp; (!isset($product-&gt;$namekey) \|\| !strlen($product-&gt;$namekey))){**
to get this : Code:

if(!empty($itemFields)) { foreach($itemFields as $field){ $namekey = $field-&gt;field_namekey; if(empty($product-&gt;$namekey) &amp;&amp; (!isset($product-&gt;$namekey) &#124;&#124; !strlen($product-&gt;$namekey))){ continue; }

That must solve your issue, but I awaiting news from you.

**Note :** that this fix is now added to our Version from now.

Regards

Last edit: 10 years 3 months ago by [Philip](/forum/user/34318-philip "View Philip's Profile").

The following user(s) said Thank You: [ler@singmuiheng.com](/forum/user/3330-ler-singmuiheng-com "View ler@singmuiheng.com's Profile"), [haur0214](/forum/user/39931-haur0214 "View haur0214's Profile")

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

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