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

#   item custom field in show order

##

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

Less More

- Posts: 27
- Thank you received: 0
-
-

12 years 6 months ago [\#150825](#150825) by [travelbaba](/forum/user/31095-travelbaba "View travelbaba's Profile")  *[item custom field in show order](/forum/2-general-talk-about-hikashop/867160-item-custom-field-in-show-order#150825 "Hello,  I have an item custom field, a date. The date appears in the email order, in the cart and that's fine.  But I would like also that appear in the /order/show and print invoice.  Do you have an idea?  THanks Matteo")* was created by *[travelbaba](/forum/user/31095-travelbaba "View travelbaba's Profile")*

Hello,

I have an item custom field, a date.
The date appears in the email order, in the cart and that's fine.

But I would like also that appear in the /order/show and print invoice.

Do you have an idea?

THanks
Matteo

- [ ![hc4b90d6.png](/forum/attachment/16494) ](/forum/attachment/16494 "hc4b90d6.png") [ ](/forum/attachment/16494?download=1 "hc4b90d6.png")

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

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

12 years 6 months ago [\#150902](#150902) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[item custom field in show order](/forum/2-general-talk-about-hikashop/867160-item-custom-field-in-show-order#150902 "Hello,  I have an item custom field, a date. The date appears in the email order, in the cart and that's fine.  But I would like also that appear in the /order/show and print invoice.  Do you have an idea?  THanks Matteo")*

Hi,

You have to edit the view "order / show" via the menu Display &gt; Views and add the desired code in the desired place.
The value should be in the variable: Code:

echo $product-&gt;order_product_CUSTOMFIELDNAME;

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

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

Less More

- Posts: 27
- Thank you received: 0
-
-

12 years 6 months ago [\#150917](#150917) by [travelbaba](/forum/user/31095-travelbaba "View travelbaba's Profile")  Replied by *[travelbaba](/forum/user/31095-travelbaba "View travelbaba's Profile")* on topic *[item custom field in show order](/forum/2-general-talk-about-hikashop/867160-item-custom-field-in-show-order#150917 "Hello,  I have an item custom field, a date. The date appears in the email order, in the cart and that's fine.  But I would like also that appear in the /order/show and print invoice.  Do you have an idea?  THanks Matteo")*

THanks, I will try.

...let's say that I have several products, and every product has a different item custom fieldd ( example: Prod. A has a datapicker custom fiend that has a rande from april to june, Prod B only every monday, and so on).

you can imagine I cannot put every single custom code..... How can I write it?

Thanks
Matteo

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

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

12 years 6 months ago [\#150921](#150921) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[item custom field in show order](/forum/2-general-talk-about-hikashop/867160-item-custom-field-in-show-order#150921 "Hello,  I have an item custom field, a date. The date appears in the email order, in the cart and that's fine.  But I would like also that appear in the /order/show and print invoice.  Do you have an idea?  THanks Matteo")*

Hi,

You can probably set the non custom field columns of in an array, for example: Code:

$notCustom = array('order_product_name','order_product_code',...);

Then check like: Code:

foreach($product as $key =&gt; $content){ if(!in_array($key,$notCustom)){ if(!empty($content)){ echo $product-&gt;$key; } } }

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

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

Less More

- Posts: 27
- Thank you received: 0
-
-

12 years 6 months ago [\#151057](#151057) by [travelbaba](/forum/user/31095-travelbaba "View travelbaba's Profile")  Replied by *[travelbaba](/forum/user/31095-travelbaba "View travelbaba's Profile")* on topic *[item custom field in show order](/forum/2-general-talk-about-hikashop/867160-item-custom-field-in-show-order#151057 "Hello,  I have an item custom field, a date. The date appears in the email order, in the cart and that's fine.  But I would like also that appear in the /order/show and print invoice.  Do you have an idea?  THanks Matteo")*

Works pretty well, only proble is that they are date values, so i get : 20140515000000 instead of: 2014-05-15

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

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

Less More

- Posts: 27
- Thank you received: 0
-
-

12 years 6 months ago [\#151063](#151063) by [travelbaba](/forum/user/31095-travelbaba "View travelbaba's Profile")  Replied by *[travelbaba](/forum/user/31095-travelbaba "View travelbaba's Profile")* on topic *[item custom field in show order](/forum/2-general-talk-about-hikashop/867160-item-custom-field-in-show-order#151063 "Hello,  I have an item custom field, a date. The date appears in the email order, in the cart and that's fine.  But I would like also that appear in the /order/show and print invoice.  Do you have an idea?  THanks Matteo")*

Hello,
sorry for my bad php and english!

The solution with one item field works well, but my proble is follow:

- If the product is "tour to london" there is a datefield "date_london" to show in order;
- If the product is "tour to paris" there is a datefield "date_paris" to show in order;
- If the product is "tour to rome" there is a datefield "date_rome" to show in order and another field "time_rome";

Thanks

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

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

Less More

- Posts: 27
- Thank you received: 0
-
-

12 years 6 months ago [\#151065](#151065) by [travelbaba](/forum/user/31095-travelbaba "View travelbaba's Profile")  Replied by *[travelbaba](/forum/user/31095-travelbaba "View travelbaba's Profile")* on topic *[item custom field in show order](/forum/2-general-talk-about-hikashop/867160-item-custom-field-in-show-order#151065 "Hello,  I have an item custom field, a date. The date appears in the email order, in the cart and that's fine.  But I would like also that appear in the /order/show and print invoice.  Do you have an idea?  THanks Matteo")*

For example, I've added this code to show the custom items in the product cart:
Code:

foreach($this-&gt;itemFields as $field){ $namekey = $field-&gt;field_namekey; if(!empty($row-&gt;$namekey)){ echo '&lt;p style="margin-bottom:0px!important" class="hikashop_cart_item_'.$namekey.'"&gt;'.$this-&gt;fieldsClass-&gt;getFieldName($field).': '.$this-&gt;fieldsClass-&gt;show($field,$row-&gt;$namekey).'&lt;/p&gt;'; } } }

But of course is not working in Show Order...

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

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

Less More

- Posts: 27
- Thank you received: 0
-
-

12 years 6 months ago [\#151095](#151095) by [travelbaba](/forum/user/31095-travelbaba "View travelbaba's Profile")  Replied by *[travelbaba](/forum/user/31095-travelbaba "View travelbaba's Profile")* on topic *[item custom field in show order](/forum/2-general-talk-about-hikashop/867160-item-custom-field-in-show-order#151095 "Hello,  I have an item custom field, a date. The date appears in the email order, in the cart and that's fine.  But I would like also that appear in the /order/show and print invoice.  Do you have an idea?  THanks Matteo")*

I need your help!!!

I'm trying to do by myself but I cannot undestand:

I use your plugin advanced datepicker ( the one you've also adjusted me). le'ts' say I put date 16/04/2014
But when in the order &gt; show i write : echo hikashop_getDate($product-&gt;data_tratte,'%d %B %Y ');
( the string could be also Y-m-d, makes no difference)
I get "17 Maggio 1994", a total nonsense.
If I dont use hikashop_getDate the timestamp is correct: 20140416000000

But my need is to put in every order the different item custom fields , that they are different for every product.

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

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

12 years 6 months ago [\#151221](#151221) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[item custom field in show order](/forum/2-general-talk-about-hikashop/867160-item-custom-field-in-show-order#151221 "Hello,  I have an item custom field, a date. The date appears in the email order, in the cart and that's fine.  But I would like also that appear in the /order/show and print invoice.  Do you have an idea?  THanks Matteo")*

Hi,

You can use:
echo date("Y-m-d",$product-&gt;$key);

In the order view you can find this kind of code: Code:

if(hikashop_level(2) &amp;&amp; !empty($this-&gt;fields['item'])){ foreach($this-&gt;fields['item'] as $field){ $namekey = $field-&gt;field_namekey; if(!empty($product-&gt;$namekey) &amp;&amp; strlen($product-&gt;$namekey)){ echo '&lt;p class="hikashop_order_item_'.$namekey.'"&gt;'.$this-&gt;fieldsClass-&gt;getFieldName($field).': '.$this-&gt;fieldsClass-&gt;show($field,$product-&gt;$namekey).'&lt;/p&gt;'; } } }

I think that you can adapt in for your needs. As you can see it's $product-&gt;$namekey which is used instead of $row-&gt;namekey.

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

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

Less More

- Posts: 27
- Thank you received: 0
-
-

12 years 6 months ago [\#151248](#151248) by [travelbaba](/forum/user/31095-travelbaba "View travelbaba's Profile")  Replied by *[travelbaba](/forum/user/31095-travelbaba "View travelbaba's Profile")* on topic *[item custom field in show order](/forum/2-general-talk-about-hikashop/867160-item-custom-field-in-show-order#151248 "Hello,  I have an item custom field, a date. The date appears in the email order, in the cart and that's fine.  But I would like also that appear in the /order/show and print invoice.  Do you have an idea?  THanks Matteo")*

Hello,

works great!!!

Just for someone who has the same situation, Iv'e adjusted the code:
Code:

foreach($this-&gt;fields['item'] as $field){ $namekey = $field-&gt;field_namekey; if(!empty($product-&gt;$namekey)){ echo '&lt;p class="hikashop_order_item_'.$namekey.'" style="font-size:18px"&gt;'.$this-&gt;fieldsClass-&gt;getFieldName($field).': '.$this-&gt;fieldsClass-&gt;show($field,$product-&gt;$namekey).'&lt;/p&gt;'; } }

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

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

[](#top)
