Version Notes
Release from magento 1.5.x
Download this release
Release Info
Developer | Jextn Themes |
Extension | Jextn_Currencyconverter |
Version | 1.0.0 |
Comparing to | |
See all releases |
Version 1.0.0
- app/code/community/Jextn/Currencyconverter/Block/Currencyconverter.php +17 -0
- app/code/community/Jextn/Currencyconverter/Helper/Data.php +17 -0
- app/code/community/Jextn/Currencyconverter/controllers/IndexController.php +47 -0
- app/code/community/Jextn/Currencyconverter/etc/config.xml +104 -0
- app/code/community/Jextn/Currencyconverter/etc/system.xml +40 -0
- app/design/frontend/default/default/layout/currencyconverter.xml +19 -0
- app/design/frontend/default/default/template/currencyconverter/currencyconverter.phtml +203 -0
- app/etc/modules/Jextn_Currencyconverter.xml +9 -0
- package.xml +18 -0
- skin/frontend/default/default/css/currencyconverter.css +5 -0
- skin/frontend/default/default/js/currencyconverter.js +14 -0
app/code/community/Jextn/Currencyconverter/Block/Currencyconverter.php
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Jextn_Currencyconverter_Block_Currencyconverter extends Mage_Core_Block_Template
|
3 |
+
{
|
4 |
+
public function _prepareLayout()
|
5 |
+
{
|
6 |
+
return parent::_prepareLayout();
|
7 |
+
}
|
8 |
+
|
9 |
+
public function getCurrencyconverter()
|
10 |
+
{
|
11 |
+
if (!$this->hasData('currencyconverter')) {
|
12 |
+
$this->setData('currencyconverter', Mage::registry('currencyconverter'));
|
13 |
+
}
|
14 |
+
return $this->getData('currencyconverter');
|
15 |
+
|
16 |
+
}
|
17 |
+
}
|
app/code/community/Jextn/Currencyconverter/Helper/Data.php
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Jextn_Currencyconverter_Helper_Data extends Mage_Core_Helper_Abstract
|
4 |
+
{
|
5 |
+
const XML_PATH_ENABLED = 'currencyconverter/currencyconverter/enabled';
|
6 |
+
|
7 |
+
public function isEnabled()
|
8 |
+
{
|
9 |
+
return Mage::getStoreConfig( self::XML_PATH_ENABLED );
|
10 |
+
}
|
11 |
+
|
12 |
+
public function converterfooter()
|
13 |
+
{
|
14 |
+
$convertfooter = "<div class='currencyfooter'>Jextn <a href='http://www.magento-themes.jextn.com' title='Magento Themes'>Magento Themes</a></div>";
|
15 |
+
return $convertfooter;
|
16 |
+
}
|
17 |
+
}
|
app/code/community/Jextn/Currencyconverter/controllers/IndexController.php
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Jextn_Currencyconverter_IndexController extends Mage_Core_Controller_Front_Action
|
3 |
+
{
|
4 |
+
public function indexAction()
|
5 |
+
{
|
6 |
+
$this->loadLayout();
|
7 |
+
$this->renderLayout();
|
8 |
+
}
|
9 |
+
|
10 |
+
public function convertAction()
|
11 |
+
{
|
12 |
+
|
13 |
+
$amount = $_POST['amount'];
|
14 |
+
$from = $_POST['fromselected'];
|
15 |
+
$to = $_POST['toselected'];
|
16 |
+
if(is_numeric($amount)) {
|
17 |
+
$string = "1".$from."=?".$to;
|
18 |
+
$google_url = "http://www.google.com/ig/calculator?hl=en&q=".$string;
|
19 |
+
|
20 |
+
$result = file_get_contents($google_url);
|
21 |
+
|
22 |
+
$result = explode('"', $result);
|
23 |
+
|
24 |
+
$converted_amount = explode(' ', $result[3]);
|
25 |
+
$conversion = $converted_amount[0];
|
26 |
+
$conversion = preg_replace('/[\x00-\x08\x0B-\x1F]/', '', $conversion);
|
27 |
+
$conversion = $conversion * $amount;
|
28 |
+
$conversion = round($conversion, 2);
|
29 |
+
|
30 |
+
$rhs_text = ucwords($_POST['toselected']);
|
31 |
+
|
32 |
+
$rhs = $conversion." ".$rhs_text;
|
33 |
+
|
34 |
+
$google_lhs = explode(' ', $result[1]);
|
35 |
+
$from_amount = $google_lhs[0];
|
36 |
+
|
37 |
+
$from_text = ucwords($_POST['fromselected']);
|
38 |
+
|
39 |
+
$lhs = $amount." ".$from_text;
|
40 |
+
|
41 |
+
echo $lhs." = ".$rhs;
|
42 |
+
} else {
|
43 |
+
echo "Please add valid Amount";
|
44 |
+
}
|
45 |
+
|
46 |
+
}
|
47 |
+
}
|
app/code/community/Jextn/Currencyconverter/etc/config.xml
ADDED
@@ -0,0 +1,104 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Jextn_Currencyconverter>
|
5 |
+
<version>0.1.0</version>
|
6 |
+
</Jextn_Currencyconverter>
|
7 |
+
</modules>
|
8 |
+
<frontend>
|
9 |
+
<routers>
|
10 |
+
<currencyconverter>
|
11 |
+
<use>standard</use>
|
12 |
+
<args>
|
13 |
+
<module>Jextn_Currencyconverter</module>
|
14 |
+
<frontName>currencyconverter</frontName>
|
15 |
+
</args>
|
16 |
+
</currencyconverter>
|
17 |
+
</routers>
|
18 |
+
<layout>
|
19 |
+
<updates>
|
20 |
+
<currencyconverter>
|
21 |
+
<file>currencyconverter.xml</file>
|
22 |
+
</currencyconverter>
|
23 |
+
</updates>
|
24 |
+
</layout>
|
25 |
+
</frontend>
|
26 |
+
<admin>
|
27 |
+
<routers>
|
28 |
+
<currencyconverter>
|
29 |
+
<use>admin</use>
|
30 |
+
<args>
|
31 |
+
<module>Jextn_Currencyconverter</module>
|
32 |
+
<frontName>currencyconverter</frontName>
|
33 |
+
</args>
|
34 |
+
</currencyconverter>
|
35 |
+
</routers>
|
36 |
+
</admin>
|
37 |
+
<adminhtml>
|
38 |
+
<acl>
|
39 |
+
<resources>
|
40 |
+
<all>
|
41 |
+
<title>Allow Everything</title>
|
42 |
+
</all>
|
43 |
+
<admin>
|
44 |
+
<children>
|
45 |
+
<Jextn_Currencyconverter>
|
46 |
+
<title>CurrencyConverter Module</title>
|
47 |
+
<sort_order>10</sort_order>
|
48 |
+
</Jextn_Currencyconverter>
|
49 |
+
<system>
|
50 |
+
<children>
|
51 |
+
<config>
|
52 |
+
<children>
|
53 |
+
<currencyconverter>
|
54 |
+
<title>Currency Converter</title>
|
55 |
+
</currencyconverter>
|
56 |
+
</children>
|
57 |
+
</config>
|
58 |
+
</children>
|
59 |
+
</system>
|
60 |
+
</children>
|
61 |
+
</admin>
|
62 |
+
</resources>
|
63 |
+
</acl>
|
64 |
+
</adminhtml>
|
65 |
+
<global>
|
66 |
+
<resources>
|
67 |
+
<currencyconverter_setup>
|
68 |
+
<setup>
|
69 |
+
<module>Jextn_Currencyconverter</module>
|
70 |
+
</setup>
|
71 |
+
<connection>
|
72 |
+
<use>core_setup</use>
|
73 |
+
</connection>
|
74 |
+
</currencyconverter_setup>
|
75 |
+
<currencyconverter_write>
|
76 |
+
<connection>
|
77 |
+
<use>core_write</use>
|
78 |
+
</connection>
|
79 |
+
</currencyconverter_write>
|
80 |
+
<currencyconverter_read>
|
81 |
+
<connection>
|
82 |
+
<use>core_read</use>
|
83 |
+
</connection>
|
84 |
+
</currencyconverter_read>
|
85 |
+
</resources>
|
86 |
+
<blocks>
|
87 |
+
<currencyconverter>
|
88 |
+
<class>Jextn_Currencyconverter_Block</class>
|
89 |
+
</currencyconverter>
|
90 |
+
</blocks>
|
91 |
+
<helpers>
|
92 |
+
<currencyconverter>
|
93 |
+
<class>Jextn_Currencyconverter_Helper</class>
|
94 |
+
</currencyconverter>
|
95 |
+
</helpers>
|
96 |
+
</global>
|
97 |
+
<default>
|
98 |
+
<currencyconverter>
|
99 |
+
<currencyconverter>
|
100 |
+
<enabled>1</enabled>
|
101 |
+
</currencyconverter>
|
102 |
+
</currencyconverter>
|
103 |
+
</default>
|
104 |
+
</config>
|
app/code/community/Jextn/Currencyconverter/etc/system.xml
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<config>
|
2 |
+
<tabs>
|
3 |
+
<jextn translate="label" module="currencyconverter">
|
4 |
+
<label>Jextn Modules</label>
|
5 |
+
<sort_order>100</sort_order>
|
6 |
+
</jextn>
|
7 |
+
</tabs>
|
8 |
+
<sections>
|
9 |
+
<currencyconverter translate="label" module="currencyconverter">
|
10 |
+
<label>Currency Converter</label>
|
11 |
+
<tab>jextn</tab>
|
12 |
+
<frontend_type>text</frontend_type>
|
13 |
+
<sort_order>100</sort_order>
|
14 |
+
<show_in_default>1</show_in_default>
|
15 |
+
<show_in_website>1</show_in_website>
|
16 |
+
<show_in_store>1</show_in_store>
|
17 |
+
<groups>
|
18 |
+
<currencyconverter translate="label">
|
19 |
+
<label>Currency Converter</label>
|
20 |
+
<frontend_type>text</frontend_type>
|
21 |
+
<sort_order>10</sort_order>
|
22 |
+
<show_in_default>1</show_in_default>
|
23 |
+
<show_in_website>1</show_in_website>
|
24 |
+
<show_in_store>1</show_in_store>
|
25 |
+
<fields>
|
26 |
+
<enabled translate="label">
|
27 |
+
<label>Enable Currency Converter</label>
|
28 |
+
<frontend_type>select</frontend_type>
|
29 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
30 |
+
<sort_order>10</sort_order>
|
31 |
+
<show_in_default>1</show_in_default>
|
32 |
+
<show_in_website>1</show_in_website>
|
33 |
+
<show_in_store>1</show_in_store>
|
34 |
+
</enabled>
|
35 |
+
</fields>
|
36 |
+
</currencyconverter>
|
37 |
+
</groups>
|
38 |
+
</currencyconverter>
|
39 |
+
</sections>
|
40 |
+
</config>
|
app/design/frontend/default/default/layout/currencyconverter.xml
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout version="0.1.0">
|
3 |
+
<default>
|
4 |
+
<reference name="head">
|
5 |
+
<action method="addCss"><stylesheet>css/currencyconverter.css</stylesheet></action>
|
6 |
+
<action method="addItem"><type>skin_js</type><name>js/currencyconverter.js</name></action>
|
7 |
+
</reference>
|
8 |
+
</default>
|
9 |
+
<catalog_category_default>
|
10 |
+
<reference name="left">
|
11 |
+
<block type="currencyconverter/currencyconverter" name="currencyconverter" before="-" template="currencyconverter/currencyconverter.phtml" />
|
12 |
+
</reference>
|
13 |
+
</catalog_category_default>
|
14 |
+
<catalog_category_layered>
|
15 |
+
<reference name="left">
|
16 |
+
<block type="currencyconverter/currencyconverter" name="currencyconverter" before="-" template="currencyconverter/currencyconverter.phtml" />
|
17 |
+
</reference>
|
18 |
+
</catalog_category_layered>
|
19 |
+
</layout>
|
app/design/frontend/default/default/template/currencyconverter/currencyconverter.phtml
ADDED
@@ -0,0 +1,203 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php if(Mage::helper('currencyconverter')->isEnabled()): ?>
|
2 |
+
<div class="block block-converter">
|
3 |
+
<div class="block-title">
|
4 |
+
<strong><span><?php echo $this->__('Currency Converter') ?></span></strong>
|
5 |
+
</div>
|
6 |
+
<div class="block-content">
|
7 |
+
<form action="#" id="converterForm" name="converterForm">
|
8 |
+
<table width="100%">
|
9 |
+
<tbody>
|
10 |
+
<tr>
|
11 |
+
<td>
|
12 |
+
Amount:
|
13 |
+
</td>
|
14 |
+
</tr>
|
15 |
+
<tr>
|
16 |
+
<td>
|
17 |
+
<input type="text" size="10" name="amount" id="amount" class="input-text required-entry" >
|
18 |
+
</td>
|
19 |
+
</tr>
|
20 |
+
<tr>
|
21 |
+
<td>
|
22 |
+
From:
|
23 |
+
</td>
|
24 |
+
</tr>
|
25 |
+
<tr>
|
26 |
+
<td>
|
27 |
+
<script type="text/javascript">
|
28 |
+
function FromOption() {
|
29 |
+
var FromSel = document.getElementById("cur_from");
|
30 |
+
var FromHidden = document.getElementById("fromselected");
|
31 |
+
FromHidden.value = FromSel.options[FromSel.selectedIndex].value;
|
32 |
+
return true;
|
33 |
+
}
|
34 |
+
</script>
|
35 |
+
<select onchange="FromOption();" id="cur_from" name="cur_from">
|
36 |
+
<option value="DZD">Algerian Dinar (DZD)</option>
|
37 |
+
<option value="ARS">Argentine Peso (ARS)</option>
|
38 |
+
<option value="AUD">Australia Dollar (AUD)</option>
|
39 |
+
<option value="BHD">Bahraini Dinar (BHD)</option>
|
40 |
+
<option value="BRL">Brazilian Real (BRL)</option>
|
41 |
+
<option value="GBP">British Pound (GBP)</option>
|
42 |
+
<option value="BGN">Bulgarian Lev (BGN)</option>
|
43 |
+
<option value="CAD">Canadian Dollar (CAD)</option>
|
44 |
+
<option value="CLP">Chilean Peso (CLP)</option>
|
45 |
+
<option value="CNY">Chinese Yuan (CNY)</option>
|
46 |
+
<option value="COP">Colombian Peso (COP)</option>
|
47 |
+
<option value="CRC">Costa Rica Col. (CRC)</option>
|
48 |
+
<option value="HRK">Croatian Kuna (HRK)</option>
|
49 |
+
<option value="CZK">Czech Koruna (CZK)</option>
|
50 |
+
<option value="DKK">Danish Krone (DKK)</option>
|
51 |
+
<option value="DOP">Dominican Peso (DOP)</option>
|
52 |
+
<option value="EGP">Egyptian Pound (EGP)</option>
|
53 |
+
<option value="EEK">Estonian Kroon (EEK)</option>
|
54 |
+
<option selected="selected" value="EUR">Euro (EUR)</option>
|
55 |
+
<option value="FJD">Fiji Dollar (FJD)</option>
|
56 |
+
<option value="HKD">Hong Kong Dollar (HKD)</option>
|
57 |
+
<option value="HUF">Hungarian Forint (HUF)</option>
|
58 |
+
<option value="ISK">Iceland Krona (ISK)</option>
|
59 |
+
<option value="IDR">Indon. Rupiah (IDR)</option>
|
60 |
+
<option value="INR">Indian Rupee (INR)</option>
|
61 |
+
<option value="ILS">Israeli Shekel (ILS)</option>
|
62 |
+
<option value="JMD">Jamaican Dollar (JMD)</option>
|
63 |
+
<option value="JOD">Jordanian Dinar (JOD)</option>
|
64 |
+
<option value="KES">Kenya Shilling (KES)</option>
|
65 |
+
<option value="KRW">Korean Won (KRW)</option>
|
66 |
+
<option value="KWD">Kuwaiti Dinar (KWD)</option>
|
67 |
+
<option value="LBP">Lebanese Pound (LBP)</option>
|
68 |
+
<option value="MYR">Malays. Ringgit (MYR)</option>
|
69 |
+
<option value="MUR">Mauritius Rupee (MUR)</option>
|
70 |
+
<option value="MXN">Mexican Peso (MXN)</option>
|
71 |
+
<option value="MAD">Moroccan Dirham (MAD)</option>
|
72 |
+
<option value="NZD">N.Zealand Dollar (NZD)</option>
|
73 |
+
<option value="NOK">Norwegian Krone (NOK)</option>
|
74 |
+
<option value="OMR">Omani Rial (OMR)</option>
|
75 |
+
<option value="PKR">Pakistani Rupee (PKR)</option>
|
76 |
+
<option value="PEN">Peru. Nuevo Sol (PEN)</option>
|
77 |
+
<option value="PHP">Philippine Peso (PHP)</option>
|
78 |
+
<option value="PLN">Polish Zloty (PLN)</option>
|
79 |
+
<option value="QAR">Qatar Rial (QAR)</option>
|
80 |
+
<option value="RON">Romanian New Leu (RON)</option>
|
81 |
+
<option value="RUB">Russian Rouble (RUB)</option>
|
82 |
+
<option value="SAR">Saudi A. Riyal (SAR)</option>
|
83 |
+
<option value="SGD">Singapore Dollar (SGD)</option>
|
84 |
+
<option value="SKK">Slovak Koruna (SKK)</option>
|
85 |
+
<option value="ZAR">S. African Rand (ZAR)</option>
|
86 |
+
<option value="LKR">Sri Lanka Rupee (LKR)</option>
|
87 |
+
<option value="SEK">Swedish Krona (SEK)</option>
|
88 |
+
<option value="CHF">Swiss Franc (CHF)</option>
|
89 |
+
<option value="TWD">Taiwan Dollar (TWD)</option>
|
90 |
+
<option value="THB">Thai Baht (THB)</option>
|
91 |
+
<option value="TTD">Trin-Tob Dollar (TTD)</option>
|
92 |
+
<option value="TND">Tunisian Dinar (TND)</option>
|
93 |
+
<option value="TRY">New Turkish Lira (TRY)</option>
|
94 |
+
<option value="AED">UAE Dirham (AED)</option>
|
95 |
+
<option value="USD">U.S. Dollar (USD)</option>
|
96 |
+
<option value="VEB">Venez. Bolivar (VEB)</option>
|
97 |
+
<option value="VND">Vietnam Dong (VND)</option>
|
98 |
+
<option value="JPY">Japanese Yen (JPY)</option>
|
99 |
+
<option value="ZMK">Zambian Kwacha (ZMK)</option>
|
100 |
+
</select>
|
101 |
+
<input type="hidden" value="EUR" id="fromselected" name="fromselected">
|
102 |
+
</td>
|
103 |
+
</tr>
|
104 |
+
<tr>
|
105 |
+
<td>
|
106 |
+
To:
|
107 |
+
</td>
|
108 |
+
</tr>
|
109 |
+
<tr>
|
110 |
+
<td>
|
111 |
+
<script type="text/javascript">
|
112 |
+
function ToOption() {
|
113 |
+
var ToSel = document.getElementById("cur_to");
|
114 |
+
var ToHidden = document.getElementById("toselected");
|
115 |
+
ToHidden.value = ToSel.options[ToSel.selectedIndex].value;
|
116 |
+
return true;
|
117 |
+
}
|
118 |
+
</script>
|
119 |
+
<select onchange="ToOption();" id="cur_to" name="cur_to">
|
120 |
+
<option value="DZD">Algerian Dinar (DZD)</option>
|
121 |
+
<option value="ARS">Argentine Peso (ARS)</option>
|
122 |
+
<option value="AUD">Australia Dollar (AUD)</option>
|
123 |
+
<option value="BHD">Bahraini Dinar (BHD)</option>
|
124 |
+
<option value="BRL">Brazilian Real (BRL)</option>
|
125 |
+
<option value="GBP">British Pound (GBP)</option>
|
126 |
+
<option value="BGN">Bulgarian Lev (BGN)</option>
|
127 |
+
<option value="CAD">Canadian Dollar (CAD)</option>
|
128 |
+
<option value="CLP">Chilean Peso (CLP)</option>
|
129 |
+
<option value="CNY">Chinese Yuan (CNY)</option>
|
130 |
+
<option value="COP">Colombian Peso (COP)</option>
|
131 |
+
<option value="CRC">Costa Rica Col. (CRC)</option>
|
132 |
+
<option value="HRK">Croatian Kuna (HRK)</option>
|
133 |
+
<option value="CZK">Czech Koruna (CZK)</option>
|
134 |
+
<option value="DKK">Danish Krone (DKK)</option>
|
135 |
+
<option value="DOP">Dominican Peso (DOP)</option>
|
136 |
+
<option value="EGP">Egyptian Pound (EGP)</option>
|
137 |
+
<option value="EEK">Estonian Kroon (EEK)</option>
|
138 |
+
<option value="EUR">Euro (EUR)</option>
|
139 |
+
<option value="FJD">Fiji Dollar (FJD)</option>
|
140 |
+
<option value="HKD">Hong Kong Dollar (HKD)</option>
|
141 |
+
<option value="HUF">Hungarian Forint (HUF)</option>
|
142 |
+
<option value="ISK">Iceland Krona (ISK)</option>
|
143 |
+
<option value="IDR">Indon. Rupiah (IDR)</option>
|
144 |
+
<option value="INR">Indian Rupee (INR)</option>
|
145 |
+
<option value="ILS">Israeli Shekel (ILS)</option>
|
146 |
+
<option value="JMD">Jamaican Dollar (JMD)</option>
|
147 |
+
<option value="JOD">Jordanian Dinar (JOD)</option>
|
148 |
+
<option value="KES">Kenya Shilling (KES)</option>
|
149 |
+
<option value="KRW">Korean Won (KRW)</option>
|
150 |
+
<option value="KWD">Kuwaiti Dinar (KWD)</option>
|
151 |
+
<option value="LBP">Lebanese Pound (LBP)</option>
|
152 |
+
<option value="MYR">Malays. Ringgit (MYR)</option>
|
153 |
+
<option value="MUR">Mauritius Rupee (MUR)</option>
|
154 |
+
<option value="MXN">Mexican Peso (MXN)</option>
|
155 |
+
<option value="MAD">Moroccan Dirham (MAD)</option>
|
156 |
+
<option value="NZD">N.Zealand Dollar (NZD)</option>
|
157 |
+
<option value="NOK">Norwegian Krone (NOK)</option>
|
158 |
+
<option value="OMR">Omani Rial (OMR)</option>
|
159 |
+
<option value="PKR">Pakistani Rupee (PKR)</option>
|
160 |
+
<option value="PEN">Peru. Nuevo Sol (PEN)</option>
|
161 |
+
<option value="PHP">Philippine Peso (PHP)</option>
|
162 |
+
<option value="PLN">Polish Zloty (PLN)</option>
|
163 |
+
<option value="QAR">Qatar Rial (QAR)</option>
|
164 |
+
<option value="RON">Romanian New Leu (RON)</option>
|
165 |
+
<option value="RUB">Russian Rouble (RUB)</option>
|
166 |
+
<option value="SAR">Saudi A. Riyal (SAR)</option>
|
167 |
+
<option value="SGD">Singapore Dollar (SGD)</option>
|
168 |
+
<option value="SKK">Slovak Koruna (SKK)</option>
|
169 |
+
<option value="ZAR">S. African Rand (ZAR)</option>
|
170 |
+
<option value="LKR">Sri Lanka Rupee (LKR)</option>
|
171 |
+
<option value="SEK">Swedish Krona (SEK)</option>
|
172 |
+
<option value="CHF">Swiss Franc (CHF)</option>
|
173 |
+
<option value="TWD">Taiwan Dollar (TWD)</option>
|
174 |
+
<option value="THB">Thai Baht (THB)</option>
|
175 |
+
<option value="TTD">Trin-Tob Dollar (TTD)</option>
|
176 |
+
<option value="TND">Tunisian Dinar (TND)</option>
|
177 |
+
<option value="TRY">New Turkish Lira (TRY)</option>
|
178 |
+
<option value="AED">UAE Dirham (AED)</option>
|
179 |
+
<option selected="selected" value="USD">U.S. Dollar (USD)</option>
|
180 |
+
<option value="VEB">Venez. Bolivar (VEB)</option>
|
181 |
+
<option value="VND">Vietnam Dong (VND)</option>
|
182 |
+
<option value="JPY">Japanese Yen (JPY)</option>
|
183 |
+
<option value="ZMK">Zambian Kwacha (ZMK)</option>
|
184 |
+
</select>
|
185 |
+
<input type="hidden" value="USD" id="toselected" name="toselected">
|
186 |
+
</td>
|
187 |
+
</tr>
|
188 |
+
<tr>
|
189 |
+
<td> </td>
|
190 |
+
</tr>
|
191 |
+
<tr>
|
192 |
+
<td>
|
193 |
+
<button type="button" onClick="ajaxRequest('<?php echo $this->getUrl('currencyconverter/index/convert'); ?>')" title="<?php echo $this->__('Convert') ?>" class="button"><span><span><?php echo $this->__('Convert') ?></span></span></button>
|
194 |
+
</td>
|
195 |
+
</tr>
|
196 |
+
</tbody>
|
197 |
+
</table>
|
198 |
+
<div class="convert-result" id="result1text"></div>
|
199 |
+
</form>
|
200 |
+
</div>
|
201 |
+
<?php echo Mage::helper('currencyconverter')->converterfooter(); ?>
|
202 |
+
</div>
|
203 |
+
<?php endif; ?>
|
app/etc/modules/Jextn_Currencyconverter.xml
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Jextn_Currencyconverter>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>community</codePool>
|
7 |
+
</Jextn_Currencyconverter>
|
8 |
+
</modules>
|
9 |
+
</config>
|
package.xml
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>Jextn_Currencyconverter</name>
|
4 |
+
<version>1.0.0</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license uri="http://www.opensource.org/licenses/gpl-license.php">GPL</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>Jextn CurrenyConverter Extension</summary>
|
10 |
+
<description>Jextn CurrenyConverter is to allow your users to determine currency conversions from one denomination to another. The extension uses AJAX functionality so the page doesn't have to refresh when fetching the rates or making the calculations.</description>
|
11 |
+
<notes>Release from magento 1.5.x</notes>
|
12 |
+
<authors><author><name>Jextn Themes</name><user>adodistheme</user><email>magento-support@jextn.com</email></author></authors>
|
13 |
+
<date>2011-06-06</date>
|
14 |
+
<time>11:24:14</time>
|
15 |
+
<contents><target name="magecommunity"><dir name="Jextn"><dir name="Currencyconverter"><dir name="Block"><file name="Currencyconverter.php" hash="adbc50eeb32f360633bcac2dc391915f"/></dir><dir name="Helper"><file name="Data.php" hash="8cfd788b72c17751198a57f77bd25c37"/></dir><dir name="controllers"><file name="IndexController.php" hash="747eb9d880f32d2e090856fd8336fa9d"/></dir><dir name="etc"><file name="config.xml" hash="e4ef435a6a4e04f4e5f5008f861e2f00"/><file name="system.xml" hash="5971a352656e9c73627d2d3f86871e1c"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Jextn_Currencyconverter.xml" hash="03c4b61c9a48656b7deda16535dc76a7"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="currencyconverter.xml" hash="4da131e7e5b8eb140af0f48dc67c2bae"/></dir><dir name="template"><dir name="currencyconverter"><file name="currencyconverter.phtml" hash="805c2c2a2b51df1c07c0bb63cf128b4d"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="default"><dir name="default"><dir name="css"><file name="currencyconverter.css" hash="13c15d0462576d7966934e0f1412dc6c"/></dir><dir name="js"><file name="currencyconverter.js" hash="0e9c4dd4d9f28560999232da6b217220"/></dir></dir></dir></dir></target></contents>
|
16 |
+
<compatible/>
|
17 |
+
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
+
</package>
|
skin/frontend/default/default/css/currencyconverter.css
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.block-converter .block-content{ padding:5px; }
|
2 |
+
.block-converter .block-content .convert-result { font-weight:bold; padding-top:5px; }
|
3 |
+
.block-converter .currencyfooter { text-align:center; font-size:11px; }
|
4 |
+
.block-converter .currencyfooter a { color:#2F2F2F; text-decoration:none; }
|
5 |
+
.block-converter button.button span { background: #618499; border-color: #406A83; }
|
skin/frontend/default/default/js/currencyconverter.js
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* ajax.Request */
|
2 |
+
function ajaxRequest(url) {
|
3 |
+
var aj = new Ajax.Request(
|
4 |
+
url, {
|
5 |
+
method:'post',
|
6 |
+
parameters: { amount: $F('amount'),fromselected: $F('fromselected'), toselected: $F('toselected')},
|
7 |
+
onComplete: getResponse
|
8 |
+
}
|
9 |
+
);
|
10 |
+
}
|
11 |
+
/* ajax.Response */
|
12 |
+
function getResponse(oReq) {
|
13 |
+
$('result1text').innerHTML = oReq.responseText;
|
14 |
+
}
|