Version Notes
stable release
Download this release
Release Info
Developer | Jurij |
Extension | ET_CurrencyManager |
Version | 1.0.0 |
Comparing to | |
See all releases |
Code changes from version 0.2.6 to 1.0.0
- app/code/community/ET/CurrencyManager/Block/Adminhtml/Formprice.php +17 -19
- app/code/community/ET/CurrencyManager/Block/Adminhtml/Heading.php +23 -24
- app/code/community/ET/CurrencyManager/Block/Adminhtml/Support.php +122 -0
- app/code/community/ET/CurrencyManager/Block/Adminhtml/Symbolreplace.php +233 -182
- app/code/community/ET/CurrencyManager/Block/Adminhtml/System/Config/Form/Field/Linktooptions.php +29 -0
- app/code/community/ET/CurrencyManager/Block/Js.php +25 -19
- app/code/community/ET/CurrencyManager/Helper/Data.php +234 -158
- app/code/community/ET/CurrencyManager/Model/Currency.php +167 -128
- app/code/community/ET/CurrencyManager/Model/Locale.php +44 -46
- app/code/community/ET/CurrencyManager/Model/Store.php +34 -0
- app/code/community/ET/CurrencyManager/Model/Typeposition.php +34 -35
- app/code/community/ET/CurrencyManager/Model/Typesymboluse.php +36 -37
- app/code/community/ET/CurrencyManager/etc/config.xml +173 -149
- app/code/community/ET/CurrencyManager/etc/system.xml +220 -195
- app/code/community/ET/ET_CurrencyManager_ChangeLog.txt +84 -61
- app/code/community/ET/ET_CurrencyManager_Description.txt +88 -88
- app/code/community/ET/ET_CurrencyManager_LICENSE.txt +60 -48
- app/design/frontend/default/default/layout/et_currencymanager.xml +12 -13
- app/design/frontend/default/default/template/et_currencymanager/js.phtml +22 -23
- app/etc/modules/ET_CurrencyManager.xml +11 -13
- app/locale/ru_RU/ET_Currencymanager.csv +66 -45
- package.xml +11 -11
- skin/frontend/default/default/et_currencymanager/et_currencymanager.js +12 -12
- skin/frontend/default/default/et_currencymanager/et_currencymanager_round.js +164 -89
app/code/community/ET/CurrencyManager/Block/Adminhtml/Formprice.php
CHANGED
@@ -1,10 +1,9 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* ET Web Solutions
|
4 |
-
*
|
5 |
* NOTICE OF LICENSE
|
6 |
*
|
7 |
-
*
|
|
|
8 |
*
|
9 |
* DISCLAIMER
|
10 |
*
|
@@ -13,27 +12,26 @@
|
|
13 |
*
|
14 |
* @category ET
|
15 |
* @package ET_CurrencyManager
|
16 |
-
* @copyright Copyright (c)
|
17 |
* @contacts support@etwebsolutions.com
|
18 |
-
* @license http://
|
19 |
*/
|
20 |
|
21 |
class ET_CurrencyManager_Block_Adminhtml_Formprice extends Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Price
|
22 |
{
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
if (!is_numeric($value))
|
29 |
-
{
|
30 |
-
return null;
|
31 |
-
}
|
32 |
|
33 |
-
|
34 |
-
|
|
|
35 |
|
36 |
-
|
37 |
-
|
|
|
38 |
|
39 |
-
|
|
|
|
1 |
<?php
|
2 |
/**
|
|
|
|
|
3 |
* NOTICE OF LICENSE
|
4 |
*
|
5 |
+
* You may not sell, sub-license, rent or lease
|
6 |
+
* any portion of the Software or Documentation to anyone.
|
7 |
*
|
8 |
* DISCLAIMER
|
9 |
*
|
12 |
*
|
13 |
* @category ET
|
14 |
* @package ET_CurrencyManager
|
15 |
+
* @copyright Copyright (c) 2012 ET Web Solutions (http://etwebsolutions.com)
|
16 |
* @contacts support@etwebsolutions.com
|
17 |
+
* @license http://shop.etwebsolutions.com/etws-license-free-v1/ ETWS Free License (EFL1)
|
18 |
*/
|
19 |
|
20 |
class ET_CurrencyManager_Block_Adminhtml_Formprice extends Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Price
|
21 |
{
|
22 |
+
public function getEscapedValue($index=null)
|
23 |
+
{
|
24 |
+
$options = Mage::helper('currencymanager')->getOptions(array());
|
25 |
+
$value = $this->getValue();
|
|
|
|
|
|
|
|
|
|
|
26 |
|
27 |
+
if (!is_numeric($value)) {
|
28 |
+
return null;
|
29 |
+
}
|
30 |
|
31 |
+
if (isset($options["input_admin"]) && isset($options['precision'])) {
|
32 |
+
return number_format($value, $options['precision'], null, '');
|
33 |
+
}
|
34 |
|
35 |
+
return parent::getEscapedValue($index);
|
36 |
+
}
|
37 |
+
}
|
app/code/community/ET/CurrencyManager/Block/Adminhtml/Heading.php
CHANGED
@@ -1,10 +1,9 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* ET Web Solutions
|
4 |
-
*
|
5 |
* NOTICE OF LICENSE
|
6 |
*
|
7 |
-
*
|
|
|
8 |
*
|
9 |
* DISCLAIMER
|
10 |
*
|
@@ -13,27 +12,27 @@
|
|
13 |
*
|
14 |
* @category ET
|
15 |
* @package ET_CurrencyManager
|
16 |
-
* @copyright Copyright (c)
|
17 |
* @contacts support@etwebsolutions.com
|
18 |
-
* @license http://
|
19 |
*/
|
20 |
|
21 |
-
if (version_compare(Mage::getVersion(), '1.4', '<'))
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
}
|
34 |
-
|
35 |
-
{
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
}
|
1 |
<?php
|
2 |
/**
|
|
|
|
|
3 |
* NOTICE OF LICENSE
|
4 |
*
|
5 |
+
* You may not sell, sub-license, rent or lease
|
6 |
+
* any portion of the Software or Documentation to anyone.
|
7 |
*
|
8 |
* DISCLAIMER
|
9 |
*
|
12 |
*
|
13 |
* @category ET
|
14 |
* @package ET_CurrencyManager
|
15 |
+
* @copyright Copyright (c) 2012 ET Web Solutions (http://etwebsolutions.com)
|
16 |
* @contacts support@etwebsolutions.com
|
17 |
+
* @license http://shop.etwebsolutions.com/etws-license-free-v1/ ETWS Free License (EFL1)
|
18 |
*/
|
19 |
|
20 |
+
if (version_compare(Mage::getVersion(), '1.4', '<')) {
|
21 |
+
class ET_CurrencyManager_Block_Adminhtml_Heading
|
22 |
+
extends Mage_Adminhtml_Block_Abstract
|
23 |
+
implements Varien_Data_Form_Element_Renderer_Interface
|
24 |
+
{
|
25 |
+
|
26 |
+
public function render(Varien_Data_Form_Element_Abstract $element)
|
27 |
+
{
|
28 |
+
return sprintf(
|
29 |
+
'<tr class="system-fieldset-sub-head" id="row_%s"><td colspan="5"><h4 id="%s">%s</h4></td></tr>',
|
30 |
+
$element->getHtmlId(), $element->getHtmlId(), $element->getLabel()
|
31 |
+
);
|
32 |
+
}
|
33 |
+
}
|
34 |
+
} else {
|
35 |
+
class ET_CurrencyManager_Block_Adminhtml_Heading extends Mage_Adminhtml_Block_System_Config_Form_Field_Heading
|
36 |
+
{
|
37 |
+
}
|
38 |
+
}
|
app/code/community/ET/CurrencyManager/Block/Adminhtml/Support.php
ADDED
@@ -0,0 +1,122 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* You may not sell, sub-license, rent or lease
|
6 |
+
* any portion of the Software or Documentation to anyone.
|
7 |
+
*
|
8 |
+
* DISCLAIMER
|
9 |
+
*
|
10 |
+
* Do not edit or add to this file if you wish to upgrade to newer
|
11 |
+
* versions in the future.
|
12 |
+
*
|
13 |
+
* @category ET
|
14 |
+
* @package ET_CurrencyManager
|
15 |
+
* @copyright Copyright (c) 2012 ET Web Solutions (http://etwebsolutions.com)
|
16 |
+
* @contacts support@etwebsolutions.com
|
17 |
+
* @license http://shop.etwebsolutions.com/etws-license-free-v1/ ETWS Free License (EFL1)
|
18 |
+
*/
|
19 |
+
|
20 |
+
class ET_CurrencyManager_Block_Adminhtml_Support
|
21 |
+
extends Mage_Adminhtml_Block_Abstract
|
22 |
+
implements Varien_Data_Form_Element_Renderer_Interface
|
23 |
+
{
|
24 |
+
/**
|
25 |
+
* Support tab
|
26 |
+
* version 1.0.0
|
27 |
+
*/
|
28 |
+
public function render(Varien_Data_Form_Element_Abstract $element)
|
29 |
+
{
|
30 |
+
$helper = Mage::helper('currencymanager');
|
31 |
+
$moduleNameId = 'ET_CurrencyManager';
|
32 |
+
|
33 |
+
$moduleVersion = $this->_getConfigValue($moduleNameId, 'version');
|
34 |
+
$moduleName = $this->_getConfigValue($moduleNameId, 'name');
|
35 |
+
$moduleShortDescription = $this->_getConfigValue($moduleNameId, 'descr');
|
36 |
+
$moduleLicense = $this->_getConfigValue($moduleNameId, 'license');
|
37 |
+
|
38 |
+
$linkParameters = '?module=' . $moduleNameId . '&ver=' . $moduleVersion . '&ref=' . $_SERVER['HTTP_HOST'];
|
39 |
+
$moduleLicenseLink = $this->_getConfigValue($moduleNameId, 'licenselink') . $linkParameters;
|
40 |
+
$moduleSupportLink = $this->_getConfigValue($moduleNameId, 'redminelink') . $linkParameters;
|
41 |
+
$moduleLink = $this->_getConfigValue($moduleNameId, 'permanentlink') . $linkParameters;
|
42 |
+
$servicesLink = $this->_getConfigValue($moduleNameId, 'ourserviceslink') . $linkParameters;
|
43 |
+
|
44 |
+
$html =
|
45 |
+
'<style>
|
46 |
+
.line {border-top: 1px solid #c6c6c6; }
|
47 |
+
.developer-label {color: #000000; font-weight:bold; width: 150px;}
|
48 |
+
.developer-text { padding-bottom: 15px;}
|
49 |
+
.developer {width: 600px; }
|
50 |
+
</style>';
|
51 |
+
|
52 |
+
$html .= '
|
53 |
+
<table cellspacing="0" cellpading="0" class="developer">
|
54 |
+
<tr>
|
55 |
+
<td class="developer-label">' . $helper->__('Extension:') . '</td>
|
56 |
+
<td class="developer-text">' . $helper->__(
|
57 |
+
'<strong>%s</strong> (version %s)',
|
58 |
+
$moduleName,
|
59 |
+
$moduleVersion
|
60 |
+
) . '</td>
|
61 |
+
</tr>
|
62 |
+
<tr>
|
63 |
+
<td class="developer-label">' . $helper->__('License:') . '</td>
|
64 |
+
<td class="developer-text">' . $helper->__(
|
65 |
+
'<a href="%s" target="_blank">%s</a>',
|
66 |
+
$moduleLicenseLink,
|
67 |
+
$moduleLicense
|
68 |
+
) . '</td>
|
69 |
+
</tr>
|
70 |
+
<tr>
|
71 |
+
<td class="developer-label">' . $helper->__('Short Description:') . '</td>
|
72 |
+
<td class="developer-text">' .$moduleShortDescription. '</td>
|
73 |
+
</tr>
|
74 |
+
<tr>
|
75 |
+
<td class="developer-label">' . $helper->__('Documentation:') . '</td>
|
76 |
+
<td class="developer-text">' . $helper->__(
|
77 |
+
'You can see description of extension features and answers to the ' .
|
78 |
+
'frequently asked questions on <a href="%s" target="_balnk">our website</a>.',
|
79 |
+
$moduleLink) . '</td>
|
80 |
+
</tr>
|
81 |
+
<tr>
|
82 |
+
<td class="developer-label line">' . $helper->__('Support:') . '</td>
|
83 |
+
<td class="developer-text line">' . $helper->__(
|
84 |
+
'Extension support is available through <a href="%s" target="_blank">issue tracking system' .
|
85 |
+
'</a>.<br>You can see information freely, but you will have to sign up to open a ticket.<br>' .
|
86 |
+
'<br>Please, report all bugs and feature requests that are connected to this extension.<br>' .
|
87 |
+
'<br>If by some reason you can not submit a question, bug report or feature request to our ' .
|
88 |
+
'ticket system, you can write us an email - support@etwebsolutions.com.',
|
89 |
+
$moduleSupportLink) . '</td>
|
90 |
+
</tr>
|
91 |
+
<tr>
|
92 |
+
<td class="developer-label line">' . $helper->__('Advertisement:') . '</td>
|
93 |
+
<td class="developer-text line">' . $helper->__(
|
94 |
+
'You can hire our team to customize the extension. E-mail us on sales@etwebsolutions.com.<br>' .
|
95 |
+
'<br>You can see a list of provided services on <a href="%s" target="_blank">our website</a>.',
|
96 |
+
$servicesLink) . '</td>
|
97 |
+
</tr>
|
98 |
+
</table>';
|
99 |
+
|
100 |
+
|
101 |
+
return $html;
|
102 |
+
}
|
103 |
+
|
104 |
+
protected function _getConfigValue($module, $config)
|
105 |
+
{
|
106 |
+
$locale = Mage::app()->getLocale()->getLocaleCode();
|
107 |
+
$defaultLocale = 'en_US';
|
108 |
+
$mainConfig = Mage::getConfig();
|
109 |
+
$moduleConfig = $mainConfig->getNode('modules/' . $module . '/' . $config);
|
110 |
+
|
111 |
+
if ((string)$moduleConfig) {
|
112 |
+
return $moduleConfig;
|
113 |
+
}
|
114 |
+
|
115 |
+
if ($moduleConfig->$locale) {
|
116 |
+
return $moduleConfig->$locale;
|
117 |
+
} else {
|
118 |
+
return $moduleConfig->$defaultLocale;
|
119 |
+
}
|
120 |
+
}
|
121 |
+
|
122 |
+
}
|
app/code/community/ET/CurrencyManager/Block/Adminhtml/Symbolreplace.php
CHANGED
@@ -1,183 +1,234 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
*
|
4 |
-
*
|
5 |
-
*
|
6 |
-
*
|
7 |
-
*
|
8 |
-
*
|
9 |
-
*
|
10 |
-
*
|
11 |
-
*
|
12 |
-
*
|
13 |
-
*
|
14 |
-
* @
|
15 |
-
* @
|
16 |
-
* @
|
17 |
-
* @
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
183 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* You may not sell, sub-license, rent or lease
|
6 |
+
* any portion of the Software or Documentation to anyone.
|
7 |
+
*
|
8 |
+
* DISCLAIMER
|
9 |
+
*
|
10 |
+
* Do not edit or add to this file if you wish to upgrade to newer
|
11 |
+
* versions in the future.
|
12 |
+
*
|
13 |
+
* @category ET
|
14 |
+
* @package ET_CurrencyManager
|
15 |
+
* @copyright Copyright (c) 2012 ET Web Solutions (http://etwebsolutions.com)
|
16 |
+
* @contacts support@etwebsolutions.com
|
17 |
+
* @license http://shop.etwebsolutions.com/etws-license-free-v1/ ETWS Free License (EFL1)
|
18 |
+
*/
|
19 |
+
|
20 |
+
class ET_CurrencyManager_Block_Adminhtml_Symbolreplace extends Mage_Adminhtml_Block_System_Config_Form_Field
|
21 |
+
{
|
22 |
+
protected $_addRowButtonHtml = array();
|
23 |
+
protected $_removeRowButtonHtml = array();
|
24 |
+
|
25 |
+
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
|
26 |
+
{
|
27 |
+
$this->setElement($element);
|
28 |
+
|
29 |
+
$html = '<div id="symbolreplace_template" style="display:none">';
|
30 |
+
$html .= $this->_getRowTemplateHtml();
|
31 |
+
$html .= '</div>';
|
32 |
+
|
33 |
+
$html .= '<ul id="symbolreplace_container">';
|
34 |
+
if ($this->_getValue('currency')) {
|
35 |
+
foreach (array_keys($this->_getValue('currency')) as $row) {
|
36 |
+
if ($row) {
|
37 |
+
$html .= $this->_getRowTemplateHtml($row);
|
38 |
+
}
|
39 |
+
}
|
40 |
+
}
|
41 |
+
$html .= '</ul>';
|
42 |
+
$html .= $this->_getAddRowButtonHtml(
|
43 |
+
'symbolreplace_container',
|
44 |
+
'symbolreplace_template', $this->__('Add currency specific options')
|
45 |
+
);
|
46 |
+
|
47 |
+
return $html;
|
48 |
+
}
|
49 |
+
|
50 |
+
protected function _getRowTemplateHtml($row = 0)
|
51 |
+
{
|
52 |
+
$html = '<li><fieldset>';
|
53 |
+
$html .= $this->_getCurrencySelectHtml($row);
|
54 |
+
$html .= $this->_getPrecisionHtml($row);
|
55 |
+
$html .= $this->_getCutZeroHtml($row);
|
56 |
+
$html .= $this->_getSuffixHtml($row);
|
57 |
+
$html .= $this->_getSymbolPositionHtml($row);
|
58 |
+
$html .= $this->_getSymbolUseHtml($row);
|
59 |
+
$html .= $this->_getSymbolReplaceHtml($row);
|
60 |
+
$html .= $this->_getZeroPriceReplaceHtml($row);
|
61 |
+
|
62 |
+
$html .= '<br /> <br />';
|
63 |
+
$html .= $this->_getRemoveRowButtonHtml();
|
64 |
+
$html .= '</fieldset></li>';
|
65 |
+
|
66 |
+
return $html;
|
67 |
+
}
|
68 |
+
|
69 |
+
protected function _getZeroPriceReplaceHtml($row)
|
70 |
+
{
|
71 |
+
$html = '<label>' . $this->__('Replace Zero Price to:') . ' </label> ';
|
72 |
+
$html .= '<input class="input-text" name="' . $this->getElement()->getName() . '[zerotext][]" value="'
|
73 |
+
. $this->_getValue('zerotext/' . $row) . '" ' . $this->_getDisabled() . '/> ';
|
74 |
+
$html .= '<p class="nm"><small>' . $this->__('Leave empty for disable replace') . '</small></p>';
|
75 |
+
return $html;
|
76 |
+
}
|
77 |
+
|
78 |
+
protected function _getSymbolReplaceHtml($row)
|
79 |
+
{
|
80 |
+
$html = '<label>' . $this->__('Replace symbol to:') . ' </label> ';
|
81 |
+
$html .= '<input class="input-text" name="' . $this->getElement()->getName() . '[symbol][]" value="'
|
82 |
+
. $this->_getValue('symbol/' . $row) . '" ' . $this->_getDisabled() . '/> ';
|
83 |
+
$html .= '<p class="nm"><small>' . $this->__('Leave empty for disable replace') . '</small></p>';
|
84 |
+
return $html;
|
85 |
+
}
|
86 |
+
|
87 |
+
protected function _getSymbolUseHtml($row)
|
88 |
+
{
|
89 |
+
$html = '<label>' . $this->__('Currency symbol use:') . ' </label> ';
|
90 |
+
$html .= '<select class="input-text" name="' . $this->getElement()->getName() . '[display][]">';
|
91 |
+
foreach (Mage::getModel("currencymanager/typesymboluse")->toOptionArray() as $labelValue) {
|
92 |
+
$html .= '<option value="' . $labelValue["value"] . '" '
|
93 |
+
. ($this->_getValue('display/' . $row) == $labelValue["value"] ? 'selected="selected"' : '') . '>'
|
94 |
+
. $labelValue["label"] . "</option>";
|
95 |
+
}
|
96 |
+
$html .= '</select>';
|
97 |
+
return $html;
|
98 |
+
}
|
99 |
+
|
100 |
+
protected function _getSymbolPositionHtml($row)
|
101 |
+
{
|
102 |
+
$html = '<label>' . $this->__('Symbol position:') . ' </label> ';
|
103 |
+
$html .= '<select class="input-text" name="' . $this->getElement()->getName() . '[position][]">';
|
104 |
+
foreach (Mage::getModel("currencymanager/typeposition")->toOptionArray() as $labelValue) {
|
105 |
+
$html .= '<option value="' . $labelValue["value"] . '" '
|
106 |
+
. ($this->_getValue('position/' . $row) == $labelValue["value"] ? 'selected="selected"' : '') . '>'
|
107 |
+
. $labelValue["label"] . "</option>";
|
108 |
+
}
|
109 |
+
$html .= '</select>';
|
110 |
+
return $html;
|
111 |
+
}
|
112 |
+
|
113 |
+
protected function _getSuffixHtml($row)
|
114 |
+
{
|
115 |
+
$html = '<label>' . $this->__('Suffix:') . ' </label> ';
|
116 |
+
$html .= '<input class="input-text" name="' . $this->getElement()->getName()
|
117 |
+
. '[cutzerodecimal_suffix][]" value="' . $this->_getValue('cutzerodecimal_suffix/' . $row)
|
118 |
+
. '" ' . $this->_getDisabled() . '/> ';
|
119 |
+
$html .= '<p class="nm"><small>' . $this->__('Leave empty for global value use') . '</small></p>';
|
120 |
+
return $html;
|
121 |
+
}
|
122 |
+
|
123 |
+
protected function _getCutZeroHtml($row)
|
124 |
+
{
|
125 |
+
$html = '<label>' . $this->__('Cut Zero Decimals:') . ' </label> ';
|
126 |
+
$html .= '<select class="input-text" name="' . $this->getElement()->getName() . '[cutzerodecimal][]">';
|
127 |
+
foreach (Mage::getModel("adminhtml/system_config_source_yesno")->toOptionArray() as $labelValue) {
|
128 |
+
$html .= '<option value="' . $labelValue["value"] . '" '
|
129 |
+
. ($this->_getValue('cutzerodecimal/' . $row) == $labelValue["value"] ? 'selected="selected"' : '')
|
130 |
+
. '>' . $labelValue["label"] . "</option>";
|
131 |
+
}
|
132 |
+
$html .= '</select>';
|
133 |
+
return $html;
|
134 |
+
}
|
135 |
+
|
136 |
+
protected function _getPrecisionHtml($row)
|
137 |
+
{
|
138 |
+
$html = '<label>' . $this->__('Precision:') . ' </label> ';
|
139 |
+
$html .= '<input class="input-text" name="' . $this->getElement()->getName() . '[precision][]" value="'
|
140 |
+
. $this->_getValue('precision/' . $row) . '" ' . $this->_getDisabled() . '/> ';
|
141 |
+
$html .= '<p class="nm"><small>' . $this->__('Leave empty for global value use') . '</small></p>';
|
142 |
+
return $html;
|
143 |
+
}
|
144 |
+
|
145 |
+
protected function _getCurrencySelectHtml($row)
|
146 |
+
{
|
147 |
+
$html = '<label>' . $this->__('Select currency:') . ' </label> ';
|
148 |
+
|
149 |
+
$html .= '<select name="' . $this->getElement()->getName() . '[currency][]" ' . $this->_getDisabled() . '>';
|
150 |
+
|
151 |
+
$html .= '<option value="">' . $this->__('* Select currency') . '</option>';
|
152 |
+
foreach ($this->getAllowedCurrencies() as $currencyCode => $currency) {
|
153 |
+
$html .= '<option value="' . $currencyCode . '" ' . $this->_getSelected('currency/' . $row, $currencyCode)
|
154 |
+
. ' style="background:white;">' . $currency . " - " . $currencyCode . '</option>';
|
155 |
+
}
|
156 |
+
$html .= '</select>';
|
157 |
+
return $html;
|
158 |
+
}
|
159 |
+
|
160 |
+
protected function getAllowedCurrencies()
|
161 |
+
{
|
162 |
+
|
163 |
+
if (!$this->hasData('allowed_currencies')) {
|
164 |
+
$currencies = Mage::app()->getLocale()->getOptionCurrencies();
|
165 |
+
$allowedCurrencyCodes = Mage::getSingleton('directory/currency')->getConfigAllowCurrencies();
|
166 |
+
|
167 |
+
$formattedCurrencies = array();
|
168 |
+
foreach ($currencies as $currency) {
|
169 |
+
$formattedCurrencies[$currency['value']]['label'] = $currency['label'];
|
170 |
+
}
|
171 |
+
|
172 |
+
$allowedCurrencies = array();
|
173 |
+
foreach ($allowedCurrencyCodes as $currencyCode) {
|
174 |
+
$allowedCurrencies[$currencyCode] = $formattedCurrencies[$currencyCode]['label'];
|
175 |
+
}
|
176 |
+
|
177 |
+
$this->setData('allowed_currencies', $allowedCurrencies);
|
178 |
+
}
|
179 |
+
return $this->getData('allowed_currencies');
|
180 |
+
}
|
181 |
+
|
182 |
+
protected function _getDisabled()
|
183 |
+
{
|
184 |
+
return $this->getElement()->getDisabled() ? ' disabled' : '';
|
185 |
+
}
|
186 |
+
|
187 |
+
protected function _getValue($key)
|
188 |
+
{
|
189 |
+
$value = $this->getElement()->getData('value/' . $key);
|
190 |
+
if (is_null($value) && $key != 'currency') {
|
191 |
+
$key = explode("/", $key);
|
192 |
+
$key = array_shift($key);
|
193 |
+
//$value = Mage::app()->getConfig()->getNode('default/currencymanager/general/symbolreplace/'.$key);
|
194 |
+
$value = Mage::app()->getConfig()->getNode('default/currencymanager/general/'.$key);
|
195 |
+
return (string)$value;
|
196 |
+
}
|
197 |
+
return $value;
|
198 |
+
}
|
199 |
+
|
200 |
+
protected function _getSelected($key, $value)
|
201 |
+
{
|
202 |
+
return $this->getElement()->getData('value/' . $key) == $value ? 'selected="selected"' : '';
|
203 |
+
}
|
204 |
+
|
205 |
+
protected function _getAddRowButtonHtml($container, $template, $title = 'Add')
|
206 |
+
{
|
207 |
+
if (!isset($this->_addRowButtonHtml[$container])) {
|
208 |
+
$this->_addRowButtonHtml[$container] = $this->getLayout()->createBlock('adminhtml/widget_button')
|
209 |
+
->setType('button')
|
210 |
+
->setClass('add ' . $this->_getDisabled())
|
211 |
+
->setLabel($this->__($title))
|
212 |
+
//$this->__('Add')
|
213 |
+
->setOnClick("Element.insert($('" . $container . "'), {bottom: $('" . $template . "').innerHTML})")
|
214 |
+
->setDisabled($this->_getDisabled())
|
215 |
+
->toHtml();
|
216 |
+
}
|
217 |
+
return $this->_addRowButtonHtml[$container];
|
218 |
+
}
|
219 |
+
|
220 |
+
protected function _getRemoveRowButtonHtml($selector = 'li', $title = 'Remove')
|
221 |
+
{
|
222 |
+
if (!$this->_removeRowButtonHtml) {
|
223 |
+
$this->_removeRowButtonHtml = $this->getLayout()->createBlock('adminhtml/widget_button')
|
224 |
+
->setType('button')
|
225 |
+
->setClass('delete v-middle ' . $this->_getDisabled())
|
226 |
+
->setLabel($this->__($title))
|
227 |
+
//$this->__('Remove')
|
228 |
+
->setOnClick("Element.remove($(this).up('" . $selector . "'))")
|
229 |
+
->setDisabled($this->_getDisabled())
|
230 |
+
->toHtml();
|
231 |
+
}
|
232 |
+
return $this->_removeRowButtonHtml;
|
233 |
+
}
|
234 |
}
|
app/code/community/ET/CurrencyManager/Block/Adminhtml/System/Config/Form/Field/Linktooptions.php
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* You may not sell, sub-license, rent or lease
|
6 |
+
* any portion of the Software or Documentation to anyone.
|
7 |
+
*
|
8 |
+
* DISCLAIMER
|
9 |
+
*
|
10 |
+
* Do not edit or add to this file if you wish to upgrade to newer
|
11 |
+
* versions in the future.
|
12 |
+
*
|
13 |
+
* @category ET
|
14 |
+
* @package ET_CurrencyManager
|
15 |
+
* @copyright Copyright (c) 2012 ET Web Solutions (http://etwebsolutions.com)
|
16 |
+
* @contacts support@etwebsolutions.com
|
17 |
+
* @license http://shop.etwebsolutions.com/etws-license-free-v1/ ETWS Free License (EFL1)
|
18 |
+
*/
|
19 |
+
|
20 |
+
class ET_CurrencyManager_Block_Adminhtml_System_Config_Form_Field_Linktooptions
|
21 |
+
extends Mage_Adminhtml_Block_System_Config_Form_Field
|
22 |
+
{
|
23 |
+
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
|
24 |
+
{
|
25 |
+
return '<a href="' . $this->getUrl('*/system_config/edit', array('section' => 'currencymanager')) . '">' .
|
26 |
+
Mage::helper('currencymanager')->__('Click here to configure currency additional display options') .
|
27 |
+
'</a>';
|
28 |
+
}
|
29 |
+
}
|
app/code/community/ET/CurrencyManager/Block/Js.php
CHANGED
@@ -1,10 +1,9 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* ET Web Solutions
|
4 |
-
*
|
5 |
* NOTICE OF LICENSE
|
6 |
*
|
7 |
-
*
|
|
|
8 |
*
|
9 |
* DISCLAIMER
|
10 |
*
|
@@ -13,24 +12,31 @@
|
|
13 |
*
|
14 |
* @category ET
|
15 |
* @package ET_CurrencyManager
|
16 |
-
* @copyright Copyright (c)
|
17 |
* @contacts support@etwebsolutions.com
|
18 |
-
* @license http://
|
19 |
*/
|
20 |
|
21 |
class ET_CurrencyManager_Block_Js extends Mage_Core_Block_Template
|
22 |
{
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<?php
|
2 |
/**
|
|
|
|
|
3 |
* NOTICE OF LICENSE
|
4 |
*
|
5 |
+
* You may not sell, sub-license, rent or lease
|
6 |
+
* any portion of the Software or Documentation to anyone.
|
7 |
*
|
8 |
* DISCLAIMER
|
9 |
*
|
12 |
*
|
13 |
* @category ET
|
14 |
* @package ET_CurrencyManager
|
15 |
+
* @copyright Copyright (c) 2012 ET Web Solutions (http://etwebsolutions.com)
|
16 |
* @contacts support@etwebsolutions.com
|
17 |
+
* @license http://shop.etwebsolutions.com/etws-license-free-v1/ ETWS Free License (EFL1)
|
18 |
*/
|
19 |
|
20 |
class ET_CurrencyManager_Block_Js extends Mage_Core_Block_Template
|
21 |
{
|
22 |
+
public function getJsonConfig()
|
23 |
+
{
|
24 |
+
if (method_exists(Mage::helper('core'), 'jsonEncode')) {
|
25 |
+
return Mage::helper('core')->jsonEncode(
|
26 |
+
Mage::helper('currencymanager')->getOptions(
|
27 |
+
array(),
|
28 |
+
false,
|
29 |
+
Mage::app()->getStore()->getCurrentCurrencyCode()
|
30 |
+
)
|
31 |
+
);
|
32 |
+
} else {
|
33 |
+
return Zend_Json::encode(
|
34 |
+
Mage::helper('currencymanager')->getOptions(
|
35 |
+
array(),
|
36 |
+
false,
|
37 |
+
Mage::app()->getStore()->getCurrentCurrencyCode()
|
38 |
+
)
|
39 |
+
);
|
40 |
+
}
|
41 |
+
}
|
42 |
+
}
|
app/code/community/ET/CurrencyManager/Helper/Data.php
CHANGED
@@ -1,10 +1,9 @@
|
|
1 |
-
<?php
|
2 |
/**
|
3 |
-
* ET Web Solutions
|
4 |
-
*
|
5 |
* NOTICE OF LICENSE
|
6 |
*
|
7 |
-
*
|
|
|
8 |
*
|
9 |
* DISCLAIMER
|
10 |
*
|
@@ -13,162 +12,239 @@
|
|
13 |
*
|
14 |
* @category ET
|
15 |
* @package ET_CurrencyManager
|
16 |
-
* @copyright Copyright (c)
|
17 |
* @contacts support@etwebsolutions.com
|
18 |
-
* @license http://
|
19 |
*/
|
20 |
|
21 |
class ET_CurrencyManager_Helper_Data extends Mage_Core_Helper_Abstract
|
22 |
{
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
/**
|
|
|
|
|
3 |
* NOTICE OF LICENSE
|
4 |
*
|
5 |
+
* You may not sell, sub-license, rent or lease
|
6 |
+
* any portion of the Software or Documentation to anyone.
|
7 |
*
|
8 |
* DISCLAIMER
|
9 |
*
|
12 |
*
|
13 |
* @category ET
|
14 |
* @package ET_CurrencyManager
|
15 |
+
* @copyright Copyright (c) 2012 ET Web Solutions (http://etwebsolutions.com)
|
16 |
* @contacts support@etwebsolutions.com
|
17 |
+
* @license http://shop.etwebsolutions.com/etws-license-free-v1/ ETWS Free License (EFL1)
|
18 |
*/
|
19 |
|
20 |
class ET_CurrencyManager_Helper_Data extends Mage_Core_Helper_Abstract
|
21 |
{
|
22 |
+
/**
|
23 |
+
* ZEND constants avalable in /lib/Zend/Currency.php
|
24 |
+
*
|
25 |
+
* NOTICE
|
26 |
+
*
|
27 |
+
* Magento ver 1.3.x - display - USE_SHORTNAME(3) by default
|
28 |
+
* Magento ver 1.4.x - display - USE_SYMBOL(2) by default
|
29 |
+
*
|
30 |
+
* position: 8 - standart; 16 - right; 32 - left
|
31 |
+
*
|
32 |
+
*/
|
33 |
+
|
34 |
+
protected $_options = array();
|
35 |
+
protected $_optionsadvanced = array();
|
36 |
+
|
37 |
+
public function getOptions($options = array(), $old = false, $currency = "default") //$old for support Magento 1.3.x
|
38 |
+
{
|
39 |
+
$storeId = Mage::app()->getStore()->getStoreId();
|
40 |
+
if ((!isset($this->_options[$storeId][$currency])) || (!isset($this->_optionsadvanced[$storeId][$currency]))) {
|
41 |
+
$this->setOptions($currency);
|
42 |
+
}
|
43 |
+
$newOptions = $this->_options[$storeId][$currency];
|
44 |
+
$newOptionsAdvanced = $this->_optionsadvanced[$storeId][$currency];
|
45 |
+
|
46 |
+
if (!$old) {
|
47 |
+
$newOptions = $newOptions + $newOptionsAdvanced;
|
48 |
+
}
|
49 |
+
|
50 |
+
// For JavaScript prices: Strange Symbol extracting in function getOutputFormat
|
51 |
+
// in file app/code/core/Mage/Directory/Model/Currency.php
|
52 |
+
// For Configurable, Bundle and Simple with custom options
|
53 |
+
// This causes problem if any currency has by default NO_SYMBOL
|
54 |
+
// with this module can't change display value in this case
|
55 |
+
if (isset($options["display"])) {
|
56 |
+
if ($options["display"] == Zend_Currency::NO_SYMBOL) {
|
57 |
+
unset($newOptions["display"]);
|
58 |
+
}
|
59 |
+
}
|
60 |
+
|
61 |
+
if (count($options) > 0) {
|
62 |
+
return $newOptions + $options;
|
63 |
+
} else {
|
64 |
+
return $newOptions;
|
65 |
+
}
|
66 |
+
}
|
67 |
+
|
68 |
+
public function clearOptions($options)
|
69 |
+
{
|
70 |
+
$oldOptions = array("position", "format", "display", "precision", "script", "name", "currency", "symbol");
|
71 |
+
foreach (array_keys($options) as $optionKey) {
|
72 |
+
if (!in_array($optionKey, $oldOptions)) {
|
73 |
+
unset($options[$optionKey]);
|
74 |
+
}
|
75 |
+
}
|
76 |
+
return $options;
|
77 |
+
}
|
78 |
+
|
79 |
+
|
80 |
+
public function isEnabled()
|
81 |
+
{
|
82 |
+
$config = Mage::getStoreConfig('currencymanager/general');
|
83 |
+
$storeId = Mage::app()->getStore()->getStoreId();
|
84 |
+
return ((($config['enabled']) && ($storeId > 0)) || (($config['enabledadm']) && ($storeId == 0)));
|
85 |
+
}
|
86 |
+
|
87 |
+
|
88 |
+
public function setOptions($currency = "default")
|
89 |
+
{
|
90 |
+
$config = Mage::getStoreConfig('currencymanager/general');
|
91 |
+
|
92 |
+
$moduleName = Mage::app()->getRequest()->getModuleName();
|
93 |
+
$options = array();
|
94 |
+
$optionsAdvanced = array();
|
95 |
+
$storeId = Mage::app()->getStore()->getStoreId();
|
96 |
+
if ($this->isEnabled()) {
|
97 |
+
$notCheckout = !($config['excludecheckout'] & $this->isInOrder());
|
98 |
+
$this->_getGeneralOptions($config, $options, $optionsAdvanced, $notCheckout);
|
99 |
+
|
100 |
+
// formatting symbols from admin, preparing to use. Maybe can do better :)
|
101 |
+
// если в админке будут внесены
|
102 |
+
// несколько значений для одной валюты,
|
103 |
+
// то использоваться будет только одна
|
104 |
+
if (isset($config['symbolreplace'])) {
|
105 |
+
$this->_collectCurrencyOptions($config, $currency, $notCheckout, $options, $optionsAdvanced);
|
106 |
+
}
|
107 |
+
} // end NOT ENABLED
|
108 |
+
|
109 |
+
$this->_options[$storeId][$currency] = $options;
|
110 |
+
$this->_optionsadvanced[$storeId][$currency] = $optionsAdvanced;
|
111 |
+
if (!isset($this->_options[$storeId]["default"])) {
|
112 |
+
$this->_options[$storeId]["default"] = $options;
|
113 |
+
$this->_optionsadvanced[$storeId]["default"] = $optionsAdvanced;
|
114 |
+
}
|
115 |
+
|
116 |
+
return $this;
|
117 |
+
}
|
118 |
+
|
119 |
+
protected function _getGeneralOptions($config, &$options, &$optionsAdvanced, $notCheckout)
|
120 |
+
{
|
121 |
+
if ($notCheckout) {
|
122 |
+
if (isset($config['precision'])) { // precision must be in range -1 .. 30
|
123 |
+
$options['precision'] = min(30, max(-1, (int)$config['precision']));
|
124 |
+
}
|
125 |
+
}
|
126 |
+
|
127 |
+
if (isset($config['position'])) {
|
128 |
+
$options['position'] = (int)$config['position'];
|
129 |
+
}
|
130 |
+
if (isset($config['display'])) {
|
131 |
+
$options['display'] = (int)$config['display'];
|
132 |
+
}
|
133 |
+
|
134 |
+
if (isset($config['input_admin'])) {
|
135 |
+
$optionsAdvanced['input_admin'] = (int)$config['input_admin'];
|
136 |
+
}
|
137 |
+
|
138 |
+
$optionsAdvanced['excludecheckout'] = $config['excludecheckout'];
|
139 |
+
$optionsAdvanced['cutzerodecimal'] = $config['cutzerodecimal'];
|
140 |
+
$optionsAdvanced['cutzerodecimal_suffix'] = isset($config['cutzerodecimal_suffix']) ?
|
141 |
+
$config['cutzerodecimal_suffix'] : "";
|
142 |
+
}
|
143 |
+
|
144 |
+
protected function _collectCurrencyOptions($config, $currency, $notCheckout, &$options, &$optionsAdvanced)
|
145 |
+
{
|
146 |
+
$symbolReplace = $this->_unsetSymbolReplace($config);
|
147 |
+
|
148 |
+
if (count($symbolReplace['currency']) > 0) {
|
149 |
+
$tmpOptions = array();
|
150 |
+
$tmpOptionsAdvanced = array();
|
151 |
+
|
152 |
+
$tmpOptionsAdvanced['cutzerodecimal'] = $this->_getCurrencyOption(
|
153 |
+
$currency, $symbolReplace, 'cutzerodecimal', false, true
|
154 |
+
);
|
155 |
+
|
156 |
+
if (isset($symbolReplace['cutzerodecimal_suffix'])) {
|
157 |
+
$tmpOptionsAdvanced["cutzerodecimal_suffix"] = $this->_getCurrencyOption(
|
158 |
+
$currency, $symbolReplace, 'cutzerodecimal_suffix'
|
159 |
+
);
|
160 |
+
}
|
161 |
+
|
162 |
+
$tmpOptions['position'] = $this->_getCurrencyOption($currency, $symbolReplace, 'position', false, true);
|
163 |
+
$tmpOptions['display'] = $this->_getCurrencyOption($currency, $symbolReplace, 'display', false, true);
|
164 |
+
$tmpOptions['symbol'] = $this->_getCurrencyOption($currency, $symbolReplace, 'symbol');
|
165 |
+
|
166 |
+
if ($notCheckout) {
|
167 |
+
$tmpOptionsAdvanced['zerotext'] = $this->_getCurrencyOption(
|
168 |
+
$currency, $symbolReplace, 'zerotext'
|
169 |
+
);
|
170 |
+
|
171 |
+
$precision = $this->_getCurrencyOption($currency, $symbolReplace, 'precision', false, true);
|
172 |
+
if ($precision !== false) {
|
173 |
+
$tmpOptions['precision'] = min(30, max(-1, $precision));
|
174 |
+
}
|
175 |
+
}
|
176 |
+
|
177 |
+
foreach ($tmpOptions as $option => $value) {
|
178 |
+
if ($value !== false) {
|
179 |
+
$options[$option] = $value;
|
180 |
+
}
|
181 |
+
}
|
182 |
+
|
183 |
+
foreach ($tmpOptionsAdvanced as $option => $value) {
|
184 |
+
if ($value !== false) {
|
185 |
+
$optionsAdvanced[$option] = $value;
|
186 |
+
}
|
187 |
+
}
|
188 |
+
|
189 |
+
}
|
190 |
+
}
|
191 |
+
|
192 |
+
/**
|
193 |
+
* To check where price is used
|
194 |
+
* in some cases default values for precision and zerotext should be used
|
195 |
+
* for sales/checkout in frontend
|
196 |
+
* for admin AND sales_order*
|
197 |
+
*
|
198 |
+
* @return bool
|
199 |
+
*/
|
200 |
+
public function isInOrder()
|
201 |
+
{
|
202 |
+
$moduleName = Mage::app()->getRequest()->getModuleName();
|
203 |
+
$controllerName = Mage::app()->getRequest()->getControllerName();
|
204 |
+
|
205 |
+
return (($moduleName == 'checkout')
|
206 |
+
|| ($moduleName == 'sales')
|
207 |
+
|| (
|
208 |
+
($moduleName == 'admin') && (strpos($controllerName, 'sales_order') !== false)
|
209 |
+
));
|
210 |
+
}
|
211 |
+
|
212 |
+
protected function _unsetSymbolReplace($config)
|
213 |
+
{
|
214 |
+
if (!is_array($config['symbolreplace'])) {
|
215 |
+
$symbolReplace = unserialize($config['symbolreplace']);
|
216 |
+
foreach (array_keys($symbolReplace['currency']) as $symbolReplaceKey) {
|
217 |
+
if (strlen(trim($symbolReplace['currency'][$symbolReplaceKey])) == 0) {
|
218 |
+
unset($symbolReplace['currency'][$symbolReplaceKey]);
|
219 |
+
unset($symbolReplace['precision'][$symbolReplaceKey]);
|
220 |
+
unset($symbolReplace['cutzerodecimal'][$symbolReplaceKey]);
|
221 |
+
unset($symbolReplace['cutzerodecimal_suffix'][$symbolReplaceKey]);
|
222 |
+
unset($symbolReplace['position'][$symbolReplaceKey]);
|
223 |
+
unset($symbolReplace['display'][$symbolReplaceKey]);
|
224 |
+
unset($symbolReplace['symbol'][$symbolReplaceKey]);
|
225 |
+
unset($symbolReplace['zerotext'][$symbolReplaceKey]);
|
226 |
+
}
|
227 |
+
}
|
228 |
+
return $symbolReplace;
|
229 |
+
}
|
230 |
+
return false;
|
231 |
+
}
|
232 |
+
|
233 |
+
public function resetOptions()
|
234 |
+
{
|
235 |
+
$this->_options = array();
|
236 |
+
$this->_optionsadvanced = array();
|
237 |
+
}
|
238 |
+
|
239 |
+
protected function _getCurrencyOption($currency, $symbolReplace, $option, $checkEmpty = true, $int = false)
|
240 |
+
{
|
241 |
+
$configSubData = array_combine($symbolReplace['currency'], $symbolReplace[$option]);
|
242 |
+
if (array_key_exists($currency, $configSubData)) {
|
243 |
+
if (!$checkEmpty || $configSubData[$currency] != "") {
|
244 |
+
return ($int) ? (int)$configSubData[$currency] : $configSubData[$currency];
|
245 |
+
}
|
246 |
+
}
|
247 |
+
return false;
|
248 |
+
}
|
249 |
+
|
250 |
+
}
|
app/code/community/ET/CurrencyManager/Model/Currency.php
CHANGED
@@ -1,128 +1,167 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
*
|
4 |
-
*
|
5 |
-
*
|
6 |
-
*
|
7 |
-
*
|
8 |
-
*
|
9 |
-
*
|
10 |
-
*
|
11 |
-
*
|
12 |
-
*
|
13 |
-
*
|
14 |
-
* @
|
15 |
-
* @
|
16 |
-
* @
|
17 |
-
* @
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
}
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* You may not sell, sub-license, rent or lease
|
6 |
+
* any portion of the Software or Documentation to anyone.
|
7 |
+
*
|
8 |
+
* DISCLAIMER
|
9 |
+
*
|
10 |
+
* Do not edit or add to this file if you wish to upgrade to newer
|
11 |
+
* versions in the future.
|
12 |
+
*
|
13 |
+
* @category ET
|
14 |
+
* @package ET_CurrencyManager
|
15 |
+
* @copyright Copyright (c) 2012 ET Web Solutions (http://etwebsolutions.com)
|
16 |
+
* @contacts support@etwebsolutions.com
|
17 |
+
* @license http://shop.etwebsolutions.com/etws-license-free-v1/ ETWS Free License (EFL1)
|
18 |
+
*/
|
19 |
+
|
20 |
+
class ET_CurrencyManager_Model_Currency extends Mage_Directory_Model_Currency
|
21 |
+
{
|
22 |
+
|
23 |
+
public function format($price, $options = array(), $includeContainer = true, $addBrackets = false)
|
24 |
+
{
|
25 |
+
if (method_exists($this, "formatPrecision")) {
|
26 |
+
$options = Mage::helper('currencymanager')->getOptions(array());
|
27 |
+
|
28 |
+
return $this->formatPrecision(
|
29 |
+
$price,
|
30 |
+
isset($options["precision"]) ? $options["precision"] : 2,
|
31 |
+
Mage::helper('currencymanager')->clearOptions($options),
|
32 |
+
$includeContainer,
|
33 |
+
$addBrackets
|
34 |
+
);
|
35 |
+
}
|
36 |
+
return parent::format($price, $options, $includeContainer, $addBrackets);
|
37 |
+
}
|
38 |
+
|
39 |
+
public function getOutputFormat()
|
40 |
+
{
|
41 |
+
$formatted = $this->formatTxt(10);
|
42 |
+
$number = $this->formatTxt(10, array('display' => Zend_Currency::NO_SYMBOL));
|
43 |
+
return str_replace($number, '%s', $formatted);
|
44 |
+
}
|
45 |
+
|
46 |
+
public function formatTxt($price, $options = array())
|
47 |
+
{
|
48 |
+
/* @var $helper ET_CurrencyManager_Helper_Data */
|
49 |
+
$helper = Mage::helper('currencymanager');
|
50 |
+
|
51 |
+
$answer = parent::formatTxt($price, $helper->clearOptions($options));
|
52 |
+
|
53 |
+
if ($helper->isEnabled()) {
|
54 |
+
$moduleName = Mage::app()->getRequest()->getModuleName();
|
55 |
+
|
56 |
+
$optionsAdvanced = $helper->getOptions($options, false, $this->getCurrencyCode());
|
57 |
+
$options = $helper->getOptions($options, true, $this->getCurrencyCode());
|
58 |
+
|
59 |
+
$answer = parent::formatTxt($price, $options);
|
60 |
+
|
61 |
+
if (count($options) > 0) {
|
62 |
+
if (($moduleName == 'admin')) {
|
63 |
+
$answer = parent::formatTxt($price, $helper->clearOptions($options));
|
64 |
+
}
|
65 |
+
|
66 |
+
//check against -0
|
67 |
+
$answer = $this->_formatWithPrecision($options, $optionsAdvanced, $price, $answer);
|
68 |
+
|
69 |
+
if (!($helper->isInOrder() & $optionsAdvanced['excludecheckout'])) {
|
70 |
+
if ($price == 0) {
|
71 |
+
if (isset($optionsAdvanced['zerotext']) && $optionsAdvanced['zerotext'] != "") {
|
72 |
+
return $optionsAdvanced['zerotext'];
|
73 |
+
}
|
74 |
+
}
|
75 |
+
|
76 |
+
$answer = $this->_cutZeroDecimal($options, $optionsAdvanced, $price, $answer);
|
77 |
+
}
|
78 |
+
}
|
79 |
+
}
|
80 |
+
return $answer;
|
81 |
+
}
|
82 |
+
|
83 |
+
protected function _formatWithPrecision($options, $optionsAdvanced, &$price, $answer)
|
84 |
+
{
|
85 |
+
$helper = Mage::helper('currencymanager');
|
86 |
+
if (isset($optionsAdvanced['precision'])) {
|
87 |
+
$price = round($price, $optionsAdvanced['precision']);
|
88 |
+
if ($optionsAdvanced['precision'] < 0) {
|
89 |
+
$options['precision'] = 0;
|
90 |
+
}
|
91 |
+
|
92 |
+
//for correction -0 float zero
|
93 |
+
if ($price == 0) {
|
94 |
+
$price = 0;
|
95 |
+
}
|
96 |
+
//if no need to cut zero we must recreate default answer
|
97 |
+
return parent::formatTxt($price, $helper->clearOptions($options));
|
98 |
+
}
|
99 |
+
return $answer;
|
100 |
+
}
|
101 |
+
|
102 |
+
protected function _cutZeroDecimal($options, $optionsAdvanced, $price, $answer)
|
103 |
+
{
|
104 |
+
$helper = Mage::helper('currencymanager');
|
105 |
+
$zeroDecimal = (round($price, $optionsAdvanced['precision']) == round($price, 0));
|
106 |
+
$suffix = isset($optionsAdvanced['cutzerodecimal_suffix']) ? $optionsAdvanced['cutzerodecimal_suffix'] : "";
|
107 |
+
if ($optionsAdvanced['cutzerodecimal'] && $zeroDecimal) { // cut decimal if it is equal to 0
|
108 |
+
if ((isset($suffix)) && (strlen($suffix) > 0)) { // if need to add suffix
|
109 |
+
// searching for fully formatted currency without currency symbol
|
110 |
+
$options['display'] = Zend_Currency::NO_SYMBOL;
|
111 |
+
$answerBlank = $this->_localizeNumber(parent::formatTxt($price, $options), $options);
|
112 |
+
|
113 |
+
//print "answerBlank: " . $answerBlank . "<br />";
|
114 |
+
// searching for fully formatted currency without currency symbol and rounded to int
|
115 |
+
$options['precision'] = 0;
|
116 |
+
$answerRound = $this->_localizeNumber(parent::formatTxt($price,
|
117 |
+
$helper->clearOptions($options)
|
118 |
+
), $options);
|
119 |
+
//print "answerRound: " . $answerRound . "<br />";
|
120 |
+
|
121 |
+
// replace cut decimals with suffix
|
122 |
+
$answer = str_replace($answerBlank, $answerRound . $suffix, $answer);
|
123 |
+
return $answer;
|
124 |
+
} else { // only changing precision
|
125 |
+
$options['precision'] = 0;
|
126 |
+
$answer = parent::formatTxt($price, $helper->clearOptions($options));
|
127 |
+
return $answer;
|
128 |
+
}
|
129 |
+
} else {
|
130 |
+
return $answer;
|
131 |
+
}
|
132 |
+
}
|
133 |
+
|
134 |
+
protected function _localizeNumber($number, $options = array())
|
135 |
+
{
|
136 |
+
$options = Mage::helper('currencymanager')->getOptions($options, true, $this->getCurrencyCode());
|
137 |
+
if ($options['display'] == Zend_Currency::NO_SYMBOL) {
|
138 |
+
// in Zend_Currency toCurrency() function
|
139 |
+
// are stripped unbreakable spaces only for currency without Currency Symbol
|
140 |
+
return $number;
|
141 |
+
} else {
|
142 |
+
$locale = Mage::app()->getLocale()->getLocaleCode();
|
143 |
+
$format = Zend_Locale_Data::getContent($locale, 'decimalnumber');
|
144 |
+
$numberOptions = array(
|
145 |
+
'locale' => $locale,
|
146 |
+
'number_format' => $format,
|
147 |
+
'precision' => 0,
|
148 |
+
);
|
149 |
+
$number = Zend_Locale_Format::getNumber($number, $numberOptions);
|
150 |
+
return Zend_Locale_Format::toNumber($number, $numberOptions);
|
151 |
+
}
|
152 |
+
}
|
153 |
+
|
154 |
+
//sometimes we need make correction
|
155 |
+
public function convert($price, $toCurrency = null)
|
156 |
+
{
|
157 |
+
$result = parent::convert($price, $toCurrency);
|
158 |
+
$data = new Varien_Object(array(
|
159 |
+
"price" => $price,
|
160 |
+
"toCurrency" => $toCurrency,
|
161 |
+
"result" => $result
|
162 |
+
));
|
163 |
+
Mage::dispatchEvent("currency_convert_after", array("conversion" => $data));
|
164 |
+
return $data->getData("result");
|
165 |
+
}
|
166 |
+
|
167 |
+
}
|
app/code/community/ET/CurrencyManager/Model/Locale.php
CHANGED
@@ -1,46 +1,44 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
*
|
4 |
-
*
|
5 |
-
*
|
6 |
-
*
|
7 |
-
*
|
8 |
-
*
|
9 |
-
*
|
10 |
-
*
|
11 |
-
*
|
12 |
-
*
|
13 |
-
*
|
14 |
-
* @
|
15 |
-
* @
|
16 |
-
* @
|
17 |
-
* @
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
}
|
46 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* You may not sell, sub-license, rent or lease
|
6 |
+
* any portion of the Software or Documentation to anyone.
|
7 |
+
*
|
8 |
+
* DISCLAIMER
|
9 |
+
*
|
10 |
+
* Do not edit or add to this file if you wish to upgrade to newer
|
11 |
+
* versions in the future.
|
12 |
+
*
|
13 |
+
* @category ET
|
14 |
+
* @package ET_CurrencyManager
|
15 |
+
* @copyright Copyright (c) 2012 ET Web Solutions (http://etwebsolutions.com)
|
16 |
+
* @contacts support@etwebsolutions.com
|
17 |
+
* @license http://shop.etwebsolutions.com/etws-license-free-v1/ ETWS Free License (EFL1)
|
18 |
+
*/
|
19 |
+
|
20 |
+
class ET_CurrencyManager_Model_Locale extends Mage_Core_Model_Locale
|
21 |
+
{
|
22 |
+
public function currency($ccode)
|
23 |
+
{
|
24 |
+
$admcurrency = parent::currency($ccode);
|
25 |
+
$options = Mage::helper('currencymanager')->getOptions(array(), true, $ccode);
|
26 |
+
$admcurrency->setFormat($options, $ccode);
|
27 |
+
|
28 |
+
return $admcurrency;
|
29 |
+
}
|
30 |
+
|
31 |
+
|
32 |
+
public function getJsPriceFormat()
|
33 |
+
{
|
34 |
+
// For JavaScript prices
|
35 |
+
$parentFormat = parent::getJsPriceFormat();
|
36 |
+
$options = Mage::helper('currencymanager')->getOptions(array());
|
37 |
+
if (isset($options["precision"])) {
|
38 |
+
$parentFormat["requiredPrecision"] = $options["precision"];
|
39 |
+
$parentFormat["precision"] = $options["precision"];
|
40 |
+
}
|
41 |
+
|
42 |
+
return $parentFormat;
|
43 |
+
}
|
44 |
+
}
|
|
|
|
app/code/community/ET/CurrencyManager/Model/Store.php
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* You may not sell, sub-license, rent or lease
|
6 |
+
* any portion of the Software or Documentation to anyone.
|
7 |
+
*
|
8 |
+
* DISCLAIMER
|
9 |
+
*
|
10 |
+
* Do not edit or add to this file if you wish to upgrade to newer
|
11 |
+
* versions in the future.
|
12 |
+
*
|
13 |
+
* @category ET
|
14 |
+
* @package ET_CurrencyManager
|
15 |
+
* @copyright Copyright (c) 2012 ET Web Solutions (http://etwebsolutions.com)
|
16 |
+
* @contacts support@etwebsolutions.com
|
17 |
+
* @license http://shop.etwebsolutions.com/etws-license-free-v1/ ETWS Free License (EFL1)
|
18 |
+
*/
|
19 |
+
|
20 |
+
class ET_CurrencyManager_Model_Store extends Mage_Core_Model_Store
|
21 |
+
{
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Round price
|
25 |
+
*
|
26 |
+
* @param mixed $price
|
27 |
+
* @return double
|
28 |
+
*/
|
29 |
+
public function roundPrice($price)
|
30 |
+
{
|
31 |
+
$options = Mage::helper('currencymanager')->getOptions(array());
|
32 |
+
return round($price, isset($options["precision"])?$options["precision"]:2);
|
33 |
+
}
|
34 |
+
}
|
app/code/community/ET/CurrencyManager/Model/Typeposition.php
CHANGED
@@ -1,36 +1,35 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
*
|
4 |
-
*
|
5 |
-
*
|
6 |
-
*
|
7 |
-
*
|
8 |
-
*
|
9 |
-
*
|
10 |
-
*
|
11 |
-
*
|
12 |
-
*
|
13 |
-
*
|
14 |
-
* @
|
15 |
-
* @
|
16 |
-
* @
|
17 |
-
* @
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
}
|
36 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* You may not sell, sub-license, rent or lease
|
6 |
+
* any portion of the Software or Documentation to anyone.
|
7 |
+
*
|
8 |
+
* DISCLAIMER
|
9 |
+
*
|
10 |
+
* Do not edit or add to this file if you wish to upgrade to newer
|
11 |
+
* versions in the future.
|
12 |
+
*
|
13 |
+
* @category ET
|
14 |
+
* @package ET_CurrencyManager
|
15 |
+
* @copyright Copyright (c) 2012 ET Web Solutions (http://etwebsolutions.com)
|
16 |
+
* @contacts support@etwebsolutions.com
|
17 |
+
* @license http://shop.etwebsolutions.com/etws-license-free-v1/ ETWS Free License (EFL1)
|
18 |
+
*/
|
19 |
+
|
20 |
+
class ET_CurrencyManager_Model_Typeposition extends Varien_Object
|
21 |
+
{
|
22 |
+
/**
|
23 |
+
* Options getter
|
24 |
+
*
|
25 |
+
* @return array
|
26 |
+
*/
|
27 |
+
public function toOptionArray()
|
28 |
+
{
|
29 |
+
return array(
|
30 |
+
array('value' => 8, 'label'=>Mage::helper('currencymanager')->__('Default')),
|
31 |
+
array('value' => 16, 'label'=>Mage::helper('currencymanager')->__('Right')),
|
32 |
+
array('value' => 32, 'label'=>Mage::helper('currencymanager')->__('Left')),
|
33 |
+
);
|
34 |
+
}
|
|
|
35 |
}
|
app/code/community/ET/CurrencyManager/Model/Typesymboluse.php
CHANGED
@@ -1,37 +1,36 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
*
|
4 |
-
*
|
5 |
-
*
|
6 |
-
*
|
7 |
-
*
|
8 |
-
*
|
9 |
-
*
|
10 |
-
*
|
11 |
-
*
|
12 |
-
*
|
13 |
-
*
|
14 |
-
* @
|
15 |
-
* @
|
16 |
-
* @
|
17 |
-
* @
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* You may not sell, sub-license, rent or lease
|
6 |
+
* any portion of the Software or Documentation to anyone.
|
7 |
+
*
|
8 |
+
* DISCLAIMER
|
9 |
+
*
|
10 |
+
* Do not edit or add to this file if you wish to upgrade to newer
|
11 |
+
* versions in the future.
|
12 |
+
*
|
13 |
+
* @category ET
|
14 |
+
* @package ET_CurrencyManager
|
15 |
+
* @copyright Copyright (c) 2012 ET Web Solutions (http://etwebsolutions.com)
|
16 |
+
* @contacts support@etwebsolutions.com
|
17 |
+
* @license http://shop.etwebsolutions.com/etws-license-free-v1/ ETWS Free License (EFL1)
|
18 |
+
*/
|
19 |
+
|
20 |
+
class ET_CurrencyManager_Model_Typesymboluse extends Varien_Object
|
21 |
+
{
|
22 |
+
/**
|
23 |
+
* Options getter
|
24 |
+
*
|
25 |
+
* @return array
|
26 |
+
*/
|
27 |
+
public function toOptionArray()
|
28 |
+
{
|
29 |
+
return array(
|
30 |
+
array('value' => 1, 'label'=>Mage::helper('currencymanager')->__('Do not use')),
|
31 |
+
array('value' => 2, 'label'=>Mage::helper('currencymanager')->__('Use symbol')),
|
32 |
+
array('value' => 3, 'label'=>Mage::helper('currencymanager')->__('Use short name')),
|
33 |
+
array('value' => 4, 'label'=>Mage::helper('currencymanager')->__('Use name')),
|
34 |
+
);
|
35 |
+
}
|
36 |
+
}
|
|
app/code/community/ET/CurrencyManager/etc/config.xml
CHANGED
@@ -1,149 +1,173 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<!--
|
3 |
-
/**
|
4 |
-
*
|
5 |
-
*
|
6 |
-
*
|
7 |
-
*
|
8 |
-
*
|
9 |
-
*
|
10 |
-
*
|
11 |
-
*
|
12 |
-
*
|
13 |
-
*
|
14 |
-
*
|
15 |
-
* @
|
16 |
-
* @
|
17 |
-
* @
|
18 |
-
* @
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
<
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
</config>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* NOTICE OF LICENSE
|
5 |
+
*
|
6 |
+
* You may not sell, sub-license, rent or lease
|
7 |
+
* any portion of the Software or Documentation to anyone.
|
8 |
+
*
|
9 |
+
* DISCLAIMER
|
10 |
+
*
|
11 |
+
* Do not edit or add to this file if you wish to upgrade to newer
|
12 |
+
* versions in the future.
|
13 |
+
*
|
14 |
+
* @category ET
|
15 |
+
* @package ET_CurrencyManager
|
16 |
+
* @copyright Copyright (c) 2012 ET Web Solutions (http://etwebsolutions.com)
|
17 |
+
* @contacts support@etwebsolutions.com
|
18 |
+
* @license http://shop.etwebsolutions.com/etws-license-free-v1/ ETWS Free License (EFL1)
|
19 |
+
*/
|
20 |
+
-->
|
21 |
+
<config>
|
22 |
+
<modules>
|
23 |
+
<ET_CurrencyManager>
|
24 |
+
<name>ET Currency Manager</name>
|
25 |
+
<version>1.0.0</version>
|
26 |
+
<descr>
|
27 |
+
<ru_RU><![CDATA[Модуль позволяет владельцу магазина просто и удобно управлять отображением цены: указывать свой символ валюты, количество знаков после запятой, позицию символа и др.]]>
|
28 |
+
</ru_RU>
|
29 |
+
<en_US><![CDATA[Allows to change localization options for currency. Example: currency symbol or price decimals.]]>
|
30 |
+
</en_US>
|
31 |
+
</descr>
|
32 |
+
<permanentlink>
|
33 |
+
<ru_RU>http://shop.etwebsolutions.com/rus/et-currency-manager.html</ru_RU>
|
34 |
+
<en_US>http://shop.etwebsolutions.com/eng/et-currency-manager.html</en_US>
|
35 |
+
</permanentlink>
|
36 |
+
<license>
|
37 |
+
<ru_RU><![CDATA[ETWS Свободная лицензия (EFL1)]]></ru_RU>
|
38 |
+
<en_US><![CDATA[ETWS Free License (EFL1)]]></en_US>
|
39 |
+
</license>
|
40 |
+
<licenselink>
|
41 |
+
<ru_RU>http://shop.etwebsolutions.com/rus/etws-license-free-v1</ru_RU>
|
42 |
+
<en_US>http://shop.etwebsolutions.com/eng/etws-license-free-v1</en_US>
|
43 |
+
</licenselink>
|
44 |
+
<redminelink>http://support.etwebsolutions.com/projects/et-currency-manager/roadmap</redminelink>
|
45 |
+
<ourserviceslink>
|
46 |
+
<ru_RU>http://shop.etwebsolutions.com/rus/our-services</ru_RU>
|
47 |
+
<en_US>http://shop.etwebsolutions.com/eng/our-services</en_US>
|
48 |
+
</ourserviceslink>
|
49 |
+
</ET_CurrencyManager>
|
50 |
+
</modules>
|
51 |
+
|
52 |
+
<global>
|
53 |
+
<helpers>
|
54 |
+
<currencymanager>
|
55 |
+
<class>ET_CurrencyManager_Helper</class>
|
56 |
+
</currencymanager>
|
57 |
+
</helpers>
|
58 |
+
<models>
|
59 |
+
<directory>
|
60 |
+
<rewrite>
|
61 |
+
<currency>ET_CurrencyManager_Model_Currency</currency>
|
62 |
+
</rewrite>
|
63 |
+
</directory>
|
64 |
+
|
65 |
+
<core>
|
66 |
+
<rewrite>
|
67 |
+
<locale>ET_CurrencyManager_Model_Locale</locale>
|
68 |
+
<store>ET_CurrencyManager_Model_Store</store>
|
69 |
+
</rewrite>
|
70 |
+
</core>
|
71 |
+
|
72 |
+
<currencymanager>
|
73 |
+
<class>ET_CurrencyManager_Model</class>
|
74 |
+
</currencymanager>
|
75 |
+
</models>
|
76 |
+
<blocks>
|
77 |
+
<currencymanager>
|
78 |
+
<class>ET_CurrencyManager_Block</class>
|
79 |
+
</currencymanager>
|
80 |
+
<adminhtml>
|
81 |
+
<rewrite>
|
82 |
+
<catalog_product_helper_form_price>ET_CurrencyManager_Block_Adminhtml_Formprice</catalog_product_helper_form_price>
|
83 |
+
</rewrite>
|
84 |
+
</adminhtml>
|
85 |
+
</blocks>
|
86 |
+
<resources>
|
87 |
+
<currencymanager_setup>
|
88 |
+
<setup>
|
89 |
+
<module>ET_CurrencyManager</module>
|
90 |
+
</setup>
|
91 |
+
<connection>
|
92 |
+
<use>core_setup</use>
|
93 |
+
</connection>
|
94 |
+
</currencymanager_setup>
|
95 |
+
<currencymanager_write>
|
96 |
+
<connection>
|
97 |
+
<use>core_write</use>
|
98 |
+
</connection>
|
99 |
+
</currencymanager_write>
|
100 |
+
<currencymanager_read>
|
101 |
+
<connection>
|
102 |
+
<use>core_read</use>
|
103 |
+
</connection>
|
104 |
+
</currencymanager_read>
|
105 |
+
</resources>
|
106 |
+
</global>
|
107 |
+
|
108 |
+
<default>
|
109 |
+
<currencymanager>
|
110 |
+
<general>
|
111 |
+
<enabled>1</enabled>
|
112 |
+
<excludecheckout>1</excludecheckout>
|
113 |
+
<enabledadm>0</enabledadm>
|
114 |
+
<input_admin>0</input_admin>
|
115 |
+
<cutzerodecimal>0</cutzerodecimal>
|
116 |
+
<cutzerodecimal_suffix>,-</cutzerodecimal_suffix>
|
117 |
+
<precision>0</precision>
|
118 |
+
<position>8</position>
|
119 |
+
<display>2</display>
|
120 |
+
</general>
|
121 |
+
</currencymanager>
|
122 |
+
</default>
|
123 |
+
|
124 |
+
|
125 |
+
<frontend>
|
126 |
+
<layout>
|
127 |
+
<updates>
|
128 |
+
<currencymanager>
|
129 |
+
<file>et_currencymanager.xml</file>
|
130 |
+
</currencymanager>
|
131 |
+
</updates>
|
132 |
+
</layout>
|
133 |
+
</frontend>
|
134 |
+
|
135 |
+
<adminhtml>
|
136 |
+
<acl>
|
137 |
+
<resources>
|
138 |
+
<admin>
|
139 |
+
<children>
|
140 |
+
<system>
|
141 |
+
<children>
|
142 |
+
<config>
|
143 |
+
<children>
|
144 |
+
<currencymanager translate="title" module="currencymanager">
|
145 |
+
<title>ET Currency Manager</title>
|
146 |
+
<sort_order>400</sort_order>
|
147 |
+
</currencymanager>
|
148 |
+
</children>
|
149 |
+
</config>
|
150 |
+
</children>
|
151 |
+
</system>
|
152 |
+
</children>
|
153 |
+
</admin>
|
154 |
+
</resources>
|
155 |
+
</acl>
|
156 |
+
<translate>
|
157 |
+
<modules>
|
158 |
+
<ET_CurrencyManager>
|
159 |
+
<files>
|
160 |
+
<default>ET_Currencymanager.csv</default>
|
161 |
+
</files>
|
162 |
+
</ET_CurrencyManager>
|
163 |
+
</modules>
|
164 |
+
</translate>
|
165 |
+
</adminhtml>
|
166 |
+
<phpunit>
|
167 |
+
<suite>
|
168 |
+
<modules>
|
169 |
+
<ET_CurrencyManager />
|
170 |
+
</modules>
|
171 |
+
</suite>
|
172 |
+
</phpunit>
|
173 |
+
</config>
|
app/code/community/ET/CurrencyManager/etc/system.xml
CHANGED
@@ -1,195 +1,220 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<!--
|
3 |
-
/**
|
4 |
-
*
|
5 |
-
*
|
6 |
-
*
|
7 |
-
*
|
8 |
-
*
|
9 |
-
*
|
10 |
-
*
|
11 |
-
*
|
12 |
-
*
|
13 |
-
*
|
14 |
-
*
|
15 |
-
* @
|
16 |
-
* @
|
17 |
-
* @
|
18 |
-
* @
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
<
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
</
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* NOTICE OF LICENSE
|
5 |
+
*
|
6 |
+
* You may not sell, sub-license, rent or lease
|
7 |
+
* any portion of the Software or Documentation to anyone.
|
8 |
+
*
|
9 |
+
* DISCLAIMER
|
10 |
+
*
|
11 |
+
* Do not edit or add to this file if you wish to upgrade to newer
|
12 |
+
* versions in the future.
|
13 |
+
*
|
14 |
+
* @category ET
|
15 |
+
* @package ET_CurrencyManager
|
16 |
+
* @copyright Copyright (c) 2012 ET Web Solutions (http://etwebsolutions.com)
|
17 |
+
* @contacts support@etwebsolutions.com
|
18 |
+
* @license http://shop.etwebsolutions.com/etws-license-free-v1/ ETWS Free License (EFL1)
|
19 |
+
*/
|
20 |
+
-->
|
21 |
+
<config>
|
22 |
+
<tabs>
|
23 |
+
<etall translate="label">
|
24 |
+
<label>ET Extensions</label>
|
25 |
+
<sort_order>400</sort_order>
|
26 |
+
</etall>
|
27 |
+
</tabs>
|
28 |
+
|
29 |
+
<sections>
|
30 |
+
<currency>
|
31 |
+
<groups>
|
32 |
+
<options>
|
33 |
+
<fields>
|
34 |
+
<currencymanageroptions translate="label">
|
35 |
+
<label>ET Currency Manager</label>
|
36 |
+
<frontend_type>label</frontend_type>
|
37 |
+
<frontend_model>currencymanager/adminhtml_system_config_form_field_linktooptions</frontend_model>
|
38 |
+
<sort_order>999</sort_order>
|
39 |
+
<show_in_default>1</show_in_default>
|
40 |
+
<show_in_website>1</show_in_website>
|
41 |
+
<show_in_store>1</show_in_store>
|
42 |
+
</currencymanageroptions>
|
43 |
+
</fields>
|
44 |
+
</options>
|
45 |
+
</groups>
|
46 |
+
</currency>
|
47 |
+
|
48 |
+
<currencymanager translate="label" module="currencymanager">
|
49 |
+
<label>Currency Manager</label>
|
50 |
+
<tab>etall</tab>
|
51 |
+
<frontend_type>text</frontend_type>
|
52 |
+
<sort_order>300</sort_order>
|
53 |
+
<show_in_default>1</show_in_default>
|
54 |
+
<show_in_website>1</show_in_website>
|
55 |
+
<show_in_store>1</show_in_store>
|
56 |
+
<groups>
|
57 |
+
<info translate="label">
|
58 |
+
<label>Currency Manager information</label>
|
59 |
+
<frontend_type>text</frontend_type>
|
60 |
+
<sort_order>1</sort_order>
|
61 |
+
<show_in_default>1</show_in_default>
|
62 |
+
<show_in_website>1</show_in_website>
|
63 |
+
<show_in_store>1</show_in_store>
|
64 |
+
<fields>
|
65 |
+
<support_information>
|
66 |
+
<frontend_model>currencymanager/adminhtml_support</frontend_model>
|
67 |
+
<sort_order>100</sort_order>
|
68 |
+
<show_in_default>1</show_in_default>
|
69 |
+
<show_in_website>1</show_in_website>
|
70 |
+
<show_in_store>1</show_in_store>
|
71 |
+
</support_information>
|
72 |
+
</fields>
|
73 |
+
</info>
|
74 |
+
<general translate="label">
|
75 |
+
<label>Currency Options</label>
|
76 |
+
<frontend_type>text</frontend_type>
|
77 |
+
<sort_order>10</sort_order>
|
78 |
+
<show_in_default>1</show_in_default>
|
79 |
+
<show_in_website>1</show_in_website>
|
80 |
+
<show_in_store>1</show_in_store>
|
81 |
+
<fields>
|
82 |
+
<heading_frontend translate="label">
|
83 |
+
<label>Frontend specific options</label>
|
84 |
+
<frontend_model>currencymanager/adminhtml_heading</frontend_model>
|
85 |
+
<sort_order>100</sort_order>
|
86 |
+
<show_in_default>1</show_in_default>
|
87 |
+
<show_in_website>1</show_in_website>
|
88 |
+
<show_in_store>1</show_in_store>
|
89 |
+
</heading_frontend>
|
90 |
+
<enabled translate="label">
|
91 |
+
<label>Enabled for Frontend</label>
|
92 |
+
<frontend_type>select</frontend_type>
|
93 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
94 |
+
<sort_order>110</sort_order>
|
95 |
+
<show_in_default>1</show_in_default>
|
96 |
+
<show_in_website>1</show_in_website>
|
97 |
+
<show_in_store>1</show_in_store>
|
98 |
+
</enabled>
|
99 |
+
<excludecheckout translate="label comment">
|
100 |
+
<label>Exclude for checkout</label>
|
101 |
+
<comment><![CDATA[If Yes - options [Precision] and [Replace Zero Price] will not affect display of prices in checkout.]]></comment>
|
102 |
+
<frontend_type>select</frontend_type>
|
103 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
104 |
+
<sort_order>120</sort_order>
|
105 |
+
<show_in_default>1</show_in_default>
|
106 |
+
<show_in_website>1</show_in_website>
|
107 |
+
<show_in_store>1</show_in_store>
|
108 |
+
</excludecheckout>
|
109 |
+
|
110 |
+
<heading_admin translate="label">
|
111 |
+
<label>Admin specific options</label>
|
112 |
+
<frontend_model>currencymanager/adminhtml_heading</frontend_model>
|
113 |
+
<sort_order>200</sort_order>
|
114 |
+
<show_in_default>1</show_in_default>
|
115 |
+
<show_in_website>1</show_in_website>
|
116 |
+
<show_in_store>1</show_in_store>
|
117 |
+
</heading_admin>
|
118 |
+
<enabledadm translate="label">
|
119 |
+
<label>Enabled for Admin</label>
|
120 |
+
<frontend_type>select</frontend_type>
|
121 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
122 |
+
<sort_order>210</sort_order>
|
123 |
+
<show_in_default>1</show_in_default>
|
124 |
+
<show_in_website>1</show_in_website>
|
125 |
+
<show_in_store>1</show_in_store>
|
126 |
+
</enabledadm>
|
127 |
+
|
128 |
+
<input_admin translate="label">
|
129 |
+
<label>Enable for Inputs</label>
|
130 |
+
<frontend_type>select</frontend_type>
|
131 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
132 |
+
<sort_order>220</sort_order>
|
133 |
+
<show_in_default>1</show_in_default>
|
134 |
+
<show_in_website>1</show_in_website>
|
135 |
+
<show_in_store>1</show_in_store>
|
136 |
+
</input_admin>
|
137 |
+
|
138 |
+
|
139 |
+
<heading_global translate="label">
|
140 |
+
<label>Currency options (global)</label>
|
141 |
+
<frontend_model>currencymanager/adminhtml_heading</frontend_model>
|
142 |
+
<sort_order>300</sort_order>
|
143 |
+
<show_in_default>1</show_in_default>
|
144 |
+
<show_in_website>1</show_in_website>
|
145 |
+
<show_in_store>1</show_in_store>
|
146 |
+
</heading_global>
|
147 |
+
<precision translate="label comment">
|
148 |
+
<label>Precision</label>
|
149 |
+
<comment>Number of decimal (e.g. 0, 1, 2). Default: 0</comment>
|
150 |
+
<frontend_type>text</frontend_type>
|
151 |
+
<sort_order>310</sort_order>
|
152 |
+
<show_in_default>1</show_in_default>
|
153 |
+
<show_in_website>1</show_in_website>
|
154 |
+
<show_in_store>1</show_in_store>
|
155 |
+
</precision>
|
156 |
+
<cutzerodecimal translate="label comment">
|
157 |
+
<label>Cut Zero Decimals</label>
|
158 |
+
<comment>If Yes price will be 99 instead of 99.00, but 99.99 if price 99.99</comment>
|
159 |
+
<frontend_type>select</frontend_type>
|
160 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
161 |
+
<sort_order>320</sort_order>
|
162 |
+
<show_in_default>1</show_in_default>
|
163 |
+
<show_in_website>1</show_in_website>
|
164 |
+
<show_in_store>1</show_in_store>
|
165 |
+
</cutzerodecimal>
|
166 |
+
|
167 |
+
<cutzerodecimal_suffix translate="label comment">
|
168 |
+
<label>Replaces Cuted Zero Decimals</label>
|
169 |
+
<comment>Used only if Cut Zero Decimals = Yes, default ",-"</comment>
|
170 |
+
<frontend_type>text</frontend_type>
|
171 |
+
<sort_order>325</sort_order>
|
172 |
+
<show_in_default>1</show_in_default>
|
173 |
+
<show_in_website>1</show_in_website>
|
174 |
+
<show_in_store>1</show_in_store>
|
175 |
+
</cutzerodecimal_suffix>
|
176 |
+
|
177 |
+
<position translate="label">
|
178 |
+
<label>Symbol position</label>
|
179 |
+
<frontend_type>select</frontend_type>
|
180 |
+
<source_model>currencymanager/typeposition</source_model>
|
181 |
+
<sort_order>330</sort_order>
|
182 |
+
<show_in_default>1</show_in_default>
|
183 |
+
<show_in_website>1</show_in_website>
|
184 |
+
<show_in_store>1</show_in_store>
|
185 |
+
</position>
|
186 |
+
<display translate="label comment">
|
187 |
+
<label>Currency symbol use</label>
|
188 |
+
<comment>e.g. Symbol = Ls, Short name = LVL, Name = Latvian Lats</comment>
|
189 |
+
<frontend_type>select</frontend_type>
|
190 |
+
<source_model>currencymanager/typesymboluse</source_model>
|
191 |
+
<sort_order>340</sort_order>
|
192 |
+
<show_in_default>1</show_in_default>
|
193 |
+
<show_in_website>1</show_in_website>
|
194 |
+
<show_in_store>1</show_in_store>
|
195 |
+
</display>
|
196 |
+
|
197 |
+
<heading_specific translate="label">
|
198 |
+
<label>Currency options (for specific currency)</label>
|
199 |
+
<frontend_model>currencymanager/adminhtml_heading</frontend_model>
|
200 |
+
<sort_order>400</sort_order>
|
201 |
+
<show_in_default>1</show_in_default>
|
202 |
+
<show_in_website>1</show_in_website>
|
203 |
+
<show_in_store>1</show_in_store>
|
204 |
+
</heading_specific>
|
205 |
+
<symbolreplace translate="label">
|
206 |
+
<label>Currency specific options</label>
|
207 |
+
<frontend_type>select</frontend_type>
|
208 |
+
<frontend_model>currencymanager/adminhtml_symbolreplace</frontend_model>
|
209 |
+
<backend_model>adminhtml/system_config_backend_serialized</backend_model>
|
210 |
+
<sort_order>410</sort_order>
|
211 |
+
<show_in_default>1</show_in_default>
|
212 |
+
<show_in_website>1</show_in_website>
|
213 |
+
<show_in_store>1</show_in_store>
|
214 |
+
</symbolreplace>
|
215 |
+
</fields>
|
216 |
+
</general>
|
217 |
+
</groups>
|
218 |
+
</currencymanager>
|
219 |
+
</sections>
|
220 |
+
</config>
|
app/code/community/ET/ET_CurrencyManager_ChangeLog.txt
CHANGED
@@ -1,61 +1,84 @@
|
|
1 |
-
=====================================
|
2 |
-
This file describes changes between versions of module ET_CurrencyManager for Magento.
|
3 |
-
|
4 |
-
Legend:
|
5 |
-
* bug fix
|
6 |
-
+ added functionality
|
7 |
-
- removed functionality
|
8 |
-
|
9 |
-
=====================================
|
10 |
-
TODO:
|
11 |
-
+ Добавить возможность менять/Add the ability to change:
|
12 |
-
group symbol (разделитель тысяч/thousands separator)
|
13 |
-
decimal separator (, or .)
|
14 |
-
Так как в ядре Магенто это не реализовано, то придётся писать на прямую в файлы /lib/Zend/Locale/Data/
|
15 |
-
Since it is not implemented in the Magento core, it will have to write directly to files in /lib/Zend/Locale/Data/
|
16 |
-
|
17 |
-
=====================================
|
18 |
-
|
19 |
-
ver. 0.
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
*
|
31 |
-
*
|
32 |
-
|
33 |
-
ver. 0.2.
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
*
|
47 |
-
|
48 |
-
ver. 0.
|
49 |
-
|
50 |
-
|
51 |
-
ver. 0.
|
52 |
-
*
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
=====================================
|
2 |
+
This file describes changes between versions of module ET_CurrencyManager for Magento.
|
3 |
+
|
4 |
+
Legend:
|
5 |
+
* bug fix
|
6 |
+
+ added functionality
|
7 |
+
- removed functionality
|
8 |
+
|
9 |
+
=====================================
|
10 |
+
TODO:
|
11 |
+
+ Добавить возможность менять/Add the ability to change:
|
12 |
+
group symbol (разделитель тысяч/thousands separator)
|
13 |
+
decimal separator (, or .)
|
14 |
+
Так как в ядре Магенто это не реализовано, то придётся писать на прямую в файлы /lib/Zend/Locale/Data/
|
15 |
+
Since it is not implemented in the Magento core, it will have to write directly to files in /lib/Zend/Locale/Data/
|
16 |
+
|
17 |
+
=====================================
|
18 |
+
|
19 |
+
ver. 1.0.0 (31/08/2012)
|
20 |
+
+ Changed license type from AFL to ETWS Free License v1
|
21 |
+
+ Refactored code for Magento standards
|
22 |
+
+ Added link to extension settings in Currency Options Section
|
23 |
+
+ Added additional information about extension support in settings section
|
24 |
+
+ Added default values for specific currency section
|
25 |
+
* Some errors fixed
|
26 |
+
|
27 |
+
ver. 0.3.0 (19/08/2012)
|
28 |
+
+ Added custom events for currency conversion
|
29 |
+
+ Added phpUnit tests (beta version)
|
30 |
+
* Fixed problem with -0
|
31 |
+
* Fixed problem displaying 0 with positive precisions (some times displayed 0 instead of 0.00 for precision 2)
|
32 |
+
|
33 |
+
ver. 0.2.9 (17/04/2012)
|
34 |
+
* fixed rounding for JS with negative precision
|
35 |
+
|
36 |
+
ver. 0.2.8 (23/02/2012)
|
37 |
+
* fixed rounding for JS (bug was when rounding 9.9999999 or 9.00000001)
|
38 |
+
|
39 |
+
ver. 0.2.7 (06/02/2012)
|
40 |
+
* fixed param initialisations for JS (bug was for multicurrency stores)
|
41 |
+
|
42 |
+
ver. 0.2.6 (23/01/2012)
|
43 |
+
* fixed bug in function, which replaces zero decimals with custom suffix (for currency without currency symbol)
|
44 |
+
|
45 |
+
ver. 0.2.5 (20/01/2012)
|
46 |
+
* fixed bug in function, which replaces zero decimals with custom suffix (it was only in locales, where group separator is unbreakable whitespace - chr160)
|
47 |
+
|
48 |
+
ver. 0.2.4 (28/11/2011)
|
49 |
+
* fixed bug for displaying price instead zero text in configurable products when total price is zero
|
50 |
+
|
51 |
+
ver. 0.2.3 (29/09/2011)
|
52 |
+
* fixed bug for displaying 2 different currencies in checkout
|
53 |
+
* fixed bug for displaying negative precision using javascript
|
54 |
+
* added type="text/javascript" for scrypt tag (w3c validation is ok now)
|
55 |
+
|
56 |
+
ver. 0.2.2 (17/08/2011)
|
57 |
+
+ Replace zero decimals with suffix. Example: display 49,- instead of 49.00 or 49, but 49.99 remains unchanged.
|
58 |
+
+ Enable/Disable price rounding (precision parameter) on product input\edit page
|
59 |
+
* small bug fixes
|
60 |
+
|
61 |
+
ver. 0.2.1 (22/07/2011)
|
62 |
+
* Fixed skipping currency formatting for admin dashboard
|
63 |
+
|
64 |
+
ver. 0.2.0
|
65 |
+
+ restyled configuration
|
66 |
+
+ added ability to set currency specific options (all, not only symbol replace/ Actual for multi currency stores without store views).
|
67 |
+
+ added ability to disable precision change for checkout process (exclude checkout)
|
68 |
+
+ added ability to replace zero prices with any string. Example: instead 0.00 display FREE
|
69 |
+
* changed Cut Zero Decimal algorithm (now it's work fine with any currency precision, not only precision=2)
|
70 |
+
|
71 |
+
ver. 0.1.5
|
72 |
+
+ Added ability to cut zero decimals if it = 0. (price == floor(price))
|
73 |
+
|
74 |
+
ver. 0.1.4
|
75 |
+
* Added support for dynamic prices (Bundled, Configurable, Simple with custom options).
|
76 |
+
|
77 |
+
ver. 0.1.2
|
78 |
+
* Added separate configurations for enable/disable module for frontend and admin.
|
79 |
+
|
80 |
+
ver. 0.1.1
|
81 |
+
* repacking for Magento Connect
|
82 |
+
|
83 |
+
ver. 0.1.0
|
84 |
+
+ stable release
|
app/code/community/ET/ET_CurrencyManager_Description.txt
CHANGED
@@ -1,88 +1,88 @@
|
|
1 |
-
==== Description / Для чего этот модуль? ====
|
2 |
-
|
3 |
-
EN:
|
4 |
-
|
5 |
-
ET Currency Manager lets shop owner manage display of prices on website in simple and convenient way.
|
6 |
-
With this extension you can:
|
7 |
-
* Specify number of decimal digits. For price rounding Magento internal algorithm is used. Example: instead of 49.99 you can display 50 or 49.9900.
|
8 |
-
* Display prices without zero decimals. Example: display 49 instead of 49.00, but 49.99 remains unchanged.
|
9 |
-
* Replace zero decimals with suffix. Example: display 49,- instead of 49.00 or 49, but 49.99 remains unchanged.
|
10 |
-
* Specify position of currency symbol: before the price or after. Example: $ 49.99 or 49.99 $
|
11 |
-
* Specify what to use as currency symbol. Example: nothing, use currency code (EUR, USD), use currency symbol (€, $), use currency name (Euro, US Dollar)
|
12 |
-
* Change currency symbol to your own (text only). Example: display Money instead of $
|
13 |
-
* Change zero price to your own text. Example: FREE instead of 0.00
|
14 |
-
* Use separate settings for every store view
|
15 |
-
* Use separate settings for every currency
|
16 |
-
* Enable and disable extension for frontend and admin panel separately
|
17 |
-
* Disable price rounding on checkout page
|
18 |
-
* Enable price rounding on product input page
|
19 |
-
|
20 |
-
Important note: this extension changes only currency display, not the price itself. Example: Product's price is 49.99, you can show it's price as 50, but during the payment client will be charged 49.99, because it is the real price.
|
21 |
-
|
22 |
-
Additional note: You can change currency display even without this extension. For this you must change relevant localization files in Zend Framework (/lib/Zend/Locale/Data/*.xml). But in this case you can lose all of your changes while updating Magento.
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
RU:
|
27 |
-
Модуль ET Currency Manager позволяет владельцу магазина просто и удобно управлять отображением цены на своём сайте.
|
28 |
-
|
29 |
-
|
30 |
-
С помощью модуля вы можете:
|
31 |
-
|
32 |
-
* Указать количество знаков после запятой для отображения цен на сайте (для округления используется встроенный алгоритм Магенто). Пример: вместо 49.99 показывать или 50 или 49.9900
|
33 |
-
* Отображать цены без "копеек". Пример: Вместо 49.00 показывать 49, но цену 49.99 не изменять.
|
34 |
-
* Показывать суффикс для цены без "копеек". Вместо 49.00 или 49 показывать 49,- , но цену 49.99 не изменять.
|
35 |
-
* Указать позицию символа валюты: перед ценой или после. Пример: $ 49.99 или 49.99 $
|
36 |
-
* Указать, что использовать в качестве символа валюты. Пример: (не использовать; использовать код - EUR, USD; использовать символ - €, $; использовать название - Евро, Американский доллар)
|
37 |
-
* Заменять символ валюты на свой (только текстовый). Пример: Вместо $ выводить Money.
|
38 |
-
* Заменять нулевую цену на свой текст. Например: вместо 0.00 выводить БЕСПЛАТНО
|
39 |
-
* Использовать различные настройки для каждого представления магазина.
|
40 |
-
* Использовать различные настройки для каждой валюты отдельно.
|
41 |
-
* Включать и отключать модуль для пользовательской части и панели администрирования независимо друг от друга.
|
42 |
-
* Отключать округление цены на странице заказа.
|
43 |
-
* Включать округление цены на странице ввода товара.
|
44 |
-
|
45 |
-
Важно: модуль меняет исключительно отображение валюты, а не саму цену. (Пример: Товар стоит 49.99; Можно показывать цену клиентам как 50; Но при оплате с клиента будет удержано 49.99, так как это реальная стоимость товара).
|
46 |
-
|
47 |
-
Дополнительно: Без этого модуля у вас есть возможность влиять на отображение валюты только редактируя значения в файлах локализации Zend Framework (/lib/Zend/Locale/Data/*.xml). Но при обновлении версии Магенто изменения могут быть утеряны (так как может обновиться Zend Framework).
|
48 |
-
|
49 |
-
|
50 |
-
====Features / Особенности модуля====
|
51 |
-
|
52 |
-
* Open source code (no encryption and obfuscation)
|
53 |
-
* Code follows Magento development standards
|
54 |
-
* Extension is available on 2 languages (ru_RU, en_US) and you can easy add your own
|
55 |
-
* All extension settings are available on admin panel
|
56 |
-
|
57 |
-
* Открытый исходный код
|
58 |
-
* Код написан придерживаясь принятых стандартов в разработке для Магенто
|
59 |
-
* Доступен на 2-ух языках (ru_RU, en_US) и легко добавляются новые переводы
|
60 |
-
* Все настройки модуля доступны в панели администрирования
|
61 |
-
|
62 |
-
====Version Compatibility / Совместимость версий====
|
63 |
-
1.3.х (tested in 1.3.2.4.)
|
64 |
-
1.4.x (tested in 1.4.1.1.)
|
65 |
-
1.5.x (tested in 1.5.0.1. 1.5.1.0)
|
66 |
-
|
67 |
-
====Module tags====
|
68 |
-
price precision, round price, hide decimal, currency symbol, zero price replace
|
69 |
-
|
70 |
-
символ валюты, настройка отображения валюты, валюта, цена, количество знаков после запятой
|
71 |
-
|
72 |
-
====Установка/Installation====
|
73 |
-
|
74 |
-
* Disable Compiler, if it is enabled (System -> Tools -> Compilation)
|
75 |
-
* Disable cache, if it is enabled (System -> Cache Management)
|
76 |
-
* Install the extension (just unpack archive to magento root folder)
|
77 |
-
* Log off admin panel (Log Out)
|
78 |
-
* Log into admin panel (enter your login and password)
|
79 |
-
* Set filter display parameters (System -> Configuration -> Currency Manager)
|
80 |
-
* Run compilation process and enable cache if needed
|
81 |
-
|
82 |
-
* Отключите компиляцию, если включена (Система -> Инструменты -> Компиляция)
|
83 |
-
* Отключите кэш, если включён (Система -> Управление кэшем)
|
84 |
-
* Установите модуль (распакуйте архив в корневую папку с Магенто)
|
85 |
-
* Выйдите из панели администрирования (Выйти)
|
86 |
-
* Войдите в панель администрирования (введите логин/пароль)
|
87 |
-
* Настройте параметры отображения фильтра (Система -> Конфигурация -> Currency Manager)
|
88 |
-
* Если необходимо запустите процесс компиляции и включите кэш
|
1 |
+
==== Description / Для чего этот модуль? ====
|
2 |
+
|
3 |
+
EN:
|
4 |
+
|
5 |
+
ET Currency Manager lets shop owner manage display of prices on website in simple and convenient way.
|
6 |
+
With this extension you can:
|
7 |
+
* Specify number of decimal digits. For price rounding Magento internal algorithm is used. Example: instead of 49.99 you can display 50 or 49.9900.
|
8 |
+
* Display prices without zero decimals. Example: display 49 instead of 49.00, but 49.99 remains unchanged.
|
9 |
+
* Replace zero decimals with suffix. Example: display 49,- instead of 49.00 or 49, but 49.99 remains unchanged.
|
10 |
+
* Specify position of currency symbol: before the price or after. Example: $ 49.99 or 49.99 $
|
11 |
+
* Specify what to use as currency symbol. Example: nothing, use currency code (EUR, USD), use currency symbol (€, $), use currency name (Euro, US Dollar)
|
12 |
+
* Change currency symbol to your own (text only). Example: display Money instead of $
|
13 |
+
* Change zero price to your own text. Example: FREE instead of 0.00
|
14 |
+
* Use separate settings for every store view
|
15 |
+
* Use separate settings for every currency
|
16 |
+
* Enable and disable extension for frontend and admin panel separately
|
17 |
+
* Disable price rounding on checkout page
|
18 |
+
* Enable price rounding on product input page
|
19 |
+
|
20 |
+
Important note: this extension changes only currency display, not the price itself. Example: Product's price is 49.99, you can show it's price as 50, but during the payment client will be charged 49.99, because it is the real price.
|
21 |
+
|
22 |
+
Additional note: You can change currency display even without this extension. For this you must change relevant localization files in Zend Framework (/lib/Zend/Locale/Data/*.xml). But in this case you can lose all of your changes while updating Magento.
|
23 |
+
|
24 |
+
|
25 |
+
|
26 |
+
RU:
|
27 |
+
Модуль ET Currency Manager позволяет владельцу магазина просто и удобно управлять отображением цены на своём сайте.
|
28 |
+
|
29 |
+
|
30 |
+
С помощью модуля вы можете:
|
31 |
+
|
32 |
+
* Указать количество знаков после запятой для отображения цен на сайте (для округления используется встроенный алгоритм Магенто). Пример: вместо 49.99 показывать или 50 или 49.9900
|
33 |
+
* Отображать цены без "копеек". Пример: Вместо 49.00 показывать 49, но цену 49.99 не изменять.
|
34 |
+
* Показывать суффикс для цены без "копеек". Вместо 49.00 или 49 показывать 49,- , но цену 49.99 не изменять.
|
35 |
+
* Указать позицию символа валюты: перед ценой или после. Пример: $ 49.99 или 49.99 $
|
36 |
+
* Указать, что использовать в качестве символа валюты. Пример: (не использовать; использовать код - EUR, USD; использовать символ - €, $; использовать название - Евро, Американский доллар)
|
37 |
+
* Заменять символ валюты на свой (только текстовый). Пример: Вместо $ выводить Money.
|
38 |
+
* Заменять нулевую цену на свой текст. Например: вместо 0.00 выводить БЕСПЛАТНО
|
39 |
+
* Использовать различные настройки для каждого представления магазина.
|
40 |
+
* Использовать различные настройки для каждой валюты отдельно.
|
41 |
+
* Включать и отключать модуль для пользовательской части и панели администрирования независимо друг от друга.
|
42 |
+
* Отключать округление цены на странице заказа.
|
43 |
+
* Включать округление цены на странице ввода товара.
|
44 |
+
|
45 |
+
Важно: модуль меняет исключительно отображение валюты, а не саму цену. (Пример: Товар стоит 49.99; Можно показывать цену клиентам как 50; Но при оплате с клиента будет удержано 49.99, так как это реальная стоимость товара).
|
46 |
+
|
47 |
+
Дополнительно: Без этого модуля у вас есть возможность влиять на отображение валюты только редактируя значения в файлах локализации Zend Framework (/lib/Zend/Locale/Data/*.xml). Но при обновлении версии Магенто изменения могут быть утеряны (так как может обновиться Zend Framework).
|
48 |
+
|
49 |
+
|
50 |
+
====Features / Особенности модуля====
|
51 |
+
|
52 |
+
* Open source code (no encryption and obfuscation)
|
53 |
+
* Code follows Magento development standards
|
54 |
+
* Extension is available on 2 languages (ru_RU, en_US) and you can easy add your own
|
55 |
+
* All extension settings are available on admin panel
|
56 |
+
|
57 |
+
* Открытый исходный код
|
58 |
+
* Код написан придерживаясь принятых стандартов в разработке для Магенто
|
59 |
+
* Доступен на 2-ух языках (ru_RU, en_US) и легко добавляются новые переводы
|
60 |
+
* Все настройки модуля доступны в панели администрирования
|
61 |
+
|
62 |
+
====Version Compatibility / Совместимость версий====
|
63 |
+
1.3.х (tested in 1.3.2.4.)
|
64 |
+
1.4.x (tested in 1.4.1.1.)
|
65 |
+
1.5.x (tested in 1.5.0.1. 1.5.1.0)
|
66 |
+
|
67 |
+
====Module tags====
|
68 |
+
price precision, round price, hide decimal, currency symbol, zero price replace, price format
|
69 |
+
|
70 |
+
символ валюты, настройка отображения валюты, валюта, цена, количество знаков после запятой
|
71 |
+
|
72 |
+
====Установка/Installation====
|
73 |
+
|
74 |
+
* Disable Compiler, if it is enabled (System -> Tools -> Compilation)
|
75 |
+
* Disable cache, if it is enabled (System -> Cache Management)
|
76 |
+
* Install the extension (just unpack archive to magento root folder)
|
77 |
+
* Log off admin panel (Log Out)
|
78 |
+
* Log into admin panel (enter your login and password)
|
79 |
+
* Set filter display parameters (System -> Configuration -> Currency Manager)
|
80 |
+
* Run compilation process and enable cache if needed
|
81 |
+
|
82 |
+
* Отключите компиляцию, если включена (Система -> Инструменты -> Компиляция)
|
83 |
+
* Отключите кэш, если включён (Система -> Управление кэшем)
|
84 |
+
* Установите модуль (распакуйте архив в корневую папку с Магенто)
|
85 |
+
* Выйдите из панели администрирования (Выйти)
|
86 |
+
* Войдите в панель администрирования (введите логин/пароль)
|
87 |
+
* Настройте параметры отображения фильтра (Система -> Конфигурация -> Currency Manager)
|
88 |
+
* Если необходимо запустите процесс компиляции и включите кэш
|
app/code/community/ET/ET_CurrencyManager_LICENSE.txt
CHANGED
@@ -1,48 +1,60 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
=========en_US============
|
2 |
+
ETWS Free License (EFL1)
|
3 |
+
shop.etwebsolutions.com/eng/etws-license-free-v1
|
4 |
+
|
5 |
+
THIS LICENSE AGREEMENT (HEREINAFTER AGREEMENT) IS AN AGREEMENT BETWEEN
|
6 |
+
YOU (THE PERSON OR COMPANY WHO IS BEING LICENSED TO USE THE SOFTWARE OR DOCUMENTATION)
|
7 |
+
AND ET STUDIO CO.
|
8 |
+
|
9 |
+
1. By purchasing the Software you agree with the content of this Agreement
|
10 |
+
and agree to use the Software in compliance with this Agreement.
|
11 |
+
|
12 |
+
2. You are a user of this Software and ET Studio Co is an owner.
|
13 |
+
|
14 |
+
3. You may not sell, resell, sub-license or lease any fragment of the Software or its Documentation to anyone.
|
15 |
+
|
16 |
+
4. If you distribute original or changed version of the Software, you must include
|
17 |
+
this Agreement without any changes and original version of the Software.
|
18 |
+
|
19 |
+
5. We do not and will not bear responsibility for any damages (including any loss of your profit or savings)
|
20 |
+
caused to you, your business and your information by use or inability to use this Software.
|
21 |
+
|
22 |
+
6. We are not liable for prosecution arising from use of the Software against law or for any illegal use.
|
23 |
+
|
24 |
+
7. In case of failure to comply with any condition of this Agreement, your license to use the Software is revoked.
|
25 |
+
|
26 |
+
8. Agreement remains effective without any time limits until it is terminated.
|
27 |
+
|
28 |
+
9. ET Studio Co reserves the right to change Agreement type for future versions of Software.
|
29 |
+
|
30 |
+
|
31 |
+
|
32 |
+
=========ru_RU============
|
33 |
+
ETWS Свободная лицензия (EFL1)
|
34 |
+
shop.etwebsolutions.com/rus/etws-license-free-v1
|
35 |
+
|
36 |
+
ЭТО ЛИЦЕНЗИОННОЕ СОГЛАШЕНИЕ (ДАЛЕЕ ЛИЦЕНЗИЯ) ЯВЛЯЕТСЯ СОГЛАШЕНИЕМ МЕЖДУ
|
37 |
+
ВАМИ (ФИЗИЧЕСКИМ ИЛИ ЮРИДИЧЕСКИМ ЛИЦОМ, КОТОРОМУ ВЫДАНА ЛИЦЕНЗИЯ НА ИСПОЛЬЗОВАНИЕ ПРОГРАММНОГО ОБЕСПЕЧЕНИЯ)
|
38 |
+
И КОМПАНИЕЙ ET STUDIO.
|
39 |
+
|
40 |
+
1. Используя копию программного обеспечения (ПО) вы соглашаетесь с условиями,
|
41 |
+
изложенными в данной лицензии и обязуетесь их соблюдать.
|
42 |
+
|
43 |
+
2. Вы являетесь пользователем ПО. Владельцем ПО является компания ET Studio.
|
44 |
+
|
45 |
+
3. Вы не имеете права продавать, выдавать подлицензии, сдавать в аренду любую часть данного ПО или Документации
|
46 |
+
кому бы то ни было.
|
47 |
+
|
48 |
+
4. При распространении оригинальной или изменённой версии данного ПО вы обязаны включить в неё
|
49 |
+
данное лицензионное соглашение без внесения изменений и оригинальную версию данного ПО.
|
50 |
+
|
51 |
+
5. Мы не несём ответственность за любые причинённые вам, вашему бизнесу или информации убытки и недополученную прибыль,
|
52 |
+
связанные с использованием или невозможностью использования данного ПО.
|
53 |
+
|
54 |
+
6. Мы не несём ответственность за использование данного ПО в противозаконных целях.
|
55 |
+
|
56 |
+
7. В случае нарушения любых пунктов этой лицензии она будет отозвана и вы потеряете право на использование данного ПО.
|
57 |
+
|
58 |
+
8. Данная лицензия действует без ограничения по времени, пока не будет отозвана.
|
59 |
+
|
60 |
+
9. Компания ET Studio имеет право менять тип лицензии для последующих версий ПО.
|
app/design/frontend/default/default/layout/et_currencymanager.xml
CHANGED
@@ -1,11 +1,10 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<!--
|
3 |
/**
|
4 |
-
* ET Web Solutions
|
5 |
-
*
|
6 |
* NOTICE OF LICENSE
|
7 |
*
|
8 |
-
*
|
|
|
9 |
*
|
10 |
* DISCLAIMER
|
11 |
*
|
@@ -14,18 +13,18 @@
|
|
14 |
*
|
15 |
* @category ET
|
16 |
* @package ET_CurrencyManager
|
17 |
-
* @copyright Copyright (c)
|
18 |
* @contacts support@etwebsolutions.com
|
19 |
-
* @license http://
|
20 |
-
*/
|
21 |
-->
|
22 |
|
23 |
<layout version="0.1.0">
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
</layout>
|
1 |
<?xml version="1.0"?>
|
2 |
<!--
|
3 |
/**
|
|
|
|
|
4 |
* NOTICE OF LICENSE
|
5 |
*
|
6 |
+
* You may not sell, sub-license, rent or lease
|
7 |
+
* any portion of the Software or Documentation to anyone.
|
8 |
*
|
9 |
* DISCLAIMER
|
10 |
*
|
13 |
*
|
14 |
* @category ET
|
15 |
* @package ET_CurrencyManager
|
16 |
+
* @copyright Copyright (c) 2012 ET Web Solutions (http://etwebsolutions.com)
|
17 |
* @contacts support@etwebsolutions.com
|
18 |
+
* @license http://shop.etwebsolutions.com/etws-license-free-v1/ ETWS Free License (EFL1)
|
19 |
+
*/
|
20 |
-->
|
21 |
|
22 |
<layout version="0.1.0">
|
23 |
+
<default>
|
24 |
+
<reference name="head">
|
25 |
+
<block ifconfig="currencymanager/general/enabled" type="currencymanager/js" name="currencymanager.js.config" template="et_currencymanager/js.phtml"></block>
|
26 |
+
<action ifconfig="currencymanager/general/cutzerodecimal" method="addItem"><type>skin_js</type><name>et_currencymanager/et_currencymanager.js</name></action>
|
27 |
+
<action ifconfig="currencymanager/general/enabled" method="addItem"><type>skin_js</type><name>et_currencymanager/et_currencymanager_round.js</name></action>
|
28 |
+
</reference>
|
29 |
+
</default>
|
30 |
</layout>
|
app/design/frontend/default/default/template/et_currencymanager/js.phtml
CHANGED
@@ -1,23 +1,22 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
*
|
4 |
-
*
|
5 |
-
*
|
6 |
-
*
|
7 |
-
*
|
8 |
-
*
|
9 |
-
*
|
10 |
-
*
|
11 |
-
*
|
12 |
-
*
|
13 |
-
*
|
14 |
-
* @
|
15 |
-
* @
|
16 |
-
* @
|
17 |
-
* @
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
</script>
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* You may not sell, sub-license, rent or lease
|
6 |
+
* any portion of the Software or Documentation to anyone.
|
7 |
+
*
|
8 |
+
* DISCLAIMER
|
9 |
+
*
|
10 |
+
* Do not edit or add to this file if you wish to upgrade to newer
|
11 |
+
* versions in the future.
|
12 |
+
*
|
13 |
+
* @category ET
|
14 |
+
* @package ET_CurrencyManager
|
15 |
+
* @copyright Copyright (c) 2012 ET Web Solutions (http://etwebsolutions.com)
|
16 |
+
* @contacts support@etwebsolutions.com
|
17 |
+
* @license http://shop.etwebsolutions.com/etws-license-free-v1/ ETWS Free License (EFL1)
|
18 |
+
*/
|
19 |
+
?>
|
20 |
+
<script type="text/javascript">
|
21 |
+
etCurrencyManagerJsConfig=<?php print $this->getJsonConfig();?>
|
22 |
+
</script>
|
|
app/etc/modules/ET_CurrencyManager.xml
CHANGED
@@ -1,11 +1,10 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<!--
|
3 |
/**
|
4 |
-
* ET Web Solutions
|
5 |
-
*
|
6 |
* NOTICE OF LICENSE
|
7 |
*
|
8 |
-
*
|
|
|
9 |
*
|
10 |
* DISCLAIMER
|
11 |
*
|
@@ -14,17 +13,16 @@
|
|
14 |
*
|
15 |
* @category ET
|
16 |
* @package ET_CurrencyManager
|
17 |
-
* @copyright Copyright (c)
|
18 |
* @contacts support@etwebsolutions.com
|
19 |
-
* @license http://
|
20 |
-
*/
|
21 |
-->
|
22 |
-
|
23 |
<config>
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
</config>
|
1 |
<?xml version="1.0"?>
|
2 |
<!--
|
3 |
/**
|
|
|
|
|
4 |
* NOTICE OF LICENSE
|
5 |
*
|
6 |
+
* You may not sell, sub-license, rent or lease
|
7 |
+
* any portion of the Software or Documentation to anyone.
|
8 |
*
|
9 |
* DISCLAIMER
|
10 |
*
|
13 |
*
|
14 |
* @category ET
|
15 |
* @package ET_CurrencyManager
|
16 |
+
* @copyright Copyright (c) 2012 ET Web Solutions (http://etwebsolutions.com)
|
17 |
* @contacts support@etwebsolutions.com
|
18 |
+
* @license http://shop.etwebsolutions.com/etws-license-free-v1/ ETWS Free License (EFL1)
|
19 |
+
*/
|
20 |
-->
|
|
|
21 |
<config>
|
22 |
+
<modules>
|
23 |
+
<ET_CurrencyManager>
|
24 |
+
<active>true</active>
|
25 |
+
<codePool>community</codePool>
|
26 |
+
</ET_CurrencyManager>
|
27 |
+
</modules>
|
28 |
</config>
|
app/locale/ru_RU/ET_Currencymanager.csv
CHANGED
@@ -1,45 +1,66 @@
|
|
1 |
-
"Currency Manager","Currency Manager"
|
2 |
-
"Remove","Удалить"
|
3 |
-
"* Select currency","* Выберите валюту"
|
4 |
-
"Currency Options","Параметры валюты"
|
5 |
-
"Enabled for Frontend","Включено для пользователей"
|
6 |
-
"Enabled for Admin","Включено для администраторов"
|
7 |
-
"Precision","Точность"
|
8 |
-
"Precision:","Точность:"
|
9 |
-
"Number of decimal (e.g. 0, 1, 2). Default: 0","Кол-во знаков после запятой (например: 0, 1, 2). По умолчанию: 0"
|
10 |
-
"Symbol position","Позиция символа"
|
11 |
-
"Currency symbol use","Обозначение валюты"
|
12 |
-
"e.g. Symbol = Ls, Short name = LVL, Name = Latvian Lats","Например: Символ = руб., Код = RUB, Наименование = Российский рубль"
|
13 |
-
"Default","По умолчанию"
|
14 |
-
"Right","После цены"
|
15 |
-
"Left","Перед ценой"
|
16 |
-
"Do not use","не использовать"
|
17 |
-
"Use symbol","символ"
|
18 |
-
"Use short name","код"
|
19 |
-
"Use name","наименование"
|
20 |
-
"Yes","Да"
|
21 |
-
"No","Нет"
|
22 |
-
"Frontend specific options","Параметры для пользовательской части"
|
23 |
-
"Admin specific options","Параметры для панели администрирования"
|
24 |
-
"Currency options (global)","Параметры валюты (глобальные)"
|
25 |
-
"Currency options (for specific currency)","Параметры валюты (для конкретной валюты)"
|
26 |
-
"Exclude for checkout","Исключение для заказа"
|
27 |
-
"If Yes - options [Precision] and [Replace Zero Price] will not affect display of prices in checkout.","Если Да - параметры [Точность] и [Заменить нулевые цены] не будут влиять на отображение цены в заказе."
|
28 |
-
"Cut Zero Decimals","Отбрасывать нули после запятой"
|
29 |
-
"Cut Zero Decimals:","Отбрасывать нули после запятой:"
|
30 |
-
"If Yes price will be 99 instead of 99.00, but 99.99 if price 99.99","Если Да цена будет 99 вместо 99.00, но 99.99 при цене 99.99"
|
31 |
-
"Currency specific options","Параметры для конкретной валюты"
|
32 |
-
"Select currency:","Выберите валюту:"
|
33 |
-
"Symbol position:","Позиция символа:"
|
34 |
-
"Currency symbol use:","Обозначение валюты:"
|
35 |
-
"Replace symbol to:","Заменить символ на:"
|
36 |
-
"Replace Zero Price to:","Заменить нулевые цены на:"
|
37 |
-
"Add currency specific options","Добавить параметры, специфичные для валюты"
|
38 |
-
"Currency Manager information","Currency Manager
|
39 |
-
"Support by support@etwebsolutions.com <br /> You can hire our team for any customizations. Contact us at sales@etwebsolutions.com","Поддержка - support@etwebsolutions.com <br /> Вы можете нанять нашу команду для любых работ по Magento. Пишите на sales@etwebsolutions.com"
|
40 |
-
"Leave empty for disable replace","Оставьте пустым, если не хотите делать замену"
|
41 |
-
"Leave empty for global value use","Оставьте пустым для использования глобального значения"
|
42 |
-
"Used only if Cut Zero Decimals = Yes, default "",-""","Используется только при значении Отбрасывать нули после запятой = Да. По умолчанию: "",-"""
|
43 |
-
"Enable for Inputs","Применять для полей ввода цены"
|
44 |
-
"Suffix:","Заменить отброшенные нули на значение:"
|
45 |
-
"Replaces Cuted Zero Decimals","Заменить отброшенные нули на значение"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"Currency Manager","Currency Manager"
|
2 |
+
"Remove","Удалить"
|
3 |
+
"* Select currency","* Выберите валюту"
|
4 |
+
"Currency Options","Параметры валюты"
|
5 |
+
"Enabled for Frontend","Включено для пользователей"
|
6 |
+
"Enabled for Admin","Включено для администраторов"
|
7 |
+
"Precision","Точность"
|
8 |
+
"Precision:","Точность:"
|
9 |
+
"Number of decimal (e.g. 0, 1, 2). Default: 0","Кол-во знаков после запятой (например: 0, 1, 2). По умолчанию: 0"
|
10 |
+
"Symbol position","Позиция символа"
|
11 |
+
"Currency symbol use","Обозначение валюты"
|
12 |
+
"e.g. Symbol = Ls, Short name = LVL, Name = Latvian Lats","Например: Символ = руб., Код = RUB, Наименование = Российский рубль"
|
13 |
+
"Default","По умолчанию"
|
14 |
+
"Right","После цены"
|
15 |
+
"Left","Перед ценой"
|
16 |
+
"Do not use","не использовать"
|
17 |
+
"Use symbol","символ"
|
18 |
+
"Use short name","код"
|
19 |
+
"Use name","наименование"
|
20 |
+
"Yes","Да"
|
21 |
+
"No","Нет"
|
22 |
+
"Frontend specific options","Параметры для пользовательской части"
|
23 |
+
"Admin specific options","Параметры для панели администрирования"
|
24 |
+
"Currency options (global)","Параметры валюты (глобальные)"
|
25 |
+
"Currency options (for specific currency)","Параметры валюты (для конкретной валюты)"
|
26 |
+
"Exclude for checkout","Исключение для заказа"
|
27 |
+
"If Yes - options [Precision] and [Replace Zero Price] will not affect display of prices in checkout.","Если Да - параметры [Точность] и [Заменить нулевые цены] не будут влиять на отображение цены в заказе."
|
28 |
+
"Cut Zero Decimals","Отбрасывать нули после запятой"
|
29 |
+
"Cut Zero Decimals:","Отбрасывать нули после запятой:"
|
30 |
+
"If Yes price will be 99 instead of 99.00, but 99.99 if price 99.99","Если Да цена будет 99 вместо 99.00, но 99.99 при цене 99.99"
|
31 |
+
"Currency specific options","Параметры для конкретной валюты"
|
32 |
+
"Select currency:","Выберите валюту:"
|
33 |
+
"Symbol position:","Позиция символа:"
|
34 |
+
"Currency symbol use:","Обозначение валюты:"
|
35 |
+
"Replace symbol to:","Заменить символ на:"
|
36 |
+
"Replace Zero Price to:","Заменить нулевые цены на:"
|
37 |
+
"Add currency specific options","Добавить параметры, специфичные для валюты"
|
38 |
+
"Currency Manager information","Информация о модуле Currency Manager"
|
39 |
+
"Support by support@etwebsolutions.com <br /> You can hire our team for any customizations. Contact us at sales@etwebsolutions.com","Поддержка - support@etwebsolutions.com <br /> Вы можете нанять нашу команду для любых работ по Magento. Пишите на sales@etwebsolutions.com"
|
40 |
+
"Leave empty for disable replace","Оставьте пустым, если не хотите делать замену"
|
41 |
+
"Leave empty for global value use","Оставьте пустым для использования глобального значения"
|
42 |
+
"Used only if Cut Zero Decimals = Yes, default "",-""","Используется только при значении Отбрасывать нули после запятой = Да. По умолчанию: "",-"""
|
43 |
+
"Enable for Inputs","Применять для полей ввода цены"
|
44 |
+
"Suffix:","Заменить отброшенные нули на значение:"
|
45 |
+
"Replaces Cuted Zero Decimals","Заменить отброшенные нули на значение"
|
46 |
+
"Click here to configure currency additional display options","Перейти к дополнительным настройкам отображения валюты"
|
47 |
+
|
48 |
+
"Extension:","Модуль:"
|
49 |
+
"<strong>%s</strong> (version %s)","<strong>%s</strong> (версия %s)"
|
50 |
+
"License:","Лицензия:"
|
51 |
+
"Short Description:","Краткое описание:"
|
52 |
+
"Documentation:","Документация:"
|
53 |
+
"Support:","Поддержка:"
|
54 |
+
"Advertisement:","Реклама:"
|
55 |
+
"You can see description of extension features and answers to the frequently asked questions on <a href=""%s"" target=""_balnk"">our website</a>.","Описание позможностей модуля и ответы на часто задаваемые вопросы смотрите на <a href=""%s"" target=""_balnk"">нашем сайте</a>."
|
56 |
+
"You can hire our team to customize the extension. E-mail us on sales@etwebsolutions.com.<br><br>You can see a list of provided services on <a href=""%s"" target=""_blank"">our website</a>.","Вы можете нанять нашу команду для любых работ по модификации модуля. Пишите на адрес sales@etwebsolutions.com.<br><br>Со списком предоставляемых нами услуг вы можете ознакомиться <a href=""%s"" target=""_blank"">на нашем сайте</a>."
|
57 |
+
|
58 |
+
"Extension support is available through <a href=""%s"" target=""_blank"">issue tracking system</a>.<br>You can see information freely, but you will have to sign up to open a ticket.<br><br>Please, report all bugs and feature requests that are connected to this extension.<br><br>If by some reason you can not submit a question, bug report or feature request to our ticket system, you can write us an email - support@etwebsolutions.com.","Поддержка модуля осуществляется через <a href=""%s"" target=""_blank"">систему отслеживания заданий</a>.<br>Для создания задачи будет необходимо зарегистрироваться. Для просмотра информации регистрация не требуется.<br><br>Пожалуйста, сообщайте нам о найденных ошибках и о своих пожеланиях в рамках этого модуля.<br><br>Если по каким-либо причинам вы не можете размеситить вопрос/сообщение об ошибке/пожелание в списке задач, то можете написать нам по адресу support@etwebsolutions.com."
|
59 |
+
"",""
|
60 |
+
"",""
|
61 |
+
"",""
|
62 |
+
"",""
|
63 |
+
"",""
|
64 |
+
"",""
|
65 |
+
"",""
|
66 |
+
"",""
|
package.xml
CHANGED
@@ -1,22 +1,22 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>ET_CurrencyManager</name>
|
4 |
-
<version>0.
|
5 |
<stability>stable</stability>
|
6 |
-
<license uri="http://
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Currency Manager module allow to change in admin currency's display parametrs.</summary>
|
10 |
-
<description>Currency Manager module allow to change in admin currency's display parametrs
|
11 |
-
* symbol
|
12 |
-
* precision
|
13 |
-
* symbol position
|
14 |
* symbol type (name, short name/code, symbol)</description>
|
15 |
<notes>stable release</notes>
|
16 |
-
<authors><author><name>Jurij</name><user>
|
17 |
-
<date>2012-
|
18 |
-
<time>
|
19 |
-
<contents><target name="
|
20 |
<compatible/>
|
21 |
-
<dependencies
|
22 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>ET_CurrencyManager</name>
|
4 |
+
<version>1.0.0</version>
|
5 |
<stability>stable</stability>
|
6 |
+
<license uri="http://shop.etwebsolutions.com/eng/etws-license-free-v1">ETWS Free License (EFL1)</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Currency Manager module allow to change in admin currency's display parametrs.</summary>
|
10 |
+
<description>Currency Manager module allow to change in admin currency's display parametrs:
|
11 |
+
* symbol
|
12 |
+
* precision
|
13 |
+
* symbol position
|
14 |
* symbol type (name, short name/code, symbol)</description>
|
15 |
<notes>stable release</notes>
|
16 |
+
<authors><author><name>Jurij</name><user>niro</user><email>support@etwebsolutions.com</email></author><author><name>Andrej</name><user>zlojd</user><email>support@etwebsolutions.com</email></author></authors>
|
17 |
+
<date>2012-09-12</date>
|
18 |
+
<time>08:19:38</time>
|
19 |
+
<contents><target name="magecommunity"><dir name="ET"><dir name="CurrencyManager"><dir name="Block"><dir name="Adminhtml"><file name="Formprice.php" hash="787bb8c6466fd5b58edff9119aeca6f0"/><file name="Heading.php" hash="2bc94642d582b2b1410fd03c812801bb"/><file name="Support.php" hash="c6a46702557a855dbdedd370f8981551"/><file name="Symbolreplace.php" hash="575dd05525aaa2fba90fa17703db373b"/><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Linktooptions.php" hash="254eef26e1ae0edecc76a31541b244ae"/></dir></dir></dir></dir></dir><file name="Js.php" hash="086a2b3e70400c840615fd499ab5883e"/></dir><dir name="Helper"><file name="Data.php" hash="ef84054e143628a119dfbe93ef97e08c"/></dir><dir name="Model"><file name="Currency.php" hash="6cb15c536e758b727dcb291f5bb6d0d6"/><file name="Locale.php" hash="5f4d8d523f8d7a351f5afc952cdc9dd5"/><file name="Store.php" hash="c4894be6525eca58ef8efa909f87f959"/><file name="Typeposition.php" hash="9132477fac1f0bc56be36e18613ff23c"/><file name="Typesymboluse.php" hash="50b7bdd60eb040007f1b8f5bd9486b19"/></dir><dir name="etc"><file name="config.xml" hash="6f4323bf8cfbb16d807560bc518644de"/><file name="system.xml" hash="9e055baa423482a3e3b3970f3aa9479e"/></dir></dir><file name="ET_CurrencyManager_ChangeLog.txt" hash="a593a207743738208643a01980faa343"/><file name="ET_CurrencyManager_Description.txt" hash="8173c4954c3817d7ca455d47ab1054c0"/><file name="ET_CurrencyManager_LICENSE.txt" hash="c6b1377314f742d1cc53bbe1c23730be"/></dir></target><target name="magelocale"><dir name="ru_RU"><file name="ET_Currencymanager.csv" hash="4e3660d05aeb3623031169a55d34d649"/></dir><dir name="en_US"><file name="ET_Currencymanager.csv" hash="c763398c9a2bcba295fe3ba623b6614f"/></dir></target><target name="mageetc"><dir name="modules"><file name="ET_CurrencyManager.xml" hash="3c6bef9710e3c4922e45f962a41e1f9e"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="et_currencymanager.xml" hash="4f533fa64b1efdbc9c31fd974ffb534d"/></dir><dir name="template"><dir name="et_currencymanager"><file name="js.phtml" hash="0274f020be65ff87521d1ba053a31ad3"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="default"><dir name="default"><dir name="et_currencymanager"><file name="et_currencymanager.js" hash="0776bdd6350c39ce01a8a4846033697f"/><file name="et_currencymanager_round.js" hash="9eb7672b6a03669463c8caa22e4c7d44"/></dir></dir></dir></dir></target></contents>
|
20 |
<compatible/>
|
21 |
+
<dependencies><required><php><min>5.0.0</min><max>6.0.0</max></php></required></dependencies>
|
22 |
</package>
|
skin/frontend/default/default/et_currencymanager/et_currencymanager.js
CHANGED
@@ -1,15 +1,15 @@
|
|
1 |
var globalCutZeroSignPrice=true;
|
2 |
if(typeof(Product)!="undefined"){
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
}
|
1 |
var globalCutZeroSignPrice=true;
|
2 |
if(typeof(Product)!="undefined"){
|
3 |
+
Product.OptionsPrice.prototype=Object.extend(Product.OptionsPrice.prototype, {formatPrice:function(price)
|
4 |
+
{
|
5 |
+
var tmpPriceFormat = Object.clone(this.priceFormat);
|
6 |
+
if(price-parseInt(price)==0){
|
7 |
+
tmpPriceFormat.precision=0;
|
8 |
+
tmpPriceFormat.requiredPrecision=0;
|
9 |
+
}
|
10 |
+
if(tmpPriceFormat.precision<0)tmpPriceFormat.precision=0;
|
11 |
+
if(tmpPriceFormat.requiredPrecision<0)tmpPriceFormat.requiredPrecision=0;
|
12 |
+
var price2return = formatCurrency(price, tmpPriceFormat);
|
13 |
+
return price2return;
|
14 |
+
}});
|
15 |
}
|
skin/frontend/default/default/et_currencymanager/et_currencymanager_round.js
CHANGED
@@ -1,90 +1,165 @@
|
|
1 |
-
if(typeof(Product)!="undefined"){
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
}
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
90 |
}
|
1 |
+
if (typeof(Product) != "undefined") {
|
2 |
+
Product.Config.prototype = Object.extend(Product.Config.prototype, {
|
3 |
+
formatPrice:function (price, showSign) {
|
4 |
+
var str = '';
|
5 |
+
price = parseFloat(price);
|
6 |
+
if (showSign) {
|
7 |
+
if (price < 0) {
|
8 |
+
str += '-';
|
9 |
+
price = -price;
|
10 |
+
}
|
11 |
+
else {
|
12 |
+
str += '+';
|
13 |
+
}
|
14 |
+
}
|
15 |
+
|
16 |
+
var roundedPrice = (Math.round(price * 100) / 100).toString();
|
17 |
+
|
18 |
+
if (this.prices && this.prices[roundedPrice]) {
|
19 |
+
str += this.prices[roundedPrice];
|
20 |
+
}
|
21 |
+
else {
|
22 |
+
precision = 2;
|
23 |
+
if (typeof(etCurrencyManagerJsConfig.precision) != "undefined") {
|
24 |
+
precision = etCurrencyManagerJsConfig.precision;
|
25 |
+
}
|
26 |
+
if (typeof(optionsPrice) != "undefined") {
|
27 |
+
if (typeof(optionsPrice.priceFormat) != "undefined") {
|
28 |
+
precision = optionsPrice.priceFormat.requiredPrecision;
|
29 |
+
}
|
30 |
+
}
|
31 |
+
if (typeof(etCurrencyManagerJsConfig.cutzerodecimal) != "undefined") {
|
32 |
+
if (etCurrencyManagerJsConfig.cutzerodecimal != 0) {
|
33 |
+
if (price - Math.round(price) == 0) {
|
34 |
+
precision = 0;
|
35 |
+
}
|
36 |
+
}
|
37 |
+
}
|
38 |
+
if (precision > 0) {
|
39 |
+
str += this.priceTemplate.evaluate({price:price.toFixed(precision)});
|
40 |
+
}
|
41 |
+
else {
|
42 |
+
if (typeof(etCurrencyManagerJsConfig.cutzerodecimal) != "undefined") {
|
43 |
+
if (etCurrencyManagerJsConfig.cutzerodecimal != 0) {
|
44 |
+
if (typeof(etCurrencyManagerJsConfig.cutzerodecimal_suffix) != "undefined") {
|
45 |
+
if (etCurrencyManagerJsConfig.cutzerodecimal_suffix.length > 0) {
|
46 |
+
price = price.toFixed(0) + "" + etCurrencyManagerJsConfig.cutzerodecimal_suffix;
|
47 |
+
}
|
48 |
+
}
|
49 |
+
}
|
50 |
+
}
|
51 |
+
str += this.priceTemplate.evaluate({price:price});
|
52 |
+
}
|
53 |
+
}
|
54 |
+
return str;
|
55 |
+
}
|
56 |
+
|
57 |
+
|
58 |
+
});
|
59 |
+
}
|
60 |
+
|
61 |
+
|
62 |
+
try {
|
63 |
+
|
64 |
+
originalFormatCurrency = window.formatCurrency;
|
65 |
+
|
66 |
+
window.formatCurrency = function formatCurrency(price, format, showPlus) {
|
67 |
+
//zeroSymbol
|
68 |
+
//JS round fix
|
69 |
+
price = Math.round(price * Math.pow(10, format.precision)) / Math.pow(10, format.precision);
|
70 |
+
if (price - Math.round(price) != 0) {
|
71 |
+
if (Math.abs(price - Math.round(price)) < 0.00000001) {
|
72 |
+
price = 0;
|
73 |
+
}
|
74 |
+
}
|
75 |
+
if (typeof(etCurrencyManagerJsConfig) != "undefined") {
|
76 |
+
if (price == 0) {
|
77 |
+
if (typeof(etCurrencyManagerJsConfig.zerotext) != "undefined") {
|
78 |
+
return etCurrencyManagerJsConfig.zerotext;
|
79 |
+
}
|
80 |
+
}
|
81 |
+
}
|
82 |
+
//cut zero decimal
|
83 |
+
if (price - Math.round(price) == 0) {
|
84 |
+
if (typeof(etCurrencyManagerJsConfig.cutzerodecimal) != "undefined") {
|
85 |
+
if (etCurrencyManagerJsConfig.cutzerodecimal != 0) {
|
86 |
+
format.precision = 0;
|
87 |
+
format.requiredPrecision = 0;
|
88 |
+
|
89 |
+
var for_replace = originalFormatCurrency(price, format, showPlus);
|
90 |
+
|
91 |
+
if (typeof(etCurrencyManagerJsConfig.cutzerodecimal_suffix) != "undefined") {
|
92 |
+
if (etCurrencyManagerJsConfig.cutzerodecimal_suffix.length > 0) {
|
93 |
+
return for_replace.replace(price, price + "" + etCurrencyManagerJsConfig.cutzerodecimal_suffix);
|
94 |
+
}
|
95 |
+
}
|
96 |
+
}
|
97 |
+
}
|
98 |
+
}
|
99 |
+
|
100 |
+
return formatCurrencyET(price, format, showPlus);
|
101 |
+
//if(format.precision<0)format.precision=0;
|
102 |
+
//if(format.requiredPrecision<0)format.requiredPrecision=0;
|
103 |
+
/*return originalFormatCurrency(price, format, showPlus);*/
|
104 |
+
|
105 |
+
|
106 |
+
}
|
107 |
+
|
108 |
+
|
109 |
+
function formatCurrencyET(price, format, showPlus) {
|
110 |
+
var precision = isNaN(format.precision = (format.precision)) ? 2 : format.precision;
|
111 |
+
var requiredPrecision = isNaN(format.requiredPrecision = (format.requiredPrecision)) ? 2 : format.requiredPrecision;
|
112 |
+
|
113 |
+
//precision = (precision > requiredPrecision) ? precision : requiredPrecision;
|
114 |
+
//for now we don't need this difference so precision is requiredPrecision
|
115 |
+
precision = requiredPrecision;
|
116 |
+
|
117 |
+
var integerRequired = isNaN(format.integerRequired = Math.abs(format.integerRequired)) ? 1 : format.integerRequired;
|
118 |
+
|
119 |
+
var decimalSymbol = format.decimalSymbol == undefined ? "," : format.decimalSymbol;
|
120 |
+
var groupSymbol = format.groupSymbol == undefined ? "." : format.groupSymbol;
|
121 |
+
var groupLength = format.groupLength == undefined ? 3 : format.groupLength;
|
122 |
+
|
123 |
+
var s = '';
|
124 |
+
|
125 |
+
if (showPlus == undefined || showPlus == true) {
|
126 |
+
s = price < 0 ? "-" : ( showPlus ? "+" : "");
|
127 |
+
} else if (showPlus == false) {
|
128 |
+
s = '';
|
129 |
+
}
|
130 |
+
|
131 |
+
var i = parseInt(price = Math.abs(+price || 0).toFixed(precision)) + "";
|
132 |
+
var pad = (i.length < integerRequired) ? (integerRequired - i.length) : 0;
|
133 |
+
while (pad) {
|
134 |
+
i = '0' + i;
|
135 |
+
pad--;
|
136 |
+
}
|
137 |
+
j = (j = i.length) > groupLength ? j % groupLength : 0;
|
138 |
+
re = new RegExp("(\\d{" + groupLength + "})(?=\\d)", "g");
|
139 |
+
|
140 |
+
/**
|
141 |
+
* replace(/-/, 0) is only for fixing Safari bug which appears
|
142 |
+
* when Math.abs(0).toFixed() executed on "0" number.
|
143 |
+
* Result is "0.-0" :(
|
144 |
+
*/
|
145 |
+
if (precision < 0) {
|
146 |
+
precision = 0;
|
147 |
+
}
|
148 |
+
var r = (j ? i.substr(0, j) + groupSymbol : "") + i.substr(j).replace(re, "$1" + groupSymbol) + (precision ? decimalSymbol + Math.abs(price - i).toFixed(precision).replace(/-/, 0).slice(2) : "")
|
149 |
+
var pattern = '';
|
150 |
+
if (format.pattern.indexOf('{sign}') == -1) {
|
151 |
+
pattern = s + format.pattern;
|
152 |
+
} else {
|
153 |
+
pattern = format.pattern.replace('{sign}', s);
|
154 |
+
}
|
155 |
+
|
156 |
+
return pattern.replace('%s', r).replace(/^\s\s*/, '').replace(/\s\s*$/, '');
|
157 |
+
}
|
158 |
+
|
159 |
+
;
|
160 |
+
|
161 |
+
|
162 |
+
}
|
163 |
+
catch (e) {
|
164 |
+
//do nothing
|
165 |
}
|