Title: Select UK
Last modified: November 3, 2016

---

# Select UK

 *  Resolved [Luddington](https://wordpress.org/support/users/luddington/)
 * (@luddington)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/select-uk/)
 * Hi, just started with this plugin and it looks great but is there a way of switching
   the results to Amazon UK instead of Amazon US? My readers mostly come from UK–
   Thanks

Viewing 1 replies (of 1 total)

 *  Plugin Author [Jake Evans](https://wordpress.org/support/users/forwardcreation/)
 * (@forwardcreation)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/select-uk/#post-8397494)
 * After talking with David further, the following is the official fix, to be included
   in future updates:
 * In savedbookactions.php, the following code was added directly underneath “$amazondetpage
   = filter_var($saved_book->amazondetailpage, FILTER_SANITIZE_URL);”
 * // Following code is to direct visitors to the UK amazon if they’re in the UK,
   based off their IP
    // Getting user’s ip $ip; if (!empty($_SERVER[‘HTTP_CLIENT_IP’])){
   $ip = $_SERVER[‘HTTP_CLIENT_IP’]; } elseif (! empty($_SERVER[‘HTTP_X_FORWARDED_FOR’])){
   $ip = $_SERVER[‘HTTP_X_FORWARDED_FOR’]; } else { $ip = $_SERVER[‘REMOTE_ADDR’];}
 *  // Getting country based on ip
    $xml = simplexml_load_file(“[http://www.geoplugin.net/xml.gp?ip=&#8221](http://www.geoplugin.net/xml.gp?ip=&#8221);.
   $ip);
 *  // Checking to see if the user’s site is in UK
    $visitor_country = $xml->geoplugin_countryName;
   if ($visitor_country == ‘United Kingdom’) { $amazondetpage = str_replace(“.com”,”.
   co.uk”, $amazondetpage); }

Viewing 1 replies (of 1 total)

The topic ‘Select UK’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wpbooklist_cddce4.svg)
 * [WordPress Book List](https://wordpress.org/plugins/wpbooklist/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wpbooklist/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wpbooklist/)
 * [Active Topics](https://wordpress.org/support/plugin/wpbooklist/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wpbooklist/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wpbooklist/reviews/)

## Tags

 * [amazon](https://wordpress.org/support/topic-tag/amazon/)
 * [books](https://wordpress.org/support/topic-tag/books/)
 * [UK](https://wordpress.org/support/topic-tag/uk/)

 * 1 reply
 * 2 participants
 * Last reply from: [Jake Evans](https://wordpress.org/support/users/forwardcreation/)
 * Last activity: [9 years, 6 months ago](https://wordpress.org/support/topic/select-uk/#post-8397494)
 * Status: resolved