Home › Forums › Quform WordPress › Geolocation
- This topic has 9 replies, 3 voices, and was last updated 5 years, 9 months ago by Ally.
- AuthorPosts
- June 2, 2016 at 7:36 pm #19160albert_12345Participant
Hello,
Thanks for an awesome plug-in.
I need a dropdown where the user’s location (country) is pre-selected.
I’ve already installed the plug-in ‘GeoIP Detection’ and it’s using Maxmind’s ‘GeoLite2 City database’.
I’m wondering what is the next step. Sorry, I’m not really a PHP developer.
Please help. Thanks.
_albert
June 3, 2016 at 12:32 am #19161albert_12345Participant– So I checked ‘Dynamic default value.
– I put ‘country’ as the Parameter name
– Then on functions.php of the theme i’m using i added:add_filter(‘iphorm_element_value_country’, ‘mytheme_set_country’);
function mytheme_set_country($value)
{
$record->country->name;
}Am I missing something?
Thanks in advance!
June 3, 2016 at 8:16 pm #19245albert_12345Participantanybody?
June 3, 2016 at 8:27 pm #19246AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
June 3, 2016 at 8:50 pm #19248albert_12345ParticipantThank you!
It works now!
June 21, 2018 at 7:57 pm #26135currentwareParticipantIs it possible to input the country into one of Quform’s hidden fields?
June 21, 2018 at 9:16 pm #26138currentwareParticipantAlly,
Can you help me out? I am trying to use the same plugin to get the city, state and country to auto fill into my QuForm.
I took you code and added to my WordPress Theme Functions (functions.php):
function mytheme_set_country()
{
$record = geoip_detect2_get_info_from_current_ip();return $record->country->name;
}
add_filter(‘iphorm_element_value_country’, ‘mytheme_set_country’);The country value is being displayed in the shortcut, but it is not showing up in the dropdown menu.
Looking forward to your assistance!
Attachments:
You must be logged in to view attached files.June 21, 2018 at 9:18 pm #26141currentwareParticipantI am using QuForm 2!
June 25, 2018 at 2:34 pm #26166AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
June 26, 2018 at 10:23 am #26181AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
- AuthorPosts
- You must be logged in to reply to this topic.