Sweet-Apple Geolocation

MageCloud partnered with Sweet-Apple to offer Sweet-Apple Geolocation in your MageCloud panel for our simple 1-click installation option. To install this extension - create your account with MageCloud and launch a new Magento store. It takes only 3 minutes.

Sweet-Apple always provides support for customers who have installed Sweet-Apple Geolocation Magento module. Feel free to leave a review for the company and the extension so we can offer you better products and services in the future.

You may want to check other Sweet-Apple Magento extensions available at MageCloud and even get extensions from hundreds of other Magento developers using our marketplace.

Write easy template logic to detect the visitor's country and display different, country specific content.

Compatible with Magento 1.x

Sweet-Apple Geolocation

The Sweet-Apple Geotargeting Extension enables you to make a simple query to determine the country a visitor to your web site is browsing from. You can then show them different content, according to the country reported, with a few lines of simple template logic.

This product includes GeoLite data created by MaxMind, available from http://www.maxmind.com

  • The Sweetapple_Geotargeting_Helper_Data::getCountryCodeFromIPAddress() method returns the country code for the site visitor. You can then easily write code to check the country code and load content according to country in your templates.
  • Basic example code to use in your .phtml template files:

    $_ipHelper = $this->helper('sweetapple_geotargeting/data'); /* @var $_ipHelper Sweetapple_Geotargeting_Helper_Data */
    $countryCodeFromIP = $_ipHelper->getCountryCodeFromIPAddress();
    if( $countryCodeFromIP == "GB" ) {
    //do something here, like load a specific static block...
    echo $this->getLayout()->createBlock('cms/block')->setBlockId('home_page_message_GB')->toHtml();
    }
  • If the IP address is successfully converted to a country code, the Country Code is stored in the user's session. If you are testing and changing your IP address using a Proxy Server, you must clear the session cookie in your browser to see any changes. If you use the Test IP Address field in System->Configuration, the Country Code stored in the session is cleared when saving a Valid IP or emptying the field.