ET_CurrencyManager - Version 0.2.0

Version Notes

stable release

Download this release

Release Info

Developer Magento Core Team
Extension ET_CurrencyManager
Version 0.2.0
Comparing to
See all releases


Code changes from version 0.1.4 to 0.2.0

app/code/community/ET/CurrencyManager/Block/Adminhtml/Heading.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ET Web Solutions
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
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) 2011 ET Web Solutions (http://etwebsolutions.com)
17
+ * @contacts support@etwebsolutions.com
18
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
19
+ */
20
+
21
+ if (version_compare(Mage::getVersion(), '1.4', '<'))
22
+ {
23
+ class ET_CurrencyManager_Block_Adminhtml_Heading extends Mage_Adminhtml_Block_Abstract implements Varien_Data_Form_Element_Renderer_Interface
24
+ {
25
+ public function render(Varien_Data_Form_Element_Abstract $element)
26
+ {
27
+ $useContainerId = $element->getData('use_container_id');
28
+ return sprintf('<tr class="system-fieldset-sub-head" id="row_%s"><td colspan="5"><h4 id="%s">%s</h4></td></tr>',
29
+ $element->getHtmlId(), $element->getHtmlId(), $element->getLabel()
30
+ );
31
+ }
32
+ }
33
+ }
34
+ else
35
+ {
36
+ class ET_CurrencyManager_Block_Adminhtml_Heading extends Mage_Adminhtml_Block_System_Config_Form_Field_Heading
37
+ {
38
+ }
39
+ }
app/code/community/ET/CurrencyManager/Block/Adminhtml/Symbolreplace.php CHANGED
@@ -16,68 +16,105 @@
16
  * @copyright Copyright (c) 2010 ET Web Solutions (http://etwebsolutions.com)
17
  * @contacts support@etwebsolutions.com
18
  * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
19
- */
20
 
21
- class ET_CurrencyManager_Block_Adminhtml_Symbolreplace
22
- extends Mage_Adminhtml_Block_System_Config_Form_Field
23
  {
24
- protected $_addRowButtonHtml = array();
25
- protected $_removeRowButtonHtml = array();
26
-
27
- protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
28
- {
29
- $this->setElement($element);
30
-
31
- $html = '<div id="symbolreplace_template" style="display:none">';
32
- $html .= $this->_getRowTemplateHtml();
33
- $html .= '</div>';
34
-
35
- $html .= '<ul id="symbolreplace_container">';
36
- if ($this->_getValue('currency')) {
37
- foreach ($this->_getValue('currency') as $i=>$f) {
38
- if ($i) {
39
- $html .= $this->_getRowTemplateHtml($i);
40
- }
41
- }
42
- }
43
- $html .= '</ul>';
44
- $html .= $this->_getAddRowButtonHtml('symbolreplace_container',
45
- 'symbolreplace_template', $this->__('Add currency symbol replace'));
46
-
47
- return $html;
48
- }
49
-
50
- protected function _getRowTemplateHtml($i=0)
51
- {
52
-
53
- $html = '<li>';
54
- $html .= '<select name="'.$this->getElement()->getName().'[currency][]" '.$this->_getDisabled().'>';
55
- $html .= '<option value="">'.$this->__('* Select currency').'</option>';
56
- foreach ($this->getAllowedCurrencies() as $currencyCode=>$currency)
 
 
 
 
 
57
  {
58
  $html .= '<option value="'.$currencyCode.'" '.$this->_getSelected('currency/'.$i, $currencyCode).' style="background:white;">'.$currency. " - " .$currencyCode.'</option>';
59
- }
60
- $html .= '</select>';
61
 
62
- $html .= '<div style="margin:5px 0 10px;">';
63
- $html .= '<label>'.$this->__('New symbol:').' </label> ';
64
- $html .= '<input class="input-text" style="width:70px;" name="'.$this->getElement()->getName().'[symbol][]" value="'.$this->_getValue('symbol/'.$i).'" '.$this->_getDisabled().'/> ';
65
 
66
- $html .= $this->_getRemoveRowButtonHtml();
67
- $html .= '</div>';
68
- $html .= '</li>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
69
 
70
- return $html;
71
- }
 
72
 
73
- protected function getAllowedCurrencies()
74
- {
 
 
75
 
76
- if (!$this->hasData('allowed_currencies'))
 
 
 
 
 
 
77
  {
78
  $currencies = Mage::app()->getLocale()->getOptionCurrencies();
79
- $allowed_currency_codes = Mage::getSingleton('directory/currency')->getConfigAllowCurrencies();
80
-
81
  $formatet_currencies = array();
82
  foreach ($currencies as $k=>$currency)
83
  $formatet_currencies[$currency['value']]['label'] = $currency['label'];
@@ -86,53 +123,55 @@ class ET_CurrencyManager_Block_Adminhtml_Symbolreplace
86
  foreach ($allowed_currency_codes as $k=>$currencyCode)
87
  $allowed_currencies[$currencyCode] = $formatet_currencies[$currencyCode]['label'];
88
 
89
- $this->setData('allowed_currencies', $allowed_currencies);
90
- }
91
- return $this->getData('allowed_currencies');
92
- }
93
-
94
- protected function _getDisabled()
95
- {
96
- return $this->getElement()->getDisabled() ? ' disabled' : '';
97
- }
98
-
99
- protected function _getValue($key)
100
- {
101
- return $this->getElement()->getData('value/'.$key);
102
- }
103
-
104
- protected function _getSelected($key, $value)
105
- {
106
- return $this->getElement()->getData('value/'.$key)==$value ? 'selected="selected"' : '';
107
- }
108
-
109
- protected function _getAddRowButtonHtml($container, $template, $title='Add')
110
- {
111
- if (!isset($this->_addRowButtonHtml[$container])) {
112
- $this->_addRowButtonHtml[$container] = $this->getLayout()->createBlock('adminhtml/widget_button')
113
- ->setType('button')
114
- ->setClass('add '.$this->_getDisabled())
115
- ->setLabel($this->__($title))
116
- //$this->__('Add')
117
- ->setOnClick("Element.insert($('".$container."'), {bottom: $('".$template."').innerHTML})")
118
- ->setDisabled($this->_getDisabled())
119
- ->toHtml();
120
- }
121
- return $this->_addRowButtonHtml[$container];
122
- }
123
-
124
- protected function _getRemoveRowButtonHtml($selector='li', $title='Remove')
125
- {
126
- if (!$this->_removeRowButtonHtml) {
127
- $this->_removeRowButtonHtml = $this->getLayout()->createBlock('adminhtml/widget_button')
128
- ->setType('button')
129
- ->setClass('delete v-middle '.$this->_getDisabled())
130
- ->setLabel($this->__($title))
131
- //$this->__('Remove')
132
- ->setOnClick("Element.remove($(this).up('".$selector."'))")
133
- ->setDisabled($this->_getDisabled())
134
- ->toHtml();
135
- }
136
- return $this->_removeRowButtonHtml;
137
- }
 
 
138
  }
16
  * @copyright Copyright (c) 2010 ET Web Solutions (http://etwebsolutions.com)
17
  * @contacts support@etwebsolutions.com
18
  * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
19
+ */
20
 
21
+ class ET_CurrencyManager_Block_Adminhtml_Symbolreplace extends Mage_Adminhtml_Block_System_Config_Form_Field
 
22
  {
23
+ protected $_addRowButtonHtml = array();
24
+ protected $_removeRowButtonHtml = array();
25
+
26
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
27
+ {
28
+ $this->setElement($element);
29
+
30
+ $html = '<div id="symbolreplace_template" style="display:none">';
31
+ $html .= $this->_getRowTemplateHtml();
32
+ $html .= '</div>';
33
+
34
+ $html .= '<ul id="symbolreplace_container">';
35
+ if ($this->_getValue('currency')) {
36
+ foreach ($this->_getValue('currency') as $i=>$f)
37
+ {
38
+ if ($i)
39
+ {
40
+ $html .= $this->_getRowTemplateHtml($i);
41
+ }
42
+ }
43
+ }
44
+ $html .= '</ul>';
45
+ $html .= $this->_getAddRowButtonHtml('symbolreplace_container',
46
+ 'symbolreplace_template', $this->__('Add currency specific options'));
47
+
48
+ return $html;
49
+ }
50
+
51
+ protected function _getRowTemplateHtml($i=0)
52
+ {
53
+
54
+ $html = '<li><fieldset>';
55
+ $html .= '<label>'.$this->__('Select currency:').' </label> ';
56
+
57
+ $html .= '<select name="'.$this->getElement()->getName().'[currency][]" '.$this->_getDisabled().'>';
58
+
59
+ $html .= '<option value="">'.$this->__('* Select currency').'</option>';
60
+ foreach ($this->getAllowedCurrencies() as $currencyCode=>$currency)
61
  {
62
  $html .= '<option value="'.$currencyCode.'" '.$this->_getSelected('currency/'.$i, $currencyCode).' style="background:white;">'.$currency. " - " .$currencyCode.'</option>';
63
+ }
64
+ $html .= '</select>';
65
 
66
+ $html .= '<label>'.$this->__('Precision:').' </label> ';
67
+ $html .= '<input class="input-text" name="'.$this->getElement()->getName().'[precision][]" value="'.$this->_getValue('precision/'.$i).'" '.$this->_getDisabled().'/> ';
68
+ $html .= '<p class="nm"><small>' . $this->__('Leave empty for global value use') . '</small></p>';
69
 
70
+ $html .= '<label>'.$this->__('Cut Zero Decimals:').' </label> ';
71
+ $html .= '<select class="input-text" name="'.$this->getElement()->getName().'[cutzerodecimal][]">';
72
+ foreach(Mage::getModel("adminhtml/system_config_source_yesno")->toOptionArray() as $labelValue)
73
+ {
74
+ $html .= '<option value="'.$labelValue["value"].'" '.($this->_getValue('cutzerodecimal/'.$i)==$labelValue["value"]?'selected="selected"':'').'>'.$labelValue["label"]."</option>";
75
+ }
76
+ $html .= '</select>';
77
+
78
+ $html .= '<label>'.$this->__('Symbol position:').' </label> ';
79
+ $html .= '<select class="input-text" name="'.$this->getElement()->getName().'[position][]">';
80
+ foreach(Mage::getModel("currencymanager/typeposition")->toOptionArray() as $labelValue)
81
+ {
82
+ $html .= '<option value="'.$labelValue["value"].'" '.($this->_getValue('position/'.$i)==$labelValue["value"]?'selected="selected"':'').'>'.$labelValue["label"]."</option>";
83
+ }
84
+ $html .= '</select>';
85
+
86
+ $html .= '<label>'.$this->__('Currency symbol use:').' </label> ';
87
+ $html .= '<select class="input-text" name="'.$this->getElement()->getName().'[display][]">';
88
+ foreach(Mage::getModel("currencymanager/typesymboluse")->toOptionArray() as $labelValue)
89
+ {
90
+ $html .= '<option value="'.$labelValue["value"].'" '.($this->_getValue('display/'.$i)==$labelValue["value"]?'selected="selected"':'').'>'.$labelValue["label"]."</option>";
91
+ }
92
+ $html .= '</select>';
93
+
94
+ $html .= '<label>'.$this->__('Replace symbol to:').' </label> ';
95
+ $html .= '<input class="input-text" name="'.$this->getElement()->getName().'[symbol][]" value="'.$this->_getValue('symbol/'.$i).'" '.$this->_getDisabled().'/> ';
96
+ $html .= '<p class="nm"><small>' . $this->__('Leave empty for disable replace') . '</small></p>';
97
 
98
+ $html .= '<label>'.$this->__('Replace Zero Price to:').' </label> ';
99
+ $html .= '<input class="input-text" name="'.$this->getElement()->getName().'[zerotext][]" value="'.$this->_getValue('zerotext/'.$i).'" '.$this->_getDisabled().'/> ';
100
+ $html .= '<p class="nm"><small>' . $this->__('Leave empty for disable replace') . '</small></p>';
101
 
102
+ $html .= '<br /> <br />';
103
+ $html .= $this->_getRemoveRowButtonHtml();
104
+ //$html .= '</div>';
105
+ $html .= '</fieldset></li>';
106
 
107
+ return $html;
108
+ }
109
+
110
+ protected function getAllowedCurrencies()
111
+ {
112
+
113
+ if (!$this->hasData('allowed_currencies'))
114
  {
115
  $currencies = Mage::app()->getLocale()->getOptionCurrencies();
116
+ $allowed_currency_codes = Mage::getSingleton('directory/currency')->getConfigAllowCurrencies();
117
+
118
  $formatet_currencies = array();
119
  foreach ($currencies as $k=>$currency)
120
  $formatet_currencies[$currency['value']]['label'] = $currency['label'];
123
  foreach ($allowed_currency_codes as $k=>$currencyCode)
124
  $allowed_currencies[$currencyCode] = $formatet_currencies[$currencyCode]['label'];
125
 
126
+ $this->setData('allowed_currencies', $allowed_currencies);
127
+ }
128
+ return $this->getData('allowed_currencies');
129
+ }
130
+
131
+ protected function _getDisabled()
132
+ {
133
+ return $this->getElement()->getDisabled() ? ' disabled' : '';
134
+ }
135
+
136
+ protected function _getValue($key)
137
+ {
138
+ return $this->getElement()->getData('value/'.$key);
139
+ }
140
+
141
+ protected function _getSelected($key, $value)
142
+ {
143
+ return $this->getElement()->getData('value/'.$key)==$value ? 'selected="selected"' : '';
144
+ }
145
+
146
+ protected function _getAddRowButtonHtml($container, $template, $title='Add')
147
+ {
148
+ if (!isset($this->_addRowButtonHtml[$container]))
149
+ {
150
+ $this->_addRowButtonHtml[$container] = $this->getLayout()->createBlock('adminhtml/widget_button')
151
+ ->setType('button')
152
+ ->setClass('add '.$this->_getDisabled())
153
+ ->setLabel($this->__($title))
154
+ //$this->__('Add')
155
+ ->setOnClick("Element.insert($('".$container."'), {bottom: $('".$template."').innerHTML})")
156
+ ->setDisabled($this->_getDisabled())
157
+ ->toHtml();
158
+ }
159
+ return $this->_addRowButtonHtml[$container];
160
+ }
161
+
162
+ protected function _getRemoveRowButtonHtml($selector='li', $title='Remove')
163
+ {
164
+ if (!$this->_removeRowButtonHtml)
165
+ {
166
+ $this->_removeRowButtonHtml = $this->getLayout()->createBlock('adminhtml/widget_button')
167
+ ->setType('button')
168
+ ->setClass('delete v-middle '.$this->_getDisabled())
169
+ ->setLabel($this->__($title))
170
+ //$this->__('Remove')
171
+ ->setOnClick("Element.remove($(this).up('".$selector."'))")
172
+ ->setDisabled($this->_getDisabled())
173
+ ->toHtml();
174
+ }
175
+ return $this->_removeRowButtonHtml;
176
+ }
177
  }
app/code/community/ET/CurrencyManager/Helper/Data.php CHANGED
@@ -16,7 +16,7 @@
16
  * @copyright Copyright (c) 2010 ET Web Solutions (http://etwebsolutions.com)
17
  * @contacts support@etwebsolutions.com
18
  * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
19
- */
20
 
21
  class ET_CurrencyManager_Helper_Data extends Mage_Core_Helper_Abstract
22
  {
@@ -24,23 +24,30 @@ class ET_CurrencyManager_Helper_Data extends Mage_Core_Helper_Abstract
24
  * ZEND constants avalable in /lib/Zend/Currency.php
25
  *
26
  * NOTICE
27
- *
28
  * Magento ver 1.3.x - display - USE_SHORTNAME(3) by default
29
  * Magento ver 1.4.x - display - USE_SYMBOL(2) by default
30
- *
31
  * position: 8 - standart; 16 - right; 32 - left
32
- *
33
  */
34
 
35
- protected $_options=array();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
 
37
- public function getOptions($options=array())
38
- {
39
- $storeId=Mage::app()->getStore()->getStoreId();
40
- if (!isset($this->_options[$storeId])) {
41
- $this->setOptions();
42
- }
43
- $newOptions=$this->_options[$storeId];
44
  // For JavaScript prices: Strange Symbol extracting in function getOutputFormat in file app/code/core/Mage/Directory/Model/Currency.php
45
  // For Configurable, Bundle and Simple with custom options
46
  // This causes problem if any currency has by default NO_SYMBOL
@@ -51,48 +58,94 @@ class ET_CurrencyManager_Helper_Data extends Mage_Core_Helper_Abstract
51
  return $newOptions + $options;
52
  else
53
  return $newOptions;
54
- }
 
55
 
 
 
 
 
 
 
56
 
57
 
58
  public function setOptions()
59
  {
60
- // TODO ?
61
- // IF i become not empty options array What to do?
62
-
63
- $config = Mage::getStoreConfig('currencymanager/general');
64
- $options=array();
65
- $storeId=Mage::app()->getStore()->getStoreId();
66
- if ((($config['enabled'])&&($storeId>0))
67
- ||(($config['enabledadm'])&&($storeId==0))){
68
-
69
- if (isset($config['precision'])) // precision must be in range -1 .. 30
70
  $options['precision'] = min(30, max(-1, (int)$config['precision']));
71
 
72
- if (isset($config['position']))$options['position'] = (int)$config['position'];
73
- if (isset($config['display']))$options['display'] = (int)$config['display'];
 
 
74
 
75
  // formating symbols from admin, preparing to use. Maybe can better :)
76
- // ���� ������� ����� ������� ��������� �������� ��� ����� ������, �� �������������� ����� ������ ����
77
- if(isset($config['symbolreplace'])){
78
- $symbolreplace = unserialize($config['symbolreplace']);
 
79
  foreach($symbolreplace['currency'] as $symbolreplaceKey=>$symbolreplaceValue)
80
- if(strlen(trim($symbolreplace['currency'][$symbolreplaceKey]))==0){
 
81
  unset($symbolreplace['currency'][$symbolreplaceKey]);
 
 
 
 
82
  unset($symbolreplace['symbol'][$symbolreplaceKey]);
83
- }
 
84
 
85
- if(count($symbolreplace['currency'])>0){
86
- $symbols = array_combine($symbolreplace['currency'], $symbolreplace['symbol']);
87
 
 
 
88
  $displayCurrencyCode = Mage::app()->getStore()-> getCurrentCurrencyCode(); //geting current display currency
89
- if (array_key_exists($displayCurrencyCode, $symbols))
90
- $options['symbol'] = $symbols[$displayCurrencyCode];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
91
  }
 
92
  }
 
93
  } // end NOT ENABLED
94
 
95
- $this->_options[$storeId] = $options;
 
 
96
  return $this;
97
  }
98
 
16
  * @copyright Copyright (c) 2010 ET Web Solutions (http://etwebsolutions.com)
17
  * @contacts support@etwebsolutions.com
18
  * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
19
+ */
20
 
21
  class ET_CurrencyManager_Helper_Data extends Mage_Core_Helper_Abstract
22
  {
24
  * ZEND constants avalable in /lib/Zend/Currency.php
25
  *
26
  * NOTICE
27
+ *
28
  * Magento ver 1.3.x - display - USE_SHORTNAME(3) by default
29
  * Magento ver 1.4.x - display - USE_SYMBOL(2) by default
30
+ *
31
  * position: 8 - standart; 16 - right; 32 - left
32
+ *
33
  */
34
 
35
+ protected $_options = array();
36
+ protected $_optionsadvanced = array();
37
+
38
+ public function getOptions($options=array(), $old=false) // $old - for support Magento 1.3.x
39
+ {
40
+ $storeId=Mage::app()->getStore()->getStoreId();
41
+ if ((!isset($this->_options[$storeId])) || (!isset($this->_optionsadvanced[$storeId])))
42
+ {
43
+ $this->setOptions();
44
+ }
45
+ $newOptions = $this->_options[$storeId];
46
+ $newOptionsAdvanced = $this->_optionsadvanced[$storeId];
47
+
48
+ if (!$old)
49
+ $newOptions = $newOptions + $newOptionsAdvanced;
50
 
 
 
 
 
 
 
 
51
  // For JavaScript prices: Strange Symbol extracting in function getOutputFormat 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
58
  return $newOptions + $options;
59
  else
60
  return $newOptions;
61
+ }
62
+
63
 
64
+ public function isEnabled()
65
+ {
66
+ $config = Mage::getStoreConfig('currencymanager/general');
67
+ $storeId = Mage::app()->getStore()->getStoreId();
68
+ return ((($config['enabled'])&&($storeId>0))||(($config['enabledadm'])&&($storeId==0)));
69
+ }
70
 
71
 
72
  public function setOptions()
73
  {
74
+ $config = Mage::getStoreConfig('currencymanager/general');
75
+ $moduleName = Mage::app()->getRequest()->getModuleName();
76
+ $options = array();
77
+ $optionsadvanced = array();
78
+ $storeId = Mage::app()->getStore()->getStoreId();
79
+ if ($this->isEnabled())
80
+ {
81
+ if (!($config['excludecheckout'] & ($moduleName == 'checkout')))
82
+ if (isset($config['precision'])) // precision must be in range -1 .. 30
 
83
  $options['precision'] = min(30, max(-1, (int)$config['precision']));
84
 
85
+ if (isset($config['position']))$options['position'] = (int)$config['position'];
86
+ if (isset($config['display']))$options['display'] = (int)$config['display'];
87
+ $optionsadvanced['excludecheckout'] = $config['excludecheckout'];
88
+ $optionsadvanced['cutzerodecimal'] = $config['cutzerodecimal'];
89
 
90
  // formating symbols from admin, preparing to use. Maybe can better :)
91
+ // если в админке будут внесены несколько значений для одной валюты, то использоваться будет только одна
92
+ if(isset($config['symbolreplace']))
93
+ {
94
+ $symbolreplace = unserialize($config['symbolreplace']);
95
  foreach($symbolreplace['currency'] as $symbolreplaceKey=>$symbolreplaceValue)
96
+ if(strlen(trim($symbolreplace['currency'][$symbolreplaceKey]))==0)
97
+ {
98
  unset($symbolreplace['currency'][$symbolreplaceKey]);
99
+ unset($symbolreplace['precision'][$symbolreplaceKey]);
100
+ unset($symbolreplace['cutzerodecimal'][$symbolreplaceKey]);
101
+ unset($symbolreplace['position'][$symbolreplaceKey]);
102
+ unset($symbolreplace['display'][$symbolreplaceKey]);
103
  unset($symbolreplace['symbol'][$symbolreplaceKey]);
104
+ unset($symbolreplace['zerotext'][$symbolreplaceKey]);
105
+ }
106
 
 
 
107
 
108
+ if(count($symbolreplace['currency'])>0)
109
+ {
110
  $displayCurrencyCode = Mage::app()->getStore()-> getCurrentCurrencyCode(); //geting current display currency
111
+
112
+ $configSubData = array_combine($symbolreplace['currency'], $symbolreplace['cutzerodecimal']);
113
+ if (array_key_exists($displayCurrencyCode, $configSubData))
114
+ $optionsadvanced['cutzerodecimal'] = (int)$configSubData[$displayCurrencyCode];
115
+
116
+ $configSubData = array_combine($symbolreplace['currency'], $symbolreplace['position']);
117
+ if (array_key_exists($displayCurrencyCode, $configSubData))
118
+ $options['position'] = (int)$configSubData[$displayCurrencyCode];
119
+
120
+ $configSubData = array_combine($symbolreplace['currency'], $symbolreplace['display']);
121
+ if (array_key_exists($displayCurrencyCode, $configSubData))
122
+ $options['display'] = (int)$configSubData[$displayCurrencyCode];
123
+
124
+ $configSubData = array_combine($symbolreplace['currency'], $symbolreplace['symbol']);
125
+ if (array_key_exists($displayCurrencyCode, $configSubData))
126
+ if($configSubData[$displayCurrencyCode]!="")
127
+ $options['symbol'] = $configSubData[$displayCurrencyCode];
128
+
129
+ if (!($config['excludecheckout'] & ($moduleName == 'checkout')))
130
+ {
131
+ $configSubData = array_combine($symbolreplace['currency'], $symbolreplace['zerotext']);
132
+ if (array_key_exists($displayCurrencyCode, $configSubData))
133
+ if($configSubData[$displayCurrencyCode]!="")
134
+ $optionsadvanced['zerotext'] = $configSubData[$displayCurrencyCode];
135
+
136
+ $configSubData = array_combine($symbolreplace['currency'], $symbolreplace['precision']);
137
+ if (array_key_exists($displayCurrencyCode, $configSubData))
138
+ if($configSubData[$displayCurrencyCode]!="")
139
+ $options['precision'] = min(30, max(-1, (int)$configSubData[$displayCurrencyCode]));
140
  }
141
+
142
  }
143
+ }
144
  } // end NOT ENABLED
145
 
146
+ $this->_options[$storeId] = $options;
147
+ $this->_optionsadvanced[$storeId] = $optionsadvanced;
148
+
149
  return $this;
150
  }
151
 
app/code/community/ET/CurrencyManager/Model/Currency.php CHANGED
@@ -16,34 +16,83 @@
16
  * @copyright Copyright (c) 2010 ET Web Solutions (http://etwebsolutions.com)
17
  * @contacts support@etwebsolutions.com
18
  * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
19
- */
20
 
21
  class ET_CurrencyManager_Model_Currency extends Mage_Directory_Model_Currency
22
  {
23
 
24
  /*
25
- public function format($price, $options=array(), $includeContainer = true, $addBrackets = false)
26
- {
27
  $config = Mage::getStoreConfig('currencymanager/general');
28
- $store = Mage::app()->getStore()->getStoreId();
29
 
30
  if (($config['enabledadm'])and($store=0))
31
  $options = Mage::helper('currencymanager')->getOptions($options);
32
 
33
  if (($config['enabled'])and($store>0))
34
  $options = Mage::helper('currencymanager')->getOptions($options);
35
-
36
  return parent::format($price, $options, $includeContainer, $addBrackets);
37
- }
38
- */
39
-
40
- public function formatTxt($price, $options=array())
41
- {
42
- $config = Mage::getStoreConfig('currencymanager/general');
43
- $store = Mage::app()->getStore()->getStoreId();
44
- $options = Mage::helper('currencymanager')->getOptions($options);
45
-
46
- return parent::formatTxt($price, $options);
47
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
 
49
  }
16
  * @copyright Copyright (c) 2010 ET Web Solutions (http://etwebsolutions.com)
17
  * @contacts support@etwebsolutions.com
18
  * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
19
+ */
20
 
21
  class ET_CurrencyManager_Model_Currency extends Mage_Directory_Model_Currency
22
  {
23
 
24
  /*
25
+ public function format($price, $options=array(), $includeContainer = true, $addBrackets = false)
26
+ {
27
  $config = Mage::getStoreConfig('currencymanager/general');
28
+ $store = Mage::app()->getStore()->getStoreId();
29
 
30
  if (($config['enabledadm'])and($store=0))
31
  $options = Mage::helper('currencymanager')->getOptions($options);
32
 
33
  if (($config['enabled'])and($store>0))
34
  $options = Mage::helper('currencymanager')->getOptions($options);
35
+
36
  return parent::format($price, $options, $includeContainer, $addBrackets);
37
+ }
38
+ */
39
+
40
+ public function getOutputFormat()
41
+ {
42
+ $formated = $this->formatTxt(1);
43
+ $number = $this->formatTxt(1, array('display'=>Zend_Currency::NO_SYMBOL));
44
+ return str_replace($number, '%s', $formated);
45
+ }
46
+
47
+ public function formatTxt($price, $options=array())
48
+ {
49
+ $answer = parent::formatTxt($price, $options);
50
+
51
+ if(Mage::helper('currencymanager')->isEnabled())
52
+ {
53
+ $store = Mage::app()->getStore()->getStoreId();
54
+ $moduleName = Mage::app()->getRequest()->getModuleName();
55
+ $optionsAdvanced = Mage::helper('currencymanager')->getOptions($options);
56
+ $options = Mage::helper('currencymanager')->getOptions($options,true);
57
+
58
+ $suffix = '';
59
+ // $suffix = ',-';
60
+ // $suffix = $optionsAdvanced['cutzerodecimal_suffix'];
61
+
62
+ if (count($options)>0)
63
+ {
64
+ if (!(($moduleName == 'checkout') & $optionsAdvanced['excludecheckout']))
65
+ {
66
+ if($price==0)
67
+ if(isset($optionsAdvanced['zerotext']))
68
+ if($optionsAdvanced['zerotext']!="")return $optionsAdvanced['zerotext'];
69
+
70
+ if ($optionsAdvanced['cutzerodecimal'] && (round($price,$optionsAdvanced['precision']) == round($price,0))) // cut decimal if it = 0
71
+ {
72
+ if ((isset($suffix)) && (strlen($suffix)>0)) // if need to add suffix
73
+ {
74
+ // searching for fully formatted currency without currency symbol
75
+ $options['display'] = Zend_Currency::NO_SYMBOL;
76
+ $answerBlank = parent::formatTxt($price, $options);
77
+
78
+ // searching for fully formatted currency without currency symbol and rounded to int
79
+ $options['precision'] = 0;
80
+ $answerRound = parent::formatTxt($price, $options);
81
+
82
+ // replace cutted decimals with suffix
83
+ $answer=str_replace($answerBlank,$answerRound.$suffix,$answer);
84
+ }
85
+ else // esle only changing precision
86
+ {
87
+ $options['precision'] = 0;
88
+ $answer = parent::formatTxt($price, $options);
89
+ }
90
+ }
91
+ }
92
+ }
93
+ }
94
+
95
+ return $answer;
96
+ }
97
 
98
  }
app/code/community/ET/CurrencyManager/Model/Locale.php CHANGED
@@ -16,15 +16,14 @@
16
  * @copyright Copyright (c) 2010 ET Web Solutions (http://etwebsolutions.com)
17
  * @contacts support@etwebsolutions.com
18
  * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
19
- */
20
-
21
 
22
  class ET_CurrencyManager_Model_Locale extends Mage_Core_Model_Locale
23
  {
24
  public function currency($ccode)
25
  {
26
  $admcurrency = parent::currency($ccode);
27
- $options = Mage::helper('currencymanager')->getOptions();
28
  $admcurrency->setFormat($options);
29
 
30
  return $admcurrency;
@@ -35,9 +34,12 @@ class ET_CurrencyManager_Model_Locale extends Mage_Core_Model_Locale
35
  {
36
  // For JavaScript prices
37
  $parentFormat=parent::getJsPriceFormat();
38
- $options = Mage::helper('currencymanager')->getOptions();
39
  if (isset($options["precision"]))
 
40
  $parentFormat["requiredPrecision"] = $options["precision"];
 
 
41
 
42
  return $parentFormat;
43
  }
16
  * @copyright Copyright (c) 2010 ET Web Solutions (http://etwebsolutions.com)
17
  * @contacts support@etwebsolutions.com
18
  * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
19
+ */
 
20
 
21
  class ET_CurrencyManager_Model_Locale extends Mage_Core_Model_Locale
22
  {
23
  public function currency($ccode)
24
  {
25
  $admcurrency = parent::currency($ccode);
26
+ $options = Mage::helper('currencymanager')->getOptions(array(),true);
27
  $admcurrency->setFormat($options);
28
 
29
  return $admcurrency;
34
  {
35
  // For JavaScript prices
36
  $parentFormat=parent::getJsPriceFormat();
37
+ $options = Mage::helper('currencymanager')->getOptions(array());
38
  if (isset($options["precision"]))
39
+ {
40
  $parentFormat["requiredPrecision"] = $options["precision"];
41
+ $parentFormat["precision"] = $options["precision"];
42
+ }
43
 
44
  return $parentFormat;
45
  }
app/code/community/ET/CurrencyManager/Model/Typeposition.php CHANGED
@@ -16,25 +16,21 @@
16
  * @copyright Copyright (c) 2010 ET Web Solutions (http://etwebsolutions.com)
17
  * @contacts support@etwebsolutions.com
18
  * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
19
- */
20
-
21
 
22
  class ET_CurrencyManager_Model_Typeposition extends Varien_Object
23
  {
24
-
25
- /**
26
- * Options getter
27
- *
28
- * @return array
29
- */
30
- public function toOptionArray()
31
- {
32
- return array(
33
- array('value' => 8, 'label'=>Mage::helper('currencymanager')->__('Default')),
34
- array('value' => 16, 'label'=>Mage::helper('currencymanager')->__('Right')),
35
- array('value' => 32, 'label'=>Mage::helper('currencymanager')->__('Left'))
36
-
37
- );
38
- }
39
-
40
- }
16
  * @copyright Copyright (c) 2010 ET Web Solutions (http://etwebsolutions.com)
17
  * @contacts support@etwebsolutions.com
18
  * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
19
+ */
 
20
 
21
  class ET_CurrencyManager_Model_Typeposition extends Varien_Object
22
  {
23
+ /**
24
+ * Options getter
25
+ *
26
+ * @return array
27
+ */
28
+ public function toOptionArray()
29
+ {
30
+ return array(
31
+ array('value' => 8, 'label'=>Mage::helper('currencymanager')->__('Default')),
32
+ array('value' => 16, 'label'=>Mage::helper('currencymanager')->__('Right')),
33
+ array('value' => 32, 'label'=>Mage::helper('currencymanager')->__('Left'))
34
+ );
35
+ }
36
+ }
 
 
 
app/code/community/ET/CurrencyManager/Model/Typesymboluse.php CHANGED
@@ -16,26 +16,22 @@
16
  * @copyright Copyright (c) 2010 ET Web Solutions (http://etwebsolutions.com)
17
  * @contacts support@etwebsolutions.com
18
  * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
19
- */
20
-
21
 
22
  class ET_CurrencyManager_Model_Typesymboluse extends Varien_Object
23
  {
24
-
25
- /**
26
- * Options getter
27
- *
28
- * @return array
29
- */
30
- public function toOptionArray()
31
- {
32
- return array(
33
- array('value' => 1, 'label'=>Mage::helper('currencymanager')->__('Do not use')),
34
- array('value' => 2, 'label'=>Mage::helper('currencymanager')->__('Use symbol')),
35
- array('value' => 3, 'label'=>Mage::helper('currencymanager')->__('Use short name')),
36
- array('value' => 4, 'label'=>Mage::helper('currencymanager')->__('Use name'))
37
-
38
- );
39
- }
40
-
41
  }
16
  * @copyright Copyright (c) 2010 ET Web Solutions (http://etwebsolutions.com)
17
  * @contacts support@etwebsolutions.com
18
  * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
19
+ */
 
20
 
21
  class ET_CurrencyManager_Model_Typesymboluse extends Varien_Object
22
  {
23
+ /**
24
+ * Options getter
25
+ *
26
+ * @return array
27
+ */
28
+ public function toOptionArray()
29
+ {
30
+ return array(
31
+ array('value' => 1, 'label'=>Mage::helper('currencymanager')->__('Do not use')),
32
+ array('value' => 2, 'label'=>Mage::helper('currencymanager')->__('Use symbol')),
33
+ array('value' => 3, 'label'=>Mage::helper('currencymanager')->__('Use short name')),
34
+ array('value' => 4, 'label'=>Mage::helper('currencymanager')->__('Use name'))
35
+ );
36
+ }
 
 
 
37
  }
app/code/community/ET/CurrencyManager/etc/config.xml CHANGED
@@ -20,114 +20,123 @@
20
  */
21
  -->
22
  <config>
23
- <modules>
24
- <ET_CurrencyManager>
25
- <version>0.1.4</version>
26
  <descr>
27
- <ru_RU>
28
- Позволяет управлять значениями локализации для валюты. Например: кол-во знаков после запятой для цены или символ валюты.
29
- </ru_RU>
30
- <en_US>
31
- Allow to change localization options for currency. Example: currency symbol or price decimals.
32
- </en_US>
33
  </descr>
34
- </ET_CurrencyManager>
35
- </modules>
36
 
37
  <global>
38
- <helpers>
39
- <currencymanager>
40
- <class>ET_CurrencyManager_Helper</class>
41
- </currencymanager>
42
- </helpers>
43
- <models>
44
- <directory>
45
- <rewrite>
46
- <currency>ET_CurrencyManager_Model_Currency</currency>
47
- </rewrite>
48
- </directory>
49
 
50
- <core>
51
- <rewrite>
52
- <locale>ET_CurrencyManager_Model_Locale</locale>
53
- </rewrite>
54
- </core>
55
 
56
  <currencymanager>
57
  <class>ET_CurrencyManager_Model</class>
58
  </currencymanager>
59
- </models>
60
  <blocks>
61
- <currencymanager>
62
  <class>ET_CurrencyManager_Block</class>
63
  </currencymanager>
64
- </blocks>
65
- <resources>
66
- <currencymanager_setup>
67
- <setup>
68
- <module>ET_CurrencyManager</module>
69
- </setup>
70
- <connection>
71
- <use>core_setup</use>
72
- </connection>
73
- </currencymanager_setup>
74
- <currencymanager_write>
75
- <connection>
76
- <use>core_write</use>
77
- </connection>
78
- </currencymanager_write>
79
- <currencymanager_read>
80
- <connection>
81
- <use>core_read</use>
82
- </connection>
83
- </currencymanager_read>
84
- </resources>
85
- </global>
86
 
87
  <default>
88
- <currencymanager>
89
- <general>
90
- <enabled>1</enabled>
91
- <enabledadm>0</enabledadm>
92
- <precision>0</precision>
 
 
93
  <position>8</position>
94
  <display>2</display>
95
- </general>
96
- </currencymanager>
97
- </default>
98
 
99
 
 
 
 
 
 
 
 
 
 
100
 
101
- <adminhtml>
102
- <acl>
103
- <resources>
104
- <admin>
105
- <children>
106
- <system>
107
- <children>
108
- <config>
109
- <children>
110
- <currencymanager translate="title" module="currencymanager">
111
- <title>ET Currency Manager</title>
112
- <sort_order>400</sort_order>
113
- </currencymanager>
114
- </children>
115
- </config>
116
- </children>
117
- </system>
118
- </children>
119
- </admin>
120
- </resources>
121
- </acl>
122
  <translate>
123
- <modules>
124
- <ET_CurrencyManager>
125
- <files>
126
- <default>ET_Currencymanager.csv</default>
127
- </files>
128
- </ET_CurrencyManager>
129
- </modules>
130
  </translate>
131
- </adminhtml>
132
 
133
  </config>
20
  */
21
  -->
22
  <config>
23
+ <modules>
24
+ <ET_CurrencyManager>
25
+ <version>0.2.0</version>
26
  <descr>
27
+ <ru_RU><![CDATA[Позволяет управлять значениями локализации для валюты. Например: кол-во знаков после запятой для цены или символ валюты.]]>
28
+ </ru_RU>
29
+ <en_US><![CDATA[Allow to change localization options for currency. Example: currency symbol or price decimals.]]>
30
+ </en_US>
 
 
31
  </descr>
32
+ </ET_CurrencyManager>
33
+ </modules>
34
 
35
  <global>
36
+ <helpers>
37
+ <currencymanager>
38
+ <class>ET_CurrencyManager_Helper</class>
39
+ </currencymanager>
40
+ </helpers>
41
+ <models>
42
+ <directory>
43
+ <rewrite>
44
+ <currency>ET_CurrencyManager_Model_Currency</currency>
45
+ </rewrite>
46
+ </directory>
47
 
48
+ <core>
49
+ <rewrite>
50
+ <locale>ET_CurrencyManager_Model_Locale</locale>
51
+ </rewrite>
52
+ </core>
53
 
54
  <currencymanager>
55
  <class>ET_CurrencyManager_Model</class>
56
  </currencymanager>
57
+ </models>
58
  <blocks>
59
+ <currencymanager>
60
  <class>ET_CurrencyManager_Block</class>
61
  </currencymanager>
62
+ </blocks>
63
+ <resources>
64
+ <currencymanager_setup>
65
+ <setup>
66
+ <module>ET_CurrencyManager</module>
67
+ </setup>
68
+ <connection>
69
+ <use>core_setup</use>
70
+ </connection>
71
+ </currencymanager_setup>
72
+ <currencymanager_write>
73
+ <connection>
74
+ <use>core_write</use>
75
+ </connection>
76
+ </currencymanager_write>
77
+ <currencymanager_read>
78
+ <connection>
79
+ <use>core_read</use>
80
+ </connection>
81
+ </currencymanager_read>
82
+ </resources>
83
+ </global>
84
 
85
  <default>
86
+ <currencymanager>
87
+ <general>
88
+ <enabled>1</enabled>
89
+ <excludecheckout>0</excludecheckout>
90
+ <enabledadm>0</enabledadm>
91
+ <cutzerodecimal>0</cutzerodecimal>
92
+ <precision>0</precision>
93
  <position>8</position>
94
  <display>2</display>
95
+ </general>
96
+ </currencymanager>
97
+ </default>
98
 
99
 
100
+ <frontend>
101
+ <layout>
102
+ <updates>
103
+ <currencymanager>
104
+ <file>et_currencymanager.xml</file>
105
+ </currencymanager>
106
+ </updates>
107
+ </layout>
108
+ </frontend>
109
 
110
+ <adminhtml>
111
+ <acl>
112
+ <resources>
113
+ <admin>
114
+ <children>
115
+ <system>
116
+ <children>
117
+ <config>
118
+ <children>
119
+ <currencymanager translate="title" module="currencymanager">
120
+ <title>ET Currency Manager</title>
121
+ <sort_order>400</sort_order>
122
+ </currencymanager>
123
+ </children>
124
+ </config>
125
+ </children>
126
+ </system>
127
+ </children>
128
+ </admin>
129
+ </resources>
130
+ </acl>
131
  <translate>
132
+ <modules>
133
+ <ET_CurrencyManager>
134
+ <files>
135
+ <default>ET_Currencymanager.csv</default>
136
+ </files>
137
+ </ET_CurrencyManager>
138
+ </modules>
139
  </translate>
140
+ </adminhtml>
141
 
142
  </config>
app/code/community/ET/CurrencyManager/etc/system.xml CHANGED
@@ -28,82 +28,158 @@
28
  </tabs>
29
 
30
  <sections>
31
- <currencymanager translate="label" module="currencymanager">
32
- <label>Currency Manager</label>
33
- <tab>etall</tab>
34
- <frontend_type>text</frontend_type>
35
- <sort_order>300</sort_order>
36
- <show_in_default>1</show_in_default>
37
- <show_in_website>1</show_in_website>
38
- <show_in_store>1</show_in_store>
39
- <groups>
40
- <general translate="label">
41
- <label>Currency Options</label>
42
- <frontend_type>text</frontend_type>
43
- <sort_order>10</sort_order>
44
- <show_in_default>1</show_in_default>
45
- <show_in_website>1</show_in_website>
46
- <show_in_store>1</show_in_store>
47
- <fields>
48
- <enabled translate="label">
49
- <label>Enabled</label>
50
- <frontend_type>select</frontend_type>
51
- <source_model>adminhtml/system_config_source_yesno</source_model>
52
- <sort_order>1</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
- </enabled>
57
- <enabledadm translate="label">
58
- <label>Enabled for Admin</label>
59
- <frontend_type>select</frontend_type>
60
- <source_model>adminhtml/system_config_source_yesno</source_model>
61
- <sort_order>2</sort_order>
62
- <show_in_default>1</show_in_default>
63
- <show_in_website>1</show_in_website>
64
- <show_in_store>1</show_in_store>
65
- </enabledadm>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
  <precision translate="label comment">
67
- <label>Precision</label>
68
- <comment>Number of decimal (e.g. 0, 1, 2). Default: 0</comment>
69
- <frontend_type>text</frontend_type>
70
- <sort_order>3</sort_order>
71
- <show_in_default>1</show_in_default>
72
- <show_in_website>1</show_in_website>
73
- <show_in_store>1</show_in_store>
74
- </precision>
75
- <position translate="label">
76
- <label>Symbol position</label>
 
77
  <frontend_type>select</frontend_type>
78
- <source_model>currencymanager/typeposition</source_model>
79
- <sort_order>5</sort_order>
80
- <show_in_default>1</show_in_default>
81
- <show_in_website>1</show_in_website>
82
- <show_in_store>1</show_in_store>
83
- </position>
84
- <display translate="label comment">
85
- <label>Currency symbol use</label>
86
- <comment>e.g. Symbol = Ls, Short name = LVL, Name = Latvian Lats</comment>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
87
  <frontend_type>select</frontend_type>
88
- <source_model>currencymanager/typesymboluse</source_model>
89
- <sort_order>8</sort_order>
90
- <show_in_default>1</show_in_default>
91
- <show_in_website>1</show_in_website>
92
- <show_in_store>1</show_in_store>
93
- </display>
94
- <symbolreplace translate="label">
95
- <label>Replace symbol</label>
96
- <frontend_type>select</frontend_type>
97
- <frontend_model>currencymanager/adminhtml_symbolreplace</frontend_model>
98
- <backend_model>adminhtml/system_config_backend_serialized</backend_model>
99
- <sort_order>20</sort_order>
100
- <show_in_default>1</show_in_default>
101
- <show_in_website>1</show_in_website>
102
- <show_in_store>1</show_in_store>
103
- </symbolreplace>
104
  </fields>
105
- </general>
106
- </groups>
107
- </currencymanager>
108
- </sections>
109
  </config>
28
  </tabs>
29
 
30
  <sections>
31
+ <currencymanager translate="label" module="currencymanager">
32
+ <label>Currency Manager</label>
33
+ <tab>etall</tab>
34
+ <frontend_type>text</frontend_type>
35
+ <sort_order>300</sort_order>
36
+ <show_in_default>1</show_in_default>
37
+ <show_in_website>1</show_in_website>
38
+ <show_in_store>1</show_in_store>
39
+ <groups>
40
+ <info translate="label">
41
+ <label>Currency Manager information</label>
42
+ <comment><![CDATA[Support by support@etwebsolutions.com <br /> You can hire our team for any customizations. Contact us at sales@etwebsolutions.com]]></comment>
43
+ <frontend_type>text</frontend_type>
44
+ <sort_order>1</sort_order>
45
+ <show_in_default>1</show_in_default>
46
+ <show_in_website>1</show_in_website>
47
+ <show_in_store>1</show_in_store>
48
+ </info>
49
+ <general translate="label">
50
+ <label>Currency Options</label>
51
+ <frontend_type>text</frontend_type>
52
+ <sort_order>10</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
+ <fields>
57
+ <heading_frontend translate="label">
58
+ <label>Frontend specific options</label>
59
+ <frontend_model>currencymanager/adminhtml_heading</frontend_model>
60
+ <sort_order>100</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
+ </heading_frontend>
65
+ <enabled translate="label">
66
+ <label>Enabled for Frontend</label>
67
+ <frontend_type>select</frontend_type>
68
+ <source_model>adminhtml/system_config_source_yesno</source_model>
69
+ <sort_order>110</sort_order>
70
+ <show_in_default>1</show_in_default>
71
+ <show_in_website>1</show_in_website>
72
+ <show_in_store>1</show_in_store>
73
+ </enabled>
74
+ <excludecheckout translate="label comment">
75
+ <label>Exclude for checkout</label>
76
+ <comment>If Yes - options [Precision] and [Replace Zero Price] will not affect display of prices in checkout.</comment>
77
+ <frontend_type>select</frontend_type>
78
+ <source_model>adminhtml/system_config_source_yesno</source_model>
79
+ <sort_order>120</sort_order>
80
+ <show_in_default>1</show_in_default>
81
+ <show_in_website>1</show_in_website>
82
+ <show_in_store>1</show_in_store>
83
+ </excludecheckout>
84
+
85
+ <heading_admin translate="label">
86
+ <label>Admin specific options</label>
87
+ <frontend_model>currencymanager/adminhtml_heading</frontend_model>
88
+ <sort_order>200</sort_order>
89
+ <show_in_default>1</show_in_default>
90
+ <show_in_website>1</show_in_website>
91
+ <show_in_store>1</show_in_store>
92
+ </heading_admin>
93
+ <enabledadm translate="label">
94
+ <label>Enabled for Admin</label>
95
+ <frontend_type>select</frontend_type>
96
+ <source_model>adminhtml/system_config_source_yesno</source_model>
97
+ <sort_order>210</sort_order>
98
+ <show_in_default>1</show_in_default>
99
+ <show_in_website>1</show_in_website>
100
+ <show_in_store>1</show_in_store>
101
+ </enabledadm>
102
+
103
+ <heading_global translate="label">
104
+ <label>Currency options (global)</label>
105
+ <frontend_model>currencymanager/adminhtml_heading</frontend_model>
106
+ <sort_order>300</sort_order>
107
+ <show_in_default>1</show_in_default>
108
+ <show_in_website>1</show_in_website>
109
+ <show_in_store>1</show_in_store>
110
+ </heading_global>
111
  <precision translate="label comment">
112
+ <label>Precision</label>
113
+ <comment>Number of decimal (e.g. 0, 1, 2). Default: 0</comment>
114
+ <frontend_type>text</frontend_type>
115
+ <sort_order>310</sort_order>
116
+ <show_in_default>1</show_in_default>
117
+ <show_in_website>1</show_in_website>
118
+ <show_in_store>1</show_in_store>
119
+ </precision>
120
+ <cutzerodecimal translate="label comment">
121
+ <label>Cut Zero Decimals</label>
122
+ <comment>If Yes price will be 99 instead of 99.00, but 99.99 if price 99.99</comment>
123
  <frontend_type>select</frontend_type>
124
+ <source_model>adminhtml/system_config_source_yesno</source_model>
125
+ <sort_order>320</sort_order>
126
+ <show_in_default>1</show_in_default>
127
+ <show_in_website>1</show_in_website>
128
+ <show_in_store>1</show_in_store>
129
+ </cutzerodecimal>
130
+ <!--
131
+ <cutzerodecimal_suffix translate="label comment">
132
+ <label>Replaces Cuted Zero Decimals</label>
133
+ <comment>Used only if Cut Zero Decimals = Yes<br />Default: ,-</comment>
134
+ <frontend_type>select</frontend_type>
135
+ <source_model>adminhtml/system_config_source_yesno</source_model>
136
+ <sort_order>320</sort_order>
137
+ <show_in_default>1</show_in_default>
138
+ <show_in_website>1</show_in_website>
139
+ <show_in_store>1</show_in_store>
140
+ </cutzerodecimal_suffix>
141
+ -->
142
+ <position translate="label">
143
+ <label>Symbol position</label>
144
+ <frontend_type>select</frontend_type>
145
+ <source_model>currencymanager/typeposition</source_model>
146
+ <sort_order>330</sort_order>
147
+ <show_in_default>1</show_in_default>
148
+ <show_in_website>1</show_in_website>
149
+ <show_in_store>1</show_in_store>
150
+ </position>
151
+ <display translate="label comment">
152
+ <label>Currency symbol use</label>
153
+ <comment>e.g. Symbol = Ls, Short name = LVL, Name = Latvian Lats</comment>
154
+ <frontend_type>select</frontend_type>
155
+ <source_model>currencymanager/typesymboluse</source_model>
156
+ <sort_order>340</sort_order>
157
+ <show_in_default>1</show_in_default>
158
+ <show_in_website>1</show_in_website>
159
+ <show_in_store>1</show_in_store>
160
+ </display>
161
+
162
+ <heading_specific translate="label">
163
+ <label>Currency options (for specific currency)</label>
164
+ <frontend_model>currencymanager/adminhtml_heading</frontend_model>
165
+ <sort_order>400</sort_order>
166
+ <show_in_default>1</show_in_default>
167
+ <show_in_website>1</show_in_website>
168
+ <show_in_store>1</show_in_store>
169
+ </heading_specific>
170
+ <symbolreplace translate="label">
171
+ <label>Currency specific options</label>
172
  <frontend_type>select</frontend_type>
173
+ <frontend_model>currencymanager/adminhtml_symbolreplace</frontend_model>
174
+ <backend_model>adminhtml/system_config_backend_serialized</backend_model>
175
+ <sort_order>410</sort_order>
176
+ <show_in_default>1</show_in_default>
177
+ <show_in_website>1</show_in_website>
178
+ <show_in_store>1</show_in_store>
179
+ </symbolreplace>
 
 
 
 
 
 
 
 
 
180
  </fields>
181
+ </general>
182
+ </groups>
183
+ </currencymanager>
184
+ </sections>
185
  </config>
app/code/community/ET/ET_CurrencyManager_ChangeLog.txt CHANGED
@@ -13,9 +13,20 @@ TODO:
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.1.4
20
  * Added support for dynamic prices (Bundled, Configurable, Simple with custom options).
21
 
@@ -26,4 +37,4 @@ ver. 0.1.1
26
  * repacking for Magento Connect
27
 
28
  ver. 0.1.0
29
- + stable relize
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
+ + Add ability to add price suffix. Example: make from 99.00 USD this 99,- USD
17
 
18
  =====================================
19
+ ver. 0.2.0
20
+ + restyled configuration
21
+ + added abilty to set currency specific options (all, not only symbol replace/ Actual for multi currency stores without store views).
22
+ + added ability to disable precision change for checkout process (exclude chekout)
23
+ + added ability to replace zero prices with any string. Example: instead 0.00 display FREE
24
+ * changed Cut Zero Decimal algoritm (now it's work fine with any currency precision, not only precision=2)
25
+
26
+
27
+ ver. 0.1.5
28
+ + Added ability to cut zero decimals if it = 0. (price == floor(price))
29
+
30
  ver. 0.1.4
31
  * Added support for dynamic prices (Bundled, Configurable, Simple with custom options).
32
 
37
  * repacking for Magento Connect
38
 
39
  ver. 0.1.0
40
+ + stable release
app/code/community/ET/ET_CurrencyManager_Description.txt CHANGED
@@ -1,54 +1,84 @@
1
  ==== Description / Для чего этот модуль? ====
2
 
3
- RU:
4
- Модуль позволяет управлять значениями локализации для валюты.
5
- По умолчанию значения берутся из настроек Zend Framework, где и могут быть отредактированы. Но любое обновление сайта может привести к потере настроек (если обновилась версия Zend Framework).
6
 
7
- Параметры, которыми можно управлять с помощью модуля:
8
- * количество знаков после запятой для цены (precision)
9
- * замена символа валюты (symbol)
10
- * что использовать в качестве символа валюты (не использовать, использовать код, использовать символ, использовать название)
11
- * позиция символа валюты (перед ценой, после цены)
 
 
 
 
 
 
 
12
 
13
- ВАЖНО: Этот модуль меняет ТОЛЬКО ОТОБРАЖЕНИЕ валюты, но не влияет на хранение сумм.
14
- Пример: Товар стоит 149.99 денег. Если модуль включен, то
15
- * клиент увидит цену 150.
16
- * Администратор в зависимости от настроек 150 или 149.99
17
- * При оплате онлайн с клиента будет списано 149.99, так как товар столько стоит.
18
 
 
19
 
20
- EN:
21
- This extension lets you manage currency localization. By default values are taken from Zend Framework configuration. Of course, you can edit those values directly there, but in that case you'll most likely lose these changes when Magento decides to upgrade Zend Framework.
22
 
23
- Things you can manage with this extension:
24
- * number of digits after the decimal point for prices (precision)
25
- * currency symbol (symbol)
26
- * use what as currency symbol (use nothing, currency code, currency symbol, currency name)
27
- * symbol position (before price, after price)
28
 
29
- IMPORTANT NOTE: This extension changes ONLY DISPLAY of currency, but it doesn't change storing of prices and sums inside Magento.
30
- Example: Product price is 149.99 of money. If extension is enabled:
31
- * Customer will see price as 150.
32
- * Admin - depending on settings - 150 or 149.99
33
- * When paying online client will be charged 149.99 because it is this product's real price.
34
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
 
36
 
37
  ====Features / Особенности модуля====
38
 
39
- * Open Source
40
- * Translations avalable:
41
- * en_EN
42
- * ru_RU
43
- * All options are changable in admin
44
 
 
 
 
 
45
 
46
  ====Version Compatibility / Совместимость версий====
47
  1.3.х (tested in 1.3.2.4.)
48
  1.4.x (tested in 1.4.1.1.)
49
- 1.5.x (tested in 1.5.0.1.)
 
 
 
50
 
51
- ====Module tags====
52
  символ валюты, настройка отображения валюты, валюта, цена, количество знаков после запятой
53
 
54
- price precision, round price, hide decimal, currency symbol
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ * Specify position of currency symbol: before the price or after. Example: $ 49.99 or 49.99 $
10
+ * Specify what to use as currency symbol. Example: nothing, use currency code (EUR, USD), use currency symbol (€, $), use currency name (Euro, US Dollar)
11
+ * Change currency symbol to your own (text only). Example: display Money instead of $
12
+ * Change zero price to your own text. Example: FREE instead of 0.00
13
+ * Use separate settings for every store view
14
+ * Use separate settings for every currency
15
+ * Enable and disable extension for frontend and admin panel separately
16
+ * Disable price rounding on checkout page
17
 
18
+ 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.
 
 
 
 
19
 
20
+ 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.
21
 
 
 
22
 
 
 
 
 
 
23
 
24
+ RU:
25
+ Модуль ET Currency Manager позволяет владельцу магазина просто и удобно управлять отображением цены на своём сайте.
26
+
27
+
28
+ С помощью модуля вы можете:
29
 
30
+ * Указать количество знаков после запятой для отображения цен на сайте (для округления используется встроенный алгоритм Магенто). Пример: вместо 49.99 показывать или 50 или 49.9900
31
+ * Отображать цены без "копеек". Пример: Вместо 49.00 показывать 49, но цену 49.99 не изменять.
32
+ * Указать позицию символа валюты: перед ценой или после. Пример: $ 49.99 или 49.99 $
33
+ * Указать, что использовать в качестве символа валюты. Пример: (не использовать; использовать код - EUR, USD; использовать символ - €, $; использовать название - Евро, Американский доллар)
34
+ * Заменять символ валюты на свой (только текстовый). Пример: Вместо $ выводить Money.
35
+ * Заменять нулевую цену на свой текст. Например: вместо 0.00 выводить БЕСПЛАТНО
36
+ * Использовать различные настройки для каждого представления магазина.
37
+ * Использовать различные настройки для каждой валюты отдельно.
38
+ * Включать и отключать модуль для пользовательской части и панели администрирования независимо друг от друга.
39
+ * Отключать округление цены на странице заказа.
40
+
41
+ Важно: модуль меняет исключительно отображение валюты, а не саму цену. (Пример: Товар стоит 49.99; Можно показывать цену клиентам как 50; Но при оплате с клиента будет удержано 49.99, так как это реальная стоимость товара).
42
+
43
+ Дополнительно: Без этого модуля у вас есть возможность влиять на отображение валюты только редактируя значения в файлах локализации Zend Framework (/lib/Zend/Locale/Data/*.xml). Но при обновлении версии Магенто изменения могут быть утеряны (так как может обновиться Zend Framework).
44
 
45
 
46
  ====Features / Особенности модуля====
47
 
48
+ * Open source code (no encryption and obfuscation)
49
+ * Code follows Magento development standards
50
+ * Extension is available on 2 languages (ru_RU, en_US) and you can easy add your own
51
+ * All extension settings are available on admin panel
 
52
 
53
+ * Открытый исходный код
54
+ * Код написан придерживаясь принятых стандартов в разработке для Магенто
55
+ * Доступен на 2-ух языках (ru_RU, en_US) и легко добавляются новые переводы
56
+ * Все настройки модуля доступны в панели администрирования
57
 
58
  ====Version Compatibility / Совместимость версий====
59
  1.3.х (tested in 1.3.2.4.)
60
  1.4.x (tested in 1.4.1.1.)
61
+ 1.5.x (tested in 1.5.0.1. 1.5.1.0)
62
+
63
+ ====Module tags====
64
+ price precision, round price, hide decimal, currency symbol, zero price replace
65
 
 
66
  символ валюты, настройка отображения валюты, валюта, цена, количество знаков после запятой
67
 
68
+ ====Установка/Installation====
69
+
70
+ * Disable Compiler, if it is enabled (System -> Tools -> Compilation)
71
+ * Disable cache, if it is enabled (System -> Cache Management)
72
+ * Install the extension (just unpack archive to magento root folder)
73
+ * Log off admin panel (Log Out)
74
+ * Log into admin panel (enter your login and password)
75
+ * Set filter display parameters (System -> Configuration -> Currency Manager)
76
+ * Run compilation process and enable cache if needed
77
+
78
+ * Отключите компиляцию, если включена (Система -> Инструменты -> Компиляция)
79
+ * Отключите кэш, если включён (Система -> Управление кэшем)
80
+ * Установите модуль (распакуйте архив в корневую папку с Магенто)
81
+ * Выйдите из панели администрирования (Выйти)
82
+ * Войдите в панель администрирования (введите логин/пароль)
83
+ * Настройте параметры отображения фильтра (Система -> Конфигурация -> Currency Manager)
84
+ * Если необходимо запустите процесс компиляции и включите кэш
app/design/frontend/default/default/layout/et_currencymanager.xml ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * ET Web Solutions
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ *
10
+ * DISCLAIMER
11
+ *
12
+ * Do not edit or add to this file if you wish to upgrade to newer
13
+ * versions in the future.
14
+ *
15
+ * @category ET
16
+ * @package ET_CurrencyManager
17
+ * @copyright Copyright (c) 2011 ET Web Solutions (http://etwebsolutions.com)
18
+ * @contacts support@etwebsolutions.com
19
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
20
+ */
21
+ -->
22
+
23
+ <layout version="0.1.0">
24
+ <default>
25
+ <reference name="head">
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/etc/modules/ET_CurrencyManager.xml CHANGED
@@ -21,10 +21,10 @@
21
  -->
22
 
23
  <config>
24
- <modules>
25
- <ET_CurrencyManager>
26
- <active>true</active>
27
- <codePool>community</codePool>
28
- </ET_CurrencyManager>
29
- </modules>
30
  </config>
21
  -->
22
 
23
  <config>
24
+ <modules>
25
+ <ET_CurrencyManager>
26
+ <active>true</active>
27
+ <codePool>community</codePool>
28
+ </ET_CurrencyManager>
29
+ </modules>
30
  </config>
app/locale/en_US/ET_Currencymanager.csv CHANGED
@@ -1,17 +1,15 @@
1
  "Currency Manager","Currency Manager"
2
- "New symbol:","New symbol:"
3
- "Add currency symbol replace","Add currency symbol replace"
4
- "* Select currency","* Select currency"
5
  "Remove","Remove"
 
6
  "Currency Options","Currency Options"
7
- "Enabled","Enabled for Frontend"
8
  "Enabled for Admin","Enabled for Admin"
9
  "Precision","Precision"
 
10
  "Number of decimal (e.g. 0, 1, 2). Default: 0","Number of decimal (e.g. 0, 1, 2). Default: 0"
11
  "Symbol position","Symbol position"
12
  "Currency symbol use","Currency symbol use"
13
  "e.g. Symbol = Ls, Short name = LVL, Name = Latvian Lats","e.g. Symbol = $, Short name = USD, Name = US Dollar"
14
- "Replace symbol","Replace symbol"
15
  "Default","Default"
16
  "Right","Right"
17
  "Left","Left"
@@ -21,3 +19,23 @@
21
  "Use name","Use name"
22
  "Yes","Yes"
23
  "No","No"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  "Currency Manager","Currency Manager"
 
 
 
2
  "Remove","Remove"
3
+ "* Select currency","* Select currency"
4
  "Currency Options","Currency Options"
5
+ "Enabled for Frontend","Enabled for Frontend"
6
  "Enabled for Admin","Enabled for Admin"
7
  "Precision","Precision"
8
+ "Precision:","Precision:"
9
  "Number of decimal (e.g. 0, 1, 2). Default: 0","Number of decimal (e.g. 0, 1, 2). Default: 0"
10
  "Symbol position","Symbol position"
11
  "Currency symbol use","Currency symbol use"
12
  "e.g. Symbol = Ls, Short name = LVL, Name = Latvian Lats","e.g. Symbol = $, Short name = USD, Name = US Dollar"
 
13
  "Default","Default"
14
  "Right","Right"
15
  "Left","Left"
19
  "Use name","Use name"
20
  "Yes","Yes"
21
  "No","No"
22
+ "Frontend specific options","Frontend specific options"
23
+ "Admin specific options","Admin specific options"
24
+ "Currency options (global)","Currency options (global)"
25
+ "Currency options (for specific currency)","Currency options (for specific currency)"
26
+ "Exclude for checkout","Exclude for checkout"
27
+ "If Yes - options [Precision] and [Replace Zero Price] will not affect display of prices in checkout.","If Yes - options [Precision] and [Replace Zero Price] will not affect display of prices in checkout."
28
+ "Cut Zero Decimals","Cut Zero Decimals"
29
+ "Cut Zero Decimals:","Cut Zero Decimals:"
30
+ "If Yes price will be 99 instead of 99.00, but 99.99 if price 99.99","If Yes price will be 99 instead of 99.00, but 99.99 if price 99.99"
31
+ "Currency specific options","Currency specific options"
32
+ "Select currency:","Select currency:"
33
+ "Symbol position:","Symbol position:"
34
+ "Currency symbol use:","Currency symbol use:"
35
+ "Replace symbol to:","Replace symbol to:"
36
+ "Replace Zero Price to:","Replace Zero Price to:"
37
+ "Add currency specific options","Add currency specific options"
38
+ "Currency Manager information","Currency Manager information"
39
+ "Support by support@etwebsolutions.com <br /> You can hire our team for any customizations. Contact us at sales@etwebsolutions.com","Support by support@etwebsolutions.com <br /> You can hire our team for any customizations. Contact us at sales@etwebsolutions.com"
40
+ "Leave empty for disable replace","Leave empty for disable replace"
41
+ "Leave empty for global value use","Leave empty for global value use"
app/locale/ru_RU/ET_Currencymanager.csv CHANGED
@@ -1,17 +1,15 @@
1
  "Currency Manager","Currency Manager"
2
- "New symbol:","Символ:"
3
- "Add currency symbol replace","Добавить замену символа валюты"
4
- "* Select currency","* Выберите валюту"
5
  "Remove","Удалить"
 
6
  "Currency Options","Параметры валюты"
7
- "Enabled","Включено для пользователей"
8
  "Enabled for Admin","Включено для администраторов"
9
  "Precision","Точность"
 
10
  "Number of decimal (e.g. 0, 1, 2). Default: 0","Кол-во знаков после запятой (например: 0, 1, 2). По умолчанию: 0"
11
  "Symbol position","Позиция символа"
12
  "Currency symbol use","Обозначение валюты"
13
  "e.g. Symbol = Ls, Short name = LVL, Name = Latvian Lats","Например: Символ = руб., Код = RUB, Наименование = Российский рубль"
14
- "Replace symbol","Замена символа"
15
  "Default","По умолчанию"
16
  "Right","После цены"
17
  "Left","Перед ценой"
@@ -21,3 +19,24 @@
21
  "Use name","наименование"
22
  "Yes","Да"
23
  "No","Нет"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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","Перед ценой"
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<br />Default: ,-","Используется только при значении Отбрасывать нули после запятой = Да. По умолчанию: ,-"
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>ET_CurrencyManager</name>
4
- <version>0.1.4</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/afl-3.0.php">AFL v3.0</license>
7
  <channel>community</channel>
@@ -15,9 +15,9 @@ Added support for dynamic prices (Bundled, Configurable, Simple with custom opti
15
  * symbol type (name, short name/code, symbol)</description>
16
  <notes>stable release</notes>
17
  <authors><author><name>Jurij</name><user>auto-converted</user><email>support@etwebsolutions.com</email></author></authors>
18
- <date>2011-03-09</date>
19
- <time>17:15:50</time>
20
- <contents><target name="magelocale"><dir name="en_US"><file name="ET_Currencymanager.csv" hash="c41fcaff10fe6023a2696341bb147c25"/></dir><dir name="ru_RU"><file name="ET_Currencymanager.csv" hash="a7b43d416473671fac03692bdb4797cc"/></dir></target><target name="magecommunity"><dir name="ET"><dir name="CurrencyManager"><dir name="Block"><dir name="Adminhtml"><file name="Symbolreplace.php" hash="675718a8640ede89e87edb3b6652f85d"/></dir></dir><dir name="etc"><file name="config.xml" hash="e0ea29b05098b72b21fe471356b3a26e"/><file name="system.xml" hash="70021f48efb3a3290bfd3e60e1c641d3"/></dir><dir name="Helper"><file name="Data.php" hash="14cc334fb7ec7ede7f0c67836c7b38eb"/></dir><dir name="Model"><file name="Currency.php" hash="36e1836c0c3e5fd49dd80f8c8fe734d5"/><file name="Locale.php" hash="537658bce8df32f185b48b156d950f51"/><file name="Typeposition.php" hash="3c8655f73d39f74d0a0dc0efa4cf0be3"/><file name="Typesymboluse.php" hash="973fa7feb75aa4cf846ffb3cd21d8fa4"/></dir></dir><file name="ET_CurrencyManager_ChangeLog.txt" hash="5bdac8194c1a1006b6c1b94be9ccfb7f"/><file name="ET_CurrencyManager_Description.txt" hash="58eb12ef28d5a34916935799f0a5b983"/><file name="ET_CurrencyManager_LICENSE.txt" hash="b799504264c23c11a941473d7a3e3ab7"/></dir></target><target name="mageetc"><dir name="modules"><file name="ET_CurrencyManager.xml" hash="e2631245590a94c04438246a5827625f"/></dir></target></contents>
21
  <compatible/>
22
  <dependencies/>
23
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>ET_CurrencyManager</name>
4
+ <version>0.2.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/afl-3.0.php">AFL v3.0</license>
7
  <channel>community</channel>
15
  * symbol type (name, short name/code, symbol)</description>
16
  <notes>stable release</notes>
17
  <authors><author><name>Jurij</name><user>auto-converted</user><email>support@etwebsolutions.com</email></author></authors>
18
+ <date>2011-07-01</date>
19
+ <time>06:15:24</time>
20
+ <contents><target name="magelocale"><dir name="en_US"><file name="ET_Currencymanager.csv" hash="e649de1104e7f66f0121eb60e244118e"/></dir><dir name="ru_RU"><file name="ET_Currencymanager.csv" hash="a70b86ebb6ab1d9d8380f3de343f80a3"/></dir></target><target name="magecommunity"><dir name="ET"><dir name="CurrencyManager"><dir name="Block"><dir name="Adminhtml"><file name="Heading.php" hash="e60e170675c34ecfad27627fb40bbc17"/><file name="Symbolreplace.php" hash="0060a5edba3c4af5219f2fd1f72d6b81"/></dir></dir><dir name="etc"><file name="config.xml" hash="6031accd18f242464a143632506eaffa"/><file name="system.xml" hash="8c4ccb10a2c336cbba2ee67161dc1aa7"/></dir><dir name="Helper"><file name="Data.php" hash="f2059d934a84665c3a45dbee78d2482b"/></dir><dir name="Model"><file name="Currency.php" hash="9b23fbf0ed4687066c470a67686d94ce"/><file name="Locale.php" hash="aa958546193577922e0df3f0e851b288"/><file name="Typeposition.php" hash="cd4bd5df29fa4c042cbbe3c1927824a3"/><file name="Typesymboluse.php" hash="2cee3e1a03b39ee2aaf61387948c3fc9"/></dir></dir><file name="ET_CurrencyManager_ChangeLog.txt" hash="83e5feec1cddc45fd5ae583d03e8ecac"/><file name="ET_CurrencyManager_Description.txt" hash="529670848a2bd618445fd07cbd80eba3"/><file name="ET_CurrencyManager_LICENSE.txt" hash="b799504264c23c11a941473d7a3e3ab7"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="default"><dir name="default"><dir name="et_currencymanager"><file name="et_currencymanager.js" hash="0b6e3795adcbd6bac0c14aaa7493d5ad"/><file name="et_currencymanager_round.js" hash="0e0eccc6f6d76d40d456c243888390e8"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="et_currencymanager.xml" hash="3f74a54c8844ba19bae1e9fbc07ad5a8"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="ET_CurrencyManager.xml" hash="c1951d24b4320ed1bf3704363b0ace86"/></dir></target></contents>
21
  <compatible/>
22
  <dependencies/>
23
  </package>
skin/frontend/default/default/et_currencymanager/et_currencymanager.js ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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=this.priceFormat;
6
+ if(price-parseInt(price)==0){
7
+ tmpPriceFormat.precision=0;
8
+ tmpPriceFormat.requiredPrecision=0;
9
+ }
10
+ var price2return = formatCurrency(price, tmpPriceFormat);
11
+ return price2return;
12
+ }});
13
+
14
+ }
skin/frontend/default/default/et_currencymanager/et_currencymanager_round.js ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ if(typeof(Product)!="undefined"){
2
+ Product.Config.prototype=Object.extend(Product.Config.prototype,{
3
+ formatPrice: function(price, showSign)
4
+ {
5
+ var str = '';
6
+ price = parseFloat(price);
7
+ if(showSign){
8
+ if(price<0){
9
+ str+= '-';
10
+ price = -price;
11
+ }
12
+ else{
13
+ str+= '+';
14
+ }
15
+ }
16
+
17
+ var roundedPrice = (Math.round(price*100)/100).toString();
18
+
19
+ if (this.prices && this.prices[roundedPrice]) {
20
+ str+= this.prices[roundedPrice];
21
+ }
22
+ else {
23
+ precision=2;
24
+ if(typeof(optionsPrice)!="undefined")
25
+ if(typeof(optionsPrice.priceFormat)!="undefined")
26
+ precision=optionsPrice.priceFormat.requiredPrecision;
27
+ if(typeof(globalCutZeroSignPrice)!="undefined")
28
+ if(price-parseInt(price)==0){
29
+ precision=0;
30
+ }
31
+ str+= this.priceTemplate.evaluate({price:price.toFixed(precision)});
32
+ }
33
+ return str;
34
+ }
35
+
36
+
37
+ });
38
+ }