Jump to content

Recommended Posts

Posted

I know its linked with user device location, but that's causing many ppl to punch UAE address when their device shows UK or US as in UAE while installing new OS many people use UK or US english than UAE as many are non Arabic speakers.

Hope there is a way out from this to set a default country to UAE by script edit or database edit etc. 

This is impacting us a lot and so far 3 users reported so we had a chance to explain but 100's pending invoices generated - god knows coz of billing error or abandoned cart (usual behaviour).

Please help, thanks in advance. 

Posted

@Admin can we have IPB pick up billing country based on real location of IP than the language?

In my Samsung note I use UK English and I see billing country as UK, in my desktop I use US English and I see billing country as US, whereas both devices are bought and used all the time in Dubai and both of the devices default location set at as Dubai, UAE.

Posted
2 hours ago, Gauravk said:

I know its linked with user device location, but that's causing many ppl to punch UAE address when their device shows UK or US as in UAE while installing new OS many people use UK or US english than UAE as many are non Arabic speakers.

Hope there is a way out from this to set a default country to UAE by script edit or database edit etc. 

This is impacting us a lot and so far 3 users reported so we had a chance to explain but 100's pending invoices generated - god knows coz of billing error or abandoned cart (usual behaviour).

Please help, thanks in advance. 

+1

Posted
10 hours ago, Gauravk said:

can we have IPB pick up billing country based on real location of IP than the language?

Create a plugin or open system\Helpers\Form\Address.php

Find 

		if ( isset( $_SERVER['HTTP_ACCEPT_LANGUAGE'] ) )

Add above 

		try
		{
			$location = \IPS\GeoLocation::getByIp(\IPS\Request::i()->ipAddress());

			if (\in_array($location->country, \IPS\GeoLocation::$countries))
			{
				return $location->country;
			}			
		}
		catch (\Exception $e) {}

 

Posted

@newbie LAC I cannot thank you enough for this WONDERFUL quick code edits.

Worked perfectly and does exactly what we want, to pick location based on real user location. 

Please PM me plugin option with your charges, Im happy to buy that so that I don't go through code edits after every upgrade.

EXCELLENT WORK, THANKS A LOT. YOU ARE A TRUE SUPERSTAR.

image.png.a98671ad467342926b0b34c262a7df17.png

 

Posted
On 2/19/2020 at 8:29 AM, newbie LAC said:

Create a plugin or open system\Helpers\Form\Address.php

Find 


		if ( isset( $_SERVER['HTTP_ACCEPT_LANGUAGE'] ) )

Add above 


		try
		{
			$location = \IPS\GeoLocation::getByIp(\IPS\Request::i()->ipAddress());

			if (\in_array($location->country, \IPS\GeoLocation::$countries))
			{
				return $location->country;
			}			
		}
		catch (\Exception $e) {}

 

Thank you very much! Please consider making it into a small but very useful plugin and posting on marketplace!

Posted

@newbie LAC, if you consider to make a plugin, could you please add some simple options? 🙄

  1. Set default country (dropdown-field)
  2. Always use the default country (Yes/no)
  3. Try to determine the country by user IP, if not possible use the default country (Yes/No)

I think this would cover every need 🙂

Posted

@Gauravk Out of interest, can you tell me:

  1. Are you in the UAE or a different country?
  2. What country is selected by default for you?
  3. What language is your computer/browser set to? 
  4. What does this tool say for "Your browser's Accept-Language header:"?
  5. Which OS and browser are you using?

I am trying to improve the auto detection and understanding more details about anyone it's incorrect for will be very useful.

Posted
  1. Are you in the UAE or a different country?
    1. Yes Im in UAE and my 99.9999999% users are also based in UAE
  2. What country is selected by default for you?
    1. From offce desktop - US, Samsung note - UK, Home desktop - UK, iPhone - UK
  3. What language is your computer/browser set to? 
    1. offce desktop - US English, Samsung note - UK English, Home desktop - UK English, iPhone - UK English
  4. What does this tool say for "Your browser's Accept-Language header:"?
    1. Your browser's Accept-Language header:
      en-GB,en-US;q=0.9,en;q=0.8,fr;q=0.7
  5. Which OS and browser are you using?
    1. Windows 10 and chrome every where except iPhone.
    2. Result were same even with samsung browser on my Note.

Picking country based on language was not an ideal solution IMO.

  • 4 weeks later...
Posted
2 hours ago, newbie LAC said:

Hello,

 

Hello, is possible add more abilities to this plugin? 

1. Modify the address fields. 

2. Add new fields that let asking for more information of the buyer. 

3. Change the default view of products page to List View. 

  • 2 weeks later...
Posted

Many thanks @newbie LAC for this wonderful plugin.

Just installed and it did exactly what it says. PERFECT.

Just a small bug, if you can fix it please, its putting all fields in bullets with additional spacing. 

image.png.e33d86319cf7c61247cc764c636b15bc.png

Posted

Thanks, I have cleared the cache and this bug has been resolved.

I think I must have done default country twice initially and that's what caused this extra bullets and spacing issue.

All good now, thanks for the plugin.

  • 10 months later...
Posted
On 2/19/2020 at 7:29 AM, newbie LAC said:

Create a plugin or open system\Helpers\Form\Address.php

Find 


		if ( isset( $_SERVER['HTTP_ACCEPT_LANGUAGE'] ) )

Add above 


		try
		{
			$location = \IPS\GeoLocation::getByIp(\IPS\Request::i()->ipAddress());

			if (\in_array($location->country, \IPS\GeoLocation::$countries))
			{
				return $location->country;
			}			
		}
		catch (\Exception $e) {}

 

Is this code available as a plugin for 4.5? I would be very interested. Thanks

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...