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

#   View notification

##

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

Less More

- Posts: 23
- Thank you received: 1
-
-

8 years 11 months ago -  8 years 11 months ago [\#282506](#282506) by [plnabais](/forum/user/51510-plnabais "View plnabais's Profile")  *[View notification](/forum/31-development/892765-view-notification#282506 "-- HikaShop version -- : 3.2.1 -- Joomla version -- : 3.8.1 -- PHP version -- : 7.0  hello, I need to access to the additional field created called trk&#95;number, in the view changestatus.php subview notification.php, I have tried to load the additional data in the function changestatus() in the view.html.php to the following code:  After accepting the field trk&#95;number in this form I need to save it in the order.  I always received that the count($this-&gt;fields)=0, when it must have at least 1")* was created by *[plnabais](/forum/user/51510-plnabais "View plnabais's Profile")*

-- HikaShop version -- : 3.2.1
-- Joomla version -- : 3.8.1
-- PHP version -- : 7.0

hello, I need to access to the additional field created called trk_number, in the view changestatus.php subview notification.php, I have tried to load the additional data in the function changestatus() in the view.html.php to the following code: Code:

function changestatus(){ $order_id = hikashop_getCID('order_id'); $new_status = JRequest::getVar('status',''); if(!empty($order_id)){ $class = hikashop_get('class.order'); $order = $class-&gt;get($order_id,$new_status); $order-&gt;order_old_status = $order-&gt;order_status; $order-&gt;order_status = $new_status; $class-&gt;loadOrderNotification($order); $class-&gt;getOrderAdditionalInfo($order); }else{ $order = new stdClass(); } $order-&gt;order_status = $new_status; $this-&gt;assignRef('element',$order); $editor = hikashop_get('helper.editor'); $editor-&gt;name = 'hikashop_mail_body'; $editor-&gt;content = $order-&gt;mail-&gt;body; $this-&gt;assignRef('editor',$editor); }

After accepting the field trk_number in this form I need to save it in the order.

I always received that the count($this-&gt;fields)=0, when it must have at least 1

Last edit: 8 years 11 months ago by [nicolas](/forum/user/63-nicolas "View nicolas's Profile"). Reason: code tag to make it more readable

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg5Mjc2NS12aWV3LW5vdGlmaWNhdGlvbj90bXBsPW1hcmtkb3du) 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")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

8 years 11 months ago [\#282513](#282513) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[View notification](/forum/31-development/892765-view-notification#282513 "-- HikaShop version -- : 3.2.1 -- Joomla version -- : 3.8.1 -- PHP version -- : 7.0  hello, I need to access to the additional field created called trk&#95;number, in the view changestatus.php subview notification.php, I have tried to load the additional data in the function changestatus() in the view.html.php to the following code:  After accepting the field trk&#95;number in this form I need to save it in the order.  I always received that the count($this-&gt;fields)=0, when it must have at least 1")*

Hi,

You didn't say how you created that field ? Is it a HikaShop custom field ? Of which table ?
Supposing that it is a custom order field, you can access it like that: $this-&gt;element-&gt;trk_number in the changestatus.php view file and its sub views.

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

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

Less More

- Posts: 23
- Thank you received: 1
-
-

8 years 11 months ago [\#282550](#282550) by [plnabais](/forum/user/51510-plnabais "View plnabais's Profile")  Replied by *[plnabais](/forum/user/51510-plnabais "View plnabais's Profile")* on topic *[View notification](/forum/31-development/892765-view-notification#282550 "-- HikaShop version -- : 3.2.1 -- Joomla version -- : 3.8.1 -- PHP version -- : 7.0  hello, I need to access to the additional field created called trk&#95;number, in the view changestatus.php subview notification.php, I have tried to load the additional data in the function changestatus() in the view.html.php to the following code:  After accepting the field trk&#95;number in this form I need to save it in the order.  I always received that the count($this-&gt;fields)=0, when it must have at least 1")*

Hello, Nicolas thank you,

Yes, it's a HikaShop custom field of the table order, using the element I can access to it, but how do I save it?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg5Mjc2NS12aWV3LW5vdGlmaWNhdGlvbj90bXBsPW1hcmtkb3du) 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")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

8 years 11 months ago [\#282563](#282563) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[View notification](/forum/31-development/892765-view-notification#282563 "-- HikaShop version -- : 3.2.1 -- Joomla version -- : 3.8.1 -- PHP version -- : 7.0  hello, I need to access to the additional field created called trk&#95;number, in the view changestatus.php subview notification.php, I have tried to load the additional data in the function changestatus() in the view.html.php to the following code:  After accepting the field trk&#95;number in this form I need to save it in the order.  I always received that the count($this-&gt;fields)=0, when it must have at least 1")*

Hi,

Supposing that you have added an input in the changestatus.php or the notification.php view file to set the value and pass it to the server when the user validates the form, you can implement the trigger "onBeforeOrderUpdate" in a small plugin of the group hikashop to add the value from the $_POST to $order-&gt;trk_number and it will be saved automatically by HikaShop.
[ www.hikashop.com/support/documentation/6...#onBeforeOrderUpdate](https://www.hikashop.com/support/documentation/62-hikashop-developer-documentation.html#onBeforeOrderUpdate)

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

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