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

#   HikaShop GeoLocation data display on Order page in admin area

##

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

Less More

- Posts: 2
- Thank you received: 0
-
-

9 years 2 months ago [\#277249](#277249) by [Vershinina](/forum/user/51568-vershinina "View Vershinina's Profile")  *[HikaShop GeoLocation data display on Order page in admin area](/forum/31-development/891747-hikashop-geolocation-data-display-on-order-page-in-admin-area#277249 "Hello,  I can't understand how to display the HikaShop GeoLocation data (from HikaShop GeoLocation plugin) on order page in admin area.  I found this template: /administrator/components/com&#95;hikashop/views/order/tmpl/form.php  Where I can see:  But when I open an order from the Orders page: /administrator/index.php?option=com&#95;hikashop&amp;ctrl=order  via this link: /administrator/index.php?option=com&#95;hikashop&amp;ctrl=order&amp;task=edit&amp;cid&#91;&#93;=X  the other order view template is used, not form.php.  I have two questions:  &#42; how can I display GeoLocation data on order edit page in admin area?  &#42; where form.php order view template is used?  The HikaShop GeoLocation plugin params:  &#42; Orders geolocation = Yes  &#42; Customers geolocation = Yes  &#42; Geolocation service = Both  &#42; API key is filled  I can see GeoLocation data on user edit page in admin area: /administrator/index.php?option=com&#95;hikashop&amp;ctrl=user&amp;task=edit&amp;cid=X  for example: IP X.X.X.X ( Chula Vista CA United States )  Thus, the plugin works fine and successfully store the data.  Thanks in advance!")* was created by *[Vershinina](/forum/user/51568-vershinina "View Vershinina's Profile")*

Hello,

I can't understand how to display the HikaShop GeoLocation data (from HikaShop GeoLocation plugin) on order page in admin area.

I found this template:
/administrator/components/com_hikashop/views/order/tmpl/form.php

Where I can see: Code:

&lt;tr&gt; &lt;td class="key"&gt; &lt;?php echo JText::_( 'IP' ); ?&gt; &lt;/td&gt; &lt;td&gt;&lt;?php echo $this-&gt;order-&gt;order_ip; if(!empty($this-&gt;order-&gt;geolocation) &amp;&amp; $this-&gt;order-&gt;geolocation-&gt;geolocation_country!='Reserved'){ echo ' ( '.$this-&gt;order-&gt;geolocation-&gt;geolocation_city.' '.$this-&gt;order-&gt;geolocation-&gt;geolocation_state.' '.$this-&gt;order-&gt;geolocation-&gt;geolocation_country.' )'; } ?&gt;&lt;/td&gt; &lt;/tr&gt;

But when I open an order from the Orders page:
/administrator/index.php?option=com_hikashop&amp;ctrl=order

via this link:
/administrator/index.php?option=com_hikashop&amp;ctrl=order&amp;task=edit&amp;cid[]=X

the other order view template is used, not form.php.

I have two questions:

1. how can I display GeoLocation data on order edit page in admin area?
2. where form.php order view template is used?

The HikaShop GeoLocation plugin params:

1. Orders geolocation = Yes
2. Customers geolocation = Yes
3. Geolocation service = Both
4. API key is filled

I can see GeoLocation data on user edit page in admin area:
/administrator/index.php?option=com_hikashop&amp;ctrl=user&amp;task=edit&amp;cid=X

for example:
IP X.X.X.X ( Chula Vista CA United States )

Thus, the plugin works fine and successfully store the data.

Thanks in advance!

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

9 years 2 months ago [\#277278](#277278) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[HikaShop GeoLocation data display on Order page in admin area](/forum/31-development/891747-hikashop-geolocation-data-display-on-order-page-in-admin-area#277278 "Hello,  I can't understand how to display the HikaShop GeoLocation data (from HikaShop GeoLocation plugin) on order page in admin area.  I found this template: /administrator/components/com&#95;hikashop/views/order/tmpl/form.php  Where I can see:  But when I open an order from the Orders page: /administrator/index.php?option=com&#95;hikashop&amp;ctrl=order  via this link: /administrator/index.php?option=com&#95;hikashop&amp;ctrl=order&amp;task=edit&amp;cid&#91;&#93;=X  the other order view template is used, not form.php.  I have two questions:  &#42; how can I display GeoLocation data on order edit page in admin area?  &#42; where form.php order view template is used?  The HikaShop GeoLocation plugin params:  &#42; Orders geolocation = Yes  &#42; Customers geolocation = Yes  &#42; Geolocation service = Both  &#42; API key is filled  I can see GeoLocation data on user edit page in admin area: /administrator/index.php?option=com&#95;hikashop&amp;ctrl=user&amp;task=edit&amp;cid=X  for example: IP X.X.X.X ( Chula Vista CA United States )  Thus, the plugin works fine and successfully store the data.  Thanks in advance!")*

Hi,

You're right, the new order edition view is missing the IP/geolocation data which was displayed before in the old order edition view that you found.
Add the code: Code:

function onHikashopBeforeDisplayView(&amp;$view) { $app = JFactory::getApplication(); if(!$app-&gt;isAdmin()) return true; if(empty($view-&gt;order-&gt;order_ip)) return; $viewName = $view-&gt;getName(); $layoutName = $view-&gt;getLayout(); if($viewName != 'order' &#124;&#124; $layoutName != 'show') return true; $data = $view-&gt;order-&gt;order_ip; if(!empty($view-&gt;order-&gt;geolocation) &amp;&amp; $view-&gt;order-&gt;geolocation-&gt;geolocation_country!='Reserved'){ $data .= ' ( '.$view-&gt;order-&gt;geolocation-&gt;geolocation_city.' '.$view-&gt;order-&gt;geolocation-&gt;geolocation_state.' '.$view-&gt;order-&gt;geolocation-&gt;geolocation_country.' )'; } $view-&gt;extra_data['user']['ip'] = array( 'title' =&gt; JText::_( 'IP' ), 'data' =&gt; $data ); }

before the line: Code:

function onAfterOrderCreate(&amp;$order,&amp;$send_email){

in the file plugins/hikashop/geolocation/geolocation.php and that should add back the geolocation data to the new edition view too.
When changing the code of the view to the new one, we added the triggers so that the plugins could themselves add their data to the view, but we forgot to update the geolocation plugin to add its data through the trigger.

Thanks for the catch !

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

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

Less More

- Posts: 2
- Thank you received: 0
-
-

9 years 2 months ago [\#277317](#277317) by [Vershinina](/forum/user/51568-vershinina "View Vershinina's Profile")  Replied by *[Vershinina](/forum/user/51568-vershinina "View Vershinina's Profile")* on topic *[HikaShop GeoLocation data display on Order page in admin area](/forum/31-development/891747-hikashop-geolocation-data-display-on-order-page-in-admin-area#277317 "Hello,  I can't understand how to display the HikaShop GeoLocation data (from HikaShop GeoLocation plugin) on order page in admin area.  I found this template: /administrator/components/com&#95;hikashop/views/order/tmpl/form.php  Where I can see:  But when I open an order from the Orders page: /administrator/index.php?option=com&#95;hikashop&amp;ctrl=order  via this link: /administrator/index.php?option=com&#95;hikashop&amp;ctrl=order&amp;task=edit&amp;cid&#91;&#93;=X  the other order view template is used, not form.php.  I have two questions:  &#42; how can I display GeoLocation data on order edit page in admin area?  &#42; where form.php order view template is used?  The HikaShop GeoLocation plugin params:  &#42; Orders geolocation = Yes  &#42; Customers geolocation = Yes  &#42; Geolocation service = Both  &#42; API key is filled  I can see GeoLocation data on user edit page in admin area: /administrator/index.php?option=com&#95;hikashop&amp;ctrl=user&amp;task=edit&amp;cid=X  for example: IP X.X.X.X ( Chula Vista CA United States )  Thus, the plugin works fine and successfully store the data.  Thanks in advance!")*

Thank you, everything works fine now.

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

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