Use Geolocation plugin to select Country on user registration

  • Posts: 16
  • Thank you received: 2
  • Hikashop Business
5 years 4 months ago #300807

-- HikaShop version -- : 3.5.1
-- Joomla version -- : 3.9.0

Is it possible that the Custom Field, "Country" could be used to linked with the Geolocation plugin so that the user's Country could be automatically selected from the dropdown field? This would work in a similar way to how the Geolocation plugin works for automatically changing the displayed currency.

Please Log in or Create an account to join the conversation.

  • Posts: 16
  • Thank you received: 2
  • Hikashop Business
5 years 4 months ago #300810

It appears that this feature already exists but is not working on my installation. It is failing on the below lines of code in the classes/field.php file (hikashopFieldDropdown class, display function)

if(isset($field->field_default) && !$isValue) {
	if(array_key_exists($field->field_default, $field->field_value)){

!$isValue is returning 0
array_key_exists($field->field_default, $field->field_value) is also returning 0

Please Log in or Create an account to join the conversation.

  • Posts: 25999
  • Thank you received: 4004
  • MODERATOR
5 years 4 months ago #300834

Hello,

It would indicate that your country field default value is not set-up.

Regards,


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

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 16
  • Thank you received: 2
  • Hikashop Business
5 years 4 months ago #300837

Hi Jerome,

Default value for country has been set in the address_country custom field. I have also tried setting the default value to other countries with no success.

This message contains confidential information

Last edit: 5 years 4 months ago by tgowans1.

Please Log in or Create an account to join the conversation.

  • Posts: 25999
  • Thank you received: 4004
  • MODERATOR
5 years 4 months ago #300845

Hello,

I cannot reproduced your issue.
If the geolocation plugin do store the "geoloc_zone_id" in the user session, that value is used by the Zone field and it replace the default country that you have stored in the field.

I don't know what zone is retrieved by your plugin (and stored in the session) but there is no kind of bug in the HikaShop field system.

Regards,


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

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

Time to create page: 0.062 seconds
Powered by Kunena Forum