Jump to content

Community

How to change billing default country?


Recommended Posts

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. 

Link to post
Share on other sites

@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.

Link to post
Share on other sites
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

Link to post
Share on other sites
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) {}

 

Link to post
Share on other sites

@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

 

Link to post
Share on other sites
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!

Link to post
Share on other sites

@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.

Link to post
Share on other sites
  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.

Link to post
Share on other sites
  • 4 weeks later...
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. 

Link to post
Share on other sites
  • 2 weeks later...
  • 10 months later...
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

Link to post
Share on other sites
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

We use technologies, such as cookies, to customise content and advertising, to provide social media features and to analyse traffic to the site. We also share information about your use of our site with our trusted social media, advertising and analytics partners. See more about cookies and our Privacy Policy