Gauravk Posted February 18, 2020 Posted February 18, 2020 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. OptimusBain and kmk 2
Gauravk Posted February 18, 2020 Author Posted February 18, 2020 @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. OptimusBain 1
kmk Posted February 18, 2020 Posted February 18, 2020 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 Gauravk and OptimusBain 1 1
newbie LAC Posted February 19, 2020 Posted February 19, 2020 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) {} Sonya*, OptimusBain, Maxxius and 2 others 1 4
Gauravk Posted February 19, 2020 Author Posted February 19, 2020 @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. kmk and OptimusBain 2
Maxxius Posted February 20, 2020 Posted February 20, 2020 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! OptimusBain and Sonya* 2
Sonya* Posted February 20, 2020 Posted February 20, 2020 @newbie LAC, if you consider to make a plugin, could you please add some simple options? 🙄 Set default country (dropdown-field) Always use the default country (Yes/no) Try to determine the country by user IP, if not possible use the default country (Yes/No) I think this would cover every need 🙂 Maxxius and Gauravk 2
Mark Posted February 20, 2020 Posted February 20, 2020 @Gauravk Out of interest, can you tell me: Are you in the UAE or a different country? What country is selected by default for you? What language is your computer/browser set to? What does this tool say for "Your browser's Accept-Language header:"? 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.
Gauravk Posted February 20, 2020 Author Posted February 20, 2020 Are you in the UAE or a different country? Yes Im in UAE and my 99.9999999% users are also based in UAE What country is selected by default for you? From offce desktop - US, Samsung note - UK, Home desktop - UK, iPhone - UK What language is your computer/browser set to? offce desktop - US English, Samsung note - UK English, Home desktop - UK English, iPhone - UK English What does this tool say for "Your browser's Accept-Language header:"? Your browser's Accept-Language header:en-GB,en-US;q=0.9,en;q=0.8,fr;q=0.7 Which OS and browser are you using? Windows 10 and chrome every where except iPhone. Result were same even with samsung browser on my Note. Picking country based on language was not an ideal solution IMO.
Mark Posted February 22, 2020 Posted February 22, 2020 Which of the devices you listed was your answer to question #4?
newbie LAC Posted March 18, 2020 Posted March 18, 2020 Hello, On 2/19/2020 at 11:55 AM, Gauravk said: 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. Gauravk 1
kmk Posted March 18, 2020 Posted March 18, 2020 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.
newbie LAC Posted March 18, 2020 Posted March 18, 2020 Hello, 2 hours ago, kmk said: is possible add more abilities to this plugin? No
Gauravk Posted March 28, 2020 Author Posted March 28, 2020 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.
newbie LAC Posted March 28, 2020 Posted March 28, 2020 (edited) Hello, 1 hour ago, Gauravk said: Just a small bug, if you can fix it please, its putting all fields in bullets with additional spacing. My plugin doesn't change HTML Test Edited March 28, 2020 by newbie LAC Gauravk 1
Gauravk Posted March 28, 2020 Author Posted March 28, 2020 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.
OptimusBain Posted February 13, 2021 Posted February 13, 2021 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
Recommended Posts