Version Notes
currently it is working for USA and Canada
Download this release
Release Info
Developer | Pravin |
Extension | GeoCurrencyStore |
Version | 1.0.0 |
Comparing to | |
See all releases |
Version 1.0.0
- app/code/local/Plumtree/GeoCurrencyStore/Model/Store.php +25 -0
- app/code/local/Plumtree/GeoCurrencyStore/Model/Store.php.LCK +1 -0
- app/code/local/Plumtree/GeoCurrencyStore/etc/config.xml +12 -0
- app/code/local/Plumtree/GeoCurrencyStore/etc/config.xml.LCK +1 -0
- app/etc/modules/Plumtree_GeoCurrencyStore.xml +17 -0
- package.xml +28 -0
app/code/local/Plumtree/GeoCurrencyStore/Model/Store.php
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Plumtree_GeoCurrencyStore_Model_Store extends Mage_Core_Model_Store
|
3 |
+
{
|
4 |
+
public function getDefaultCurrencyCode()
|
5 |
+
{
|
6 |
+
//Default Currency
|
7 |
+
$result = $this->getConfig(Mage_Directory_Model_Currency::XML_PATH_CURRENCY_DEFAULT);
|
8 |
+
|
9 |
+
$myarray = unserialize(file_get_contents('http://www.geoplugin.net/php.gp?ip='.$_SERVER['REMOTE_ADDR']));
|
10 |
+
$country = $myarray['geoplugin_countryCode'];
|
11 |
+
|
12 |
+
$currencyCode = $myarray['geoplugin_currencyCode'];
|
13 |
+
|
14 |
+
$allowedCurrencies = Mage::getModel('directory/currency')->getConfigAllowCurrencies();
|
15 |
+
|
16 |
+
if(!in_array($currencyCode, $allowedCurrencies)) {
|
17 |
+
return $result;
|
18 |
+
}
|
19 |
+
else
|
20 |
+
{
|
21 |
+
return $currencyCode;
|
22 |
+
}
|
23 |
+
}
|
24 |
+
}
|
25 |
+
?>
|
app/code/local/Plumtree/GeoCurrencyStore/Model/Store.php.LCK
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
Pravin
|
app/code/local/Plumtree/GeoCurrencyStore/etc/config.xml
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<global>
|
4 |
+
<models>
|
5 |
+
<core>
|
6 |
+
<rewrite>
|
7 |
+
<store>Plumtree_GeoCurrencyStore_Model_Store</store>
|
8 |
+
</rewrite>
|
9 |
+
</core>
|
10 |
+
</models>
|
11 |
+
</global>
|
12 |
+
</config>
|
app/code/local/Plumtree/GeoCurrencyStore/etc/config.xml.LCK
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
Pravin
|
app/etc/modules/Plumtree_GeoCurrencyStore.xml
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* @category Plumtree
|
5 |
+
* @package Plumtree_CustomerFeedback
|
6 |
+
* @author ModuleCreator
|
7 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
8 |
+
*/
|
9 |
+
-->
|
10 |
+
<config>
|
11 |
+
<modules>
|
12 |
+
<Plumtree_GeoCurrencyStore>
|
13 |
+
<active>true</active>
|
14 |
+
<codePool>local</codePool>
|
15 |
+
</Plumtree_GeoCurrencyStore>
|
16 |
+
</modules>
|
17 |
+
</config>
|
package.xml
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>GeoCurrencyStore</name>
|
4 |
+
<version>1.0.0</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>Change Store currency automatically depending on visitor's IP address.
|
10 |
+
</summary>
|
11 |
+
<description>Change Store currency automatically depending visitor's IP address and automatically changes the store currency to the visitor's location currency.
|
12 |
+

|
13 |
+
Easy to install and no configuration required.
|
14 |
+

|
15 |
+
You must have multiple currency enabled on your store.
|
16 |
+

|
17 |
+

|
18 |
+

|
19 |
+

|
20 |
+
</description>
|
21 |
+
<notes>currently it is working for USA and Canada</notes>
|
22 |
+
<authors><author><name>Pravin</name><user>pravin_bluebird</user><email>pravin@plumtreegroup.net</email></author></authors>
|
23 |
+
<date>2012-09-19</date>
|
24 |
+
<time>12:02:48</time>
|
25 |
+
<contents><target name="magelocal"><dir name="Plumtree"><dir name="GeoCurrencyStore"><dir name="Model"><file name="Store.php" hash="629cfbec8565a2c1dff487639c7b01d8"/><file name="Store.php.LCK" hash="daf465486047727f285b1a2d8d0f375b"/></dir><dir name="etc"><file name="config.xml" hash="6412b1196e06ead64d36151a2772e218"/><file name="config.xml.LCK" hash="daf465486047727f285b1a2d8d0f375b"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Plumtree_GeoCurrencyStore.xml" hash="1d95a3d80f5726331584731b5e2275fb"/></dir></target></contents>
|
26 |
+
<compatible/>
|
27 |
+
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
28 |
+
</package>
|