Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted February 18, 20205 yr 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.
February 18, 20205 yr Author @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.
February 18, 20205 yr 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
February 19, 20205 yr 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) {}
February 19, 20205 yr Author @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.
February 20, 20205 yr 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!
February 20, 20205 yr @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 🙂
February 20, 20205 yr @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.
February 20, 20205 yr Author 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.
March 18, 20205 yr Hello, 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.
March 18, 20205 yr 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.
March 28, 20205 yr Author 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.
March 28, 20205 yr Hello, 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, 20205 yr by newbie LAC
March 28, 20205 yr Author 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.
February 13, 20214 yr 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