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

#   geolocation filling of address fields, country

##

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

Less More

- Posts: 71
- Thank you received: 0
-
-

13 years 3 months ago [\#117465](#117465) by [triotech](/forum/user/25968-triotech "View triotech's Profile")  *[geolocation filling of address fields, country](/forum/27-checkout/860730-geolocation-filling-of-address-fields-country#117465 "--   www.3cordyceps.com/My-Order/checkout/task-step/step-1.html  -- HikaShop version -- : 2.2.0 Business -- Joomla version -- : 2.5.14 -- PHP version -- : -- Browser(s) name and version -- : all  Hi, I have enabled the Geolocation plugin and it is correctly configured. At the moment, I have it getting the user currency and shipping rules (correctly too). However, I am using the Simple Registration and when the user gets to the address page of the checkout, they have to nominate the country to send it to, despite the geolocation plugin on the same page telling them the correct shipping (see image). I know the customer needs to be able to specify any country for an address, but why can't the Country field be pre-populated with their country and not the default (USA in my case) ?  Cheers, Nick")* was created by *[triotech](/forum/user/25968-triotech "View triotech's Profile")*

-- [ www.3cordyceps.com/My-Order/checkout/task-step/step-1.html](http://www.3cordyceps.com/My-Order/checkout/task-step/step-1.html)
-- HikaShop version -- : 2.2.0 Business
-- Joomla version -- : 2.5.14
-- PHP version -- :
-- Browser(s) name and version -- : all

Hi, I have enabled the Geolocation plugin and it is correctly configured. At the moment, I have it getting the user currency and shipping rules (correctly too). However, I am using the Simple Registration and when the user gets to the address page of the checkout, they have to nominate the country to send it to, despite the geolocation plugin on the same page telling them the correct shipping (see image). I know the customer needs to be able to specify any country for an address, but why can't the Country field be pre-populated with their country and not the default (USA in my case) ?

Cheers, Nick

- [ ![h232bc10.JPG](/forum/attachment/11570) ](/forum/attachment/11570 "h232bc10.JPG") [ ](/forum/attachment/11570?download=1 "h232bc10.JPG")

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

13 years 3 months ago [\#117548](#117548) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[geolocation filling of address fields, country](/forum/27-checkout/860730-geolocation-filling-of-address-fields-country#117548 "--   www.3cordyceps.com/My-Order/checkout/task-step/step-1.html  -- HikaShop version -- : 2.2.0 Business -- Joomla version -- : 2.5.14 -- PHP version -- : -- Browser(s) name and version -- : all  Hi, I have enabled the Geolocation plugin and it is correctly configured. At the moment, I have it getting the user currency and shipping rules (correctly too). However, I am using the Simple Registration and when the user gets to the address page of the checkout, they have to nominate the country to send it to, despite the geolocation plugin on the same page telling them the correct shipping (see image). I know the customer needs to be able to specify any country for an address, but why can't the Country field be pre-populated with their country and not the default (USA in my case) ?  Cheers, Nick")*

Hi,

Thanks for the suggestion, the plugin was actually not allowing that.
So we will add that functionality tomorrow, because it's a little modification to made in the class "field".

The following user(s) said Thank You: [triotech](/forum/user/25968-triotech "View triotech's Profile")

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

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

Less More

- Posts: 71
- Thank you received: 0
-
-

13 years 3 months ago -  13 years 3 months ago [\#117603](#117603) by [triotech](/forum/user/25968-triotech "View triotech's Profile")  Replied by *[triotech](/forum/user/25968-triotech "View triotech's Profile")* on topic *[geolocation filling of address fields, country](/forum/27-checkout/860730-geolocation-filling-of-address-fields-country#117603 "--   www.3cordyceps.com/My-Order/checkout/task-step/step-1.html  -- HikaShop version -- : 2.2.0 Business -- Joomla version -- : 2.5.14 -- PHP version -- : -- Browser(s) name and version -- : all  Hi, I have enabled the Geolocation plugin and it is correctly configured. At the moment, I have it getting the user currency and shipping rules (correctly too). However, I am using the Simple Registration and when the user gets to the address page of the checkout, they have to nominate the country to send it to, despite the geolocation plugin on the same page telling them the correct shipping (see image). I know the customer needs to be able to specify any country for an address, but why can't the Country field be pre-populated with their country and not the default (USA in my case) ?  Cheers, Nick")*

Thanks Xavier, can you please let me know either in this thread or directly when this ready and I look forward to testing it out. Would this be an update to the component , plugin or both ?

Cheers, Nick

Last edit: 13 years 3 months ago by [triotech](/forum/user/25968-triotech "View triotech's Profile"). Reason: new info

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

13 years 3 months ago [\#117670](#117670) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[geolocation filling of address fields, country](/forum/27-checkout/860730-geolocation-filling-of-address-fields-country#117670 "--   www.3cordyceps.com/My-Order/checkout/task-step/step-1.html  -- HikaShop version -- : 2.2.0 Business -- Joomla version -- : 2.5.14 -- PHP version -- : -- Browser(s) name and version -- : all  Hi, I have enabled the Geolocation plugin and it is correctly configured. At the moment, I have it getting the user currency and shipping rules (correctly too). However, I am using the Simple Registration and when the user gets to the address page of the checkout, they have to nominate the country to send it to, despite the geolocation plugin on the same page telling them the correct shipping (see image). I know the customer needs to be able to specify any country for an address, but why can't the Country field be pre-populated with their country and not the default (USA in my case) ?  Cheers, Nick")*

Hi,

In the file:
"administrator/components/com_hikashop/classes/field.php"

Thanks to replace the function "display()" of the class ""hikashopZone", by: Code:

function display($field, $value, $map, $inside, $options = '', $test = false, $allFields = null, $allValues = null){ // Set default zone depending on the geolocation plugin $currentZoneId = hikashop_getZone()?hikashop_getZone():''; if(!empty($currentZoneId)){ $zoneClass = hikashop_get('class.zone'); $currentZone = $zoneClass-&gt;getZoneParents($currentZoneId); foreach($currentZone as $currentZoneInfos){ if(preg_match('/country/',$currentZoneInfos)){ $defaultCountry = $currentZoneInfos; } } } if($field-&gt;field_options['zone_type']=='country'){ $field-&gt;field_default = $defaultCountry; $stateNamekey = str_replace('country','state',$field-&gt;field_namekey); if(!empty($allFields)) { foreach($allFields as &amp;$f) { if(!empty($f-&gt;field_options['zone_type']) &amp;&amp; $f-&gt;field_options['zone_type'] == 'state') { $stateNamekey = $f-&gt;field_namekey; break; } } } $stateId = str_replace( array('[',']',$field-&gt;field_namekey), array('_','',$stateNamekey), $map ); $changeJs = 'window.hikashop.changeState(this,\''.$stateId.'\',\''.$field-&gt;field_url.'field_type='.$field-&gt;field_table.'&amp;field_id='.$stateId.'&amp;field_namekey='.$stateNamekey.'&amp;namekey=\'+this.value);'; if(!empty($options) &amp;&amp; stripos($options,'onchange="')!==false){ $options = preg_replace('#onchange="#i','onchange="'.$changeJs,$options); }else{ $options = ' onchange="'.$changeJs.'"'; } if($allFields == null &#124;&#124; $allValues == null) { $doc = JFactory::getDocument(); $js = 'window.addEvent(\'domready\', function() { var el = document.getElementById(\''.$this-&gt;prefix.$field-&gt;field_namekey.$this-&gt;suffix.'\'); window.hikashop.changeState(el,\''.$stateId.'\',\''.$field-&gt;field_url.'field_type='.$field-&gt;field_table.'&amp;field_id='.$stateId.'&amp;field_namekey='.$stateNamekey.'&amp;namekey=\'+el.value); });'; $doc-&gt;addScriptDeclaration($js); } } elseif($field-&gt;field_options['zone_type']=='state') { $stateId = str_replace(array('[',']'),array('_',''),$map); $dropdown = ''; if($allFields != null) { $country = null; foreach($allFields as $f) { if($f-&gt;field_type=='zone' &amp;&amp; !empty($f-&gt;field_options['zone_type']) &amp;&amp; $f-&gt;field_options['zone_type']=='country') { $key = $f-&gt;field_namekey; if(!empty($allValues-&gt;$key)) { $country = $allValues-&gt;$key; } else { $country = $f-&gt;field_default; } break; } } $country = ''; if(empty($country)) { $address_country_field = $this-&gt;parent-&gt;get(14); //14 = id of country field if(!empty($address_country_field) &amp;&amp; $address_country_field-&gt;field_type=='zone' &amp;&amp; !empty($address_country_field-&gt;field_options['zone_type']) &amp;&amp; $address_country_field-&gt;field_options['zone_type']=='country' &amp;&amp; !empty($address_country_field-&gt;field_default)) { $country = $address_country_field-&gt;field_default; } } if(isset($defaultCountry)){ $country = $defaultCountry; } if(!empty($country)) { $countryType = hikashop_get('type.country'); $dropdown = $countryType-&gt;displayStateDropDown($country, $stateId, $map, '', $value); } } return '&lt;span id="'.$stateId.'_container"&gt;'.$dropdown.'&lt;/span&gt;'. '&lt;input type="hidden" id="'.$stateId.'_default_value" name="'.$stateId.'_default_value" value="'.$value.'"/&gt;'; } return parent::display($field,$value,$map,$inside,$options,$test,$allFields,$allValues); }

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

13 years 3 months ago [\#117677](#117677) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[geolocation filling of address fields, country](/forum/27-checkout/860730-geolocation-filling-of-address-fields-country#117677 "--   www.3cordyceps.com/My-Order/checkout/task-step/step-1.html  -- HikaShop version -- : 2.2.0 Business -- Joomla version -- : 2.5.14 -- PHP version -- : -- Browser(s) name and version -- : all  Hi, I have enabled the Geolocation plugin and it is correctly configured. At the moment, I have it getting the user currency and shipping rules (correctly too). However, I am using the Simple Registration and when the user gets to the address page of the checkout, they have to nominate the country to send it to, despite the geolocation plugin on the same page telling them the correct shipping (see image). I know the customer needs to be able to specify any country for an address, but why can't the Country field be pre-populated with their country and not the default (USA in my case) ?  Cheers, Nick")*

I forgot a piece of code, in the function "display()" of the "hikashopDropdown" class, thanks to replace: Code:

$selected = ((int)$title-&gt;disabled &amp;&amp; !$admin) ? 'disabled="disabled" ' : ''; $selected .= ((is_numeric($value) &amp;&amp; is_numeric($oneValue) AND $oneValue == $value) &#124;&#124; (is_string($value) &amp;&amp; $oneValue === $value) &#124;&#124; is_array($value) &amp;&amp; in_array($oneValue,$value)) ? 'selected="selected" ' : '';

By: Code:

if(isset($field-&gt;field_default) &amp;&amp; $oneValue === $field-&gt;field_default){ $selected = (is_string($field-&gt;field_default) &amp;&amp; $oneValue === $field-&gt;field_default) &#124;&#124; is_array($field-&gt;field_default) &amp;&amp; in_array($oneValue,$field-&gt;field_default) ? 'selected="selected" ' : ''; }else{ $selected = ((int)$title-&gt;disabled &amp;&amp; !$admin) ? 'disabled="disabled" ' : ''; $selected .= ((is_numeric($value) &amp;&amp; is_numeric($oneValue) AND $oneValue == $value) &#124;&#124; (is_string($value) &amp;&amp; $oneValue === $value) &#124;&#124; is_array($value) &amp;&amp; in_array($oneValue,$value)) ? 'selected="selected" ' : ''; }

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

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

Less More

- Posts: 71
- Thank you received: 0
-
-

13 years 3 months ago [\#118477](#118477) by [triotech](/forum/user/25968-triotech "View triotech's Profile")  Replied by *[triotech](/forum/user/25968-triotech "View triotech's Profile")* on topic *[geolocation filling of address fields, country](/forum/27-checkout/860730-geolocation-filling-of-address-fields-country#118477 "--   www.3cordyceps.com/My-Order/checkout/task-step/step-1.html  -- HikaShop version -- : 2.2.0 Business -- Joomla version -- : 2.5.14 -- PHP version -- : -- Browser(s) name and version -- : all  Hi, I have enabled the Geolocation plugin and it is correctly configured. At the moment, I have it getting the user currency and shipping rules (correctly too). However, I am using the Simple Registration and when the user gets to the address page of the checkout, they have to nominate the country to send it to, despite the geolocation plugin on the same page telling them the correct shipping (see image). I know the customer needs to be able to specify any country for an address, but why can't the Country field be pre-populated with their country and not the default (USA in my case) ?  Cheers, Nick")*

Thanks for that, but it doesn't quite work. What I get is the United States still selected, but the State is now Auckland which IS a state/region of New Zealand, please see image. I have added both bits of code to the file.
[ ![h3419800.PNG](/forum/attachment/11668) ](/forum/attachment/11668 "h3419800.PNG")

Cheers, Nick

- [ ![h3419800.PNG](/forum/attachment/11668) ](/forum/attachment/11668 "h3419800.PNG") [ ](/forum/attachment/11668?download=1 "h3419800.PNG")

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

13 years 3 months ago [\#118489](#118489) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[geolocation filling of address fields, country](/forum/27-checkout/860730-geolocation-filling-of-address-fields-country#118489 "--   www.3cordyceps.com/My-Order/checkout/task-step/step-1.html  -- HikaShop version -- : 2.2.0 Business -- Joomla version -- : 2.5.14 -- PHP version -- : -- Browser(s) name and version -- : all  Hi, I have enabled the Geolocation plugin and it is correctly configured. At the moment, I have it getting the user currency and shipping rules (correctly too). However, I am using the Simple Registration and when the user gets to the address page of the checkout, they have to nominate the country to send it to, despite the geolocation plugin on the same page telling them the correct shipping (see image). I know the customer needs to be able to specify any country for an address, but why can't the Country field be pre-populated with their country and not the default (USA in my case) ?  Cheers, Nick")*

Hi,

I made changes in the display function, of the class "hikashopDropdown", thanks to use that code: Code:

function display($field, $value, $map, $inside, $options = '', $test = false, $allFields = null, $allValues = null){ $string = ''; if(!empty($field-&gt;field_value) &amp;&amp; !is_array($field-&gt;field_value)){ $field-&gt;field_value = $this-&gt;parent-&gt;explodeValues($field-&gt;field_value); } if(empty($field-&gt;field_value) &#124;&#124; !count($field-&gt;field_value)){ return '&lt;input type="hidden" name="'.$map.'" value="" /&gt;'; } if($this-&gt;type == "multiple"){ $string.= '&lt;input type="hidden" name="'.$map.'" value=" " /&gt;'; $map.='[]'; $arg = 'multiple="multiple"'; if(!empty($field-&gt;field_options['size'])) $arg .= ' size="'.intval($field-&gt;field_options['size']).'"'; }else{ $arg = 'size="1"'; if(is_string($value)&amp;&amp; empty($value) &amp;&amp; !empty($field-&gt;field_value)){ $found = false; $first = false; foreach($field-&gt;field_value as $oneValue =&gt; $title){ if($first===false){ $first=$oneValue; } if($oneValue==$value){ $found = true; break; } } //set default value for IE if(!$found){ $value = $first; } } } $string .= '&lt;select id="'.$this-&gt;prefix.$field-&gt;field_namekey.$this-&gt;suffix.'" name="'.$map.'" '.$arg.$options.'&gt;'; if(empty($field-&gt;field_value)) return $string.'&lt;/select&gt;'; $app = JFactory::getApplication(); $admin = $app-&gt;isAdmin(); foreach($field-&gt;field_value as $oneValue =&gt; $title){ if(isset($field-&gt;field_default) &amp;&amp; array_key_exists($field-&gt;field_default, $field-&gt;field_value)){ if($oneValue === $field-&gt;field_default){ $selected = (is_string($field-&gt;field_default) &amp;&amp; $oneValue === $field-&gt;field_default) &#124;&#124; is_array($field-&gt;field_default) &amp;&amp; in_array($oneValue,$field-&gt;field_default) ? 'selected="selected" ' : ''; }else{ $selected = ((int)$title-&gt;disabled &amp;&amp; !$admin) ? 'disabled="disabled" ' : ''; } }else{ $selected = ((int)$title-&gt;disabled &amp;&amp; !$admin) ? 'disabled="disabled" ' : ''; $selected .= ((is_numeric($value) &amp;&amp; is_numeric($oneValue) AND $oneValue == $value) &#124;&#124; (is_string($value) &amp;&amp; $oneValue === $value) &#124;&#124; is_array($value) &amp;&amp; in_array($oneValue,$value)) ? 'selected="selected" ' : ''; } $id = $this-&gt;prefix.$field-&gt;field_namekey.$this-&gt;suffix.'_'.$oneValue; $string .= '&lt;option value="'.$oneValue.'" id="'.$id.'" '.$selected.'&gt;'.$this-&gt;trans($title-&gt;value).'&lt;/option&gt;'; } $string .= '&lt;/select&gt;'; return $string; }

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

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

Less More

- Posts: 71
- Thank you received: 0
-
-

13 years 3 months ago [\#118498](#118498) by [triotech](/forum/user/25968-triotech "View triotech's Profile")  Replied by *[triotech](/forum/user/25968-triotech "View triotech's Profile")* on topic *[geolocation filling of address fields, country](/forum/27-checkout/860730-geolocation-filling-of-address-fields-country#118498 "--   www.3cordyceps.com/My-Order/checkout/task-step/step-1.html  -- HikaShop version -- : 2.2.0 Business -- Joomla version -- : 2.5.14 -- PHP version -- : -- Browser(s) name and version -- : all  Hi, I have enabled the Geolocation plugin and it is correctly configured. At the moment, I have it getting the user currency and shipping rules (correctly too). However, I am using the Simple Registration and when the user gets to the address page of the checkout, they have to nominate the country to send it to, despite the geolocation plugin on the same page telling them the correct shipping (see image). I know the customer needs to be able to specify any country for an address, but why can't the Country field be pre-populated with their country and not the default (USA in my case) ?  Cheers, Nick")*

Yes, this now works just fine. Thanks !

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

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

Less More

- Posts: 72
- Thank you received: 0
-
-

10 years 8 months ago [\#231098](#231098) by [mymall](/forum/user/36279-mymall "View mymall's Profile")  Replied by *[mymall](/forum/user/36279-mymall "View mymall's Profile")* on topic *[geolocation filling of address fields, country](/forum/27-checkout/860730-geolocation-filling-of-address-fields-country#231098 "--   www.3cordyceps.com/My-Order/checkout/task-step/step-1.html  -- HikaShop version -- : 2.2.0 Business -- Joomla version -- : 2.5.14 -- PHP version -- : -- Browser(s) name and version -- : all  Hi, I have enabled the Geolocation plugin and it is correctly configured. At the moment, I have it getting the user currency and shipping rules (correctly too). However, I am using the Simple Registration and when the user gets to the address page of the checkout, they have to nominate the country to send it to, despite the geolocation plugin on the same page telling them the correct shipping (see image). I know the customer needs to be able to specify any country for an address, but why can't the Country field be pre-populated with their country and not the default (USA in my case) ?  Cheers, Nick")*

Sorry to open this thread again but am truing to achieve the same (populating Country, City and street from the Geolocatin Plugin)
I have hisashop 2.5.1, I changed the filed.php file as per the above, I enabled the plugin, select yes for Customers geolocation, but the country and city) still empty
Please advice what am missing
thanks

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

10 years 8 months ago [\#231139](#231139) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[geolocation filling of address fields, country](/forum/27-checkout/860730-geolocation-filling-of-address-fields-country#231139 "--   www.3cordyceps.com/My-Order/checkout/task-step/step-1.html  -- HikaShop version -- : 2.2.0 Business -- Joomla version -- : 2.5.14 -- PHP version -- : -- Browser(s) name and version -- : all  Hi, I have enabled the Geolocation plugin and it is correctly configured. At the moment, I have it getting the user currency and shipping rules (correctly too). However, I am using the Simple Registration and when the user gets to the address page of the checkout, they have to nominate the country to send it to, despite the geolocation plugin on the same page telling them the correct shipping (see image). I know the customer needs to be able to specify any country for an address, but why can't the Country field be pre-populated with their country and not the default (USA in my case) ?  Cheers, Nick")*

Hi,

This geolocation plugin does not allow to fill the state and country fields of the address.
It would require a custom plugin to allow that.

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

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