Juicy_GeoIP - Version 1.2.4

Version Notes

FIXED: Fixed bug with store detection on a multi-store environment where the naming scheme was the same.

FIXED: Removed unnecessary output

Download this release

Release Info

Developer Juicy Media
Extension Juicy_GeoIP
Version 1.2.4
Comparing to
See all releases


Code changes from version 1.2.3 to 1.2.4

app/code/local/Juicy/Geoip/Model/Geoip.php CHANGED
@@ -33,9 +33,9 @@ class Juicy_Geoip_Model_Geoip
33
  protected function _setStore($searchArr)
34
  {
35
  if(Mage::helper('geoip')->canSwitch("store")){
36
- $storeName = Mage::app()->getStore($searchArr['store'])->getName();
37
- if ($storeName) {
38
- $store = Mage::getModel('core/store')->load($storeName, 'name');
39
  if ($store->getName() != Mage::app()->getStore()->getName()) {
40
  //Needs to return store URL for observer to redirect using event
41
  return $store->getCurrentUrl(false);
33
  protected function _setStore($searchArr)
34
  {
35
  if(Mage::helper('geoip')->canSwitch("store")){
36
+ $storeCode = Mage::app()->getStore($searchArr['store'])->getCode();
37
+ if ($storeCode) {
38
+ $store = Mage::getModel('core/store')->load($storeCode);
39
  if ($store->getName() != Mage::app()->getStore()->getName()) {
40
  //Needs to return store URL for observer to redirect using event
41
  return $store->getCurrentUrl(false);
app/code/local/Juicy/Geoip/Model/Observer.php CHANGED
@@ -6,14 +6,13 @@ class Juicy_Geoip_Model_Observer
6
  {
7
  if(Mage::helper("geoip")->isModuleEnabled() == 1 && !Mage::helper("geoip")->isPrivateIp() && !Mage::helper("geoip")->isCrawler()){
8
  if(Mage::helper("geoip")->enableTestMode()){
9
- var_dump("in here");
10
  Mage::getModel('core/session')->unsGeoipChecked();
11
  }
12
  $session = Mage::getModel('core/session')->getGeoipChecked();
13
  if(!isset($session) || $session == false){
14
- $redirStore = Mage::getModel('geoip/geoip')->runGeoip();
15
  if($redirStore){
16
- $e->getControllerAction()->getResponse()->setRedirect($redirStore);
17
  }
18
  Mage::getSingleton('core/session')->setGeoipChecked(true);
19
  }
6
  {
7
  if(Mage::helper("geoip")->isModuleEnabled() == 1 && !Mage::helper("geoip")->isPrivateIp() && !Mage::helper("geoip")->isCrawler()){
8
  if(Mage::helper("geoip")->enableTestMode()){
 
9
  Mage::getModel('core/session')->unsGeoipChecked();
10
  }
11
  $session = Mage::getModel('core/session')->getGeoipChecked();
12
  if(!isset($session) || $session == false){
13
+ $redirStore = Mage::getModel('geoip/geoip')->runGeoip();
14
  if($redirStore){
15
+ $e->getControllerAction()->getResponse()->setRedirect($redirStore)->sendResponse();
16
  }
17
  Mage::getSingleton('core/session')->setGeoipChecked(true);
18
  }
app/code/local/Juicy/Geoip/etc/config.xml CHANGED
@@ -4,7 +4,7 @@
4
  <config>
5
  <modules>
6
  <Juicy_Geoip>
7
- <version>1.2.1</version>
8
  </Juicy_Geoip>
9
  </modules>
10
  <global>
4
  <config>
5
  <modules>
6
  <Juicy_Geoip>
7
+ <version>1.2.4</version>
8
  </Juicy_Geoip>
9
  </modules>
10
  <global>
package.xml CHANGED
@@ -1,18 +1,20 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Juicy_GeoIP</name>
4
- <version>1.2.3</version>
5
  <stability>stable</stability>
6
  <license>GPL</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Change currency using the visitors IP address and the PHP GeoIP module</summary>
10
  <description>Gets the customers current country using PHP's GeoIP module, filters through a list of countries and grabs the associated currency code for Magento</description>
11
- <notes>FIXED: Bug forcing non-switchable stores</notes>
 
 
12
  <authors><author><name>Jonathan Webb</name><user>JuicyMedia</user><email>jonathan.webb@juicymedia.co.uk</email></author></authors>
13
- <date>2015-05-11</date>
14
- <time>09:51:38</time>
15
- <contents><target name="magelocal"><dir name="Juicy"><dir name="Geoip"><dir name="Block"><file name="Countrydefine.php" hash="0032d7797b0dc464fe0edc99d6a7fe7e"/></dir><dir name="Helper"><file name="Data.php" hash="9882f9b97a39dfa24e5c4308ccb64e4f"/></dir><dir name="Model"><dir name="Adminhtml"><dir name="Source"><file name="TestingMode.php" hash="2dd38a3453e62a540122f7bafeda852e"/></dir></dir><file name="Geoip.php" hash="839209264d547ecce878609430efc3fd"/><file name="Observer.php" hash="acfd54746fc9d37171aa3d70b4592714"/></dir><dir name="etc"><file name="adminhtml.xml" hash="91b7ec025a4c78cfec3ccabbad065ecb"/><file name="config.xml" hash="f259a8d24dc9aaf7ee23943f4ecf26dc"/><file name="system.xml" hash="fa8ad2819935e9ad08a901d334ea8537"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Juicy_Geoip.xml" hash="c4ebc7b11208b6c6b6020cb581ba9b12"/></dir></target><target name="magelib"><dir name="Juicy"><dir name="Geoip"><dir name="Data"><file name="geoip.dat" hash="76476935f1cfea10145cf52d3798f801"/></dir><file name="geoip.inc" hash="09b0a2dd03361a2cb00ef5ec68b4edea"/></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="juicy"><dir name="geoip"><dir name="system"><dir name="config"><dir name="form"><dir name="field"><file name="array.phtml" hash="6335d9d4d1ce8a63793a1dede6061010"/></dir></dir></dir></dir></dir></dir></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.0.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Juicy_GeoIP</name>
4
+ <version>1.2.4</version>
5
  <stability>stable</stability>
6
  <license>GPL</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Change currency using the visitors IP address and the PHP GeoIP module</summary>
10
  <description>Gets the customers current country using PHP's GeoIP module, filters through a list of countries and grabs the associated currency code for Magento</description>
11
+ <notes>FIXED: Fixed bug with store detection on a multi-store environment where the naming scheme was the same.&#xD;
12
+ &#xD;
13
+ FIXED: Removed unnecessary output</notes>
14
  <authors><author><name>Jonathan Webb</name><user>JuicyMedia</user><email>jonathan.webb@juicymedia.co.uk</email></author></authors>
15
+ <date>2015-07-23</date>
16
+ <time>10:04:54</time>
17
+ <contents><target name="magelocal"><dir name="Juicy"><dir name="Geoip"><dir name="Block"><file name="Countrydefine.php" hash="0032d7797b0dc464fe0edc99d6a7fe7e"/></dir><dir name="Helper"><file name="Data.php" hash="9882f9b97a39dfa24e5c4308ccb64e4f"/></dir><dir name="Model"><dir name="Adminhtml"><dir name="Source"><file name="TestingMode.php" hash="2dd38a3453e62a540122f7bafeda852e"/></dir></dir><file name="Geoip.php" hash="846891c8342a30c5b83d23f8b74635b8"/><file name="Observer.php" hash="3d9b3989c3b03a64e0a30703494f19cb"/></dir><dir name="etc"><file name="adminhtml.xml" hash="91b7ec025a4c78cfec3ccabbad065ecb"/><file name="config.xml" hash="46c684844ce7ce8911893c184fd06a35"/><file name="system.xml" hash="fa8ad2819935e9ad08a901d334ea8537"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Juicy_Geoip.xml" hash="c4ebc7b11208b6c6b6020cb581ba9b12"/></dir></target><target name="magelib"><dir name="Juicy"><dir name="Geoip"><dir name="Data"><file name="geoip.dat" hash="76476935f1cfea10145cf52d3798f801"/></dir><file name="geoip.inc" hash="09b0a2dd03361a2cb00ef5ec68b4edea"/></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="juicy"><dir name="geoip"><dir name="system"><dir name="config"><dir name="form"><dir name="field"><file name="array.phtml" hash="6335d9d4d1ce8a63793a1dede6061010"/></dir></dir></dir></dir></dir></dir></dir></dir></dir></dir></target></contents>
18
  <compatible/>
19
  <dependencies><required><php><min>5.0.0</min><max>6.0.0</max></php></required></dependencies>
20
  </package>