ET_CurrencyManager - Version 0.2.2

Version Notes

stable release

Download this release

Release Info

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


Code changes from version 0.2.0 to 0.2.2

app/code/community/ET/CurrencyManager/Block/Adminhtml/Formprice.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
+ class ET_CurrencyManager_Block_Adminhtml_Formprice extends Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Price
22
+ {
23
+ public function getEscapedValue($index=null)
24
+ {
25
+ $options=Mage::helper('currencymanager')->getOptions(array());
26
+ $value = $this->getValue();
27
+
28
+ if (!is_numeric($value))
29
+ {
30
+ return null;
31
+ }
32
+
33
+ if(isset($options["input_admin"]) && isset($options['precision']))
34
+ return number_format($value, $options['precision'], null, '');
35
+
36
+ return parent::getEscapedValue($index);
37
+ }
38
+
39
+ }
app/code/community/ET/CurrencyManager/Block/Adminhtml/Symbolreplace.php CHANGED
@@ -75,6 +75,12 @@ class ET_CurrencyManager_Block_Adminhtml_Symbolreplace extends Mage_Adminhtml_Bl
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)
75
  }
76
  $html .= '</select>';
77
 
78
+
79
+ $html .= '<label>'.$this->__('Suffix:').' </label> ';
80
+ $html .= '<input class="input-text" name="'.$this->getElement()->getName().'[cutzerodecimal_suffix][]" value="'.$this->_getValue('cutzerodecimal_suffix/'.$i).'" '.$this->_getDisabled().'/> ';
81
+ $html .= '<p class="nm"><small>' . $this->__('Leave empty for global value use') . '</small></p>';
82
+
83
+
84
  $html .= '<label>'.$this->__('Symbol position:').' </label> ';
85
  $html .= '<select class="input-text" name="'.$this->getElement()->getName().'[position][]">';
86
  foreach(Mage::getModel("currencymanager/typeposition")->toOptionArray() as $labelValue)
app/code/community/ET/CurrencyManager/Block/Js.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ class ET_CurrencyManager_Block_Js extends Mage_Core_Block_Template
22
+ {
23
+ public function getJsonConfig()
24
+ {
25
+ if(method_exists(Mage::helper('core'),'jsonEncode')){
26
+ return Mage::helper('core')->jsonEncode(Mage::helper('currencymanager')->getOptions(array()));
27
+ }
28
+ else {
29
+ return Zend_Json::encode(Mage::helper('currencymanager')->getOptions(array()));
30
+ }
31
+
32
+
33
+
34
+ }
35
+ }
36
+
app/code/community/ET/CurrencyManager/Helper/Data.php CHANGED
@@ -84,8 +84,14 @@ class ET_CurrencyManager_Helper_Data extends Mage_Core_Helper_Abstract
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
  // если в админке будут внесены несколько значений для одной валюты, то использоваться будет только одна
@@ -98,6 +104,7 @@ class ET_CurrencyManager_Helper_Data extends Mage_Core_Helper_Abstract
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]);
@@ -113,6 +120,16 @@ class ET_CurrencyManager_Helper_Data extends Mage_Core_Helper_Abstract
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];
84
 
85
  if (isset($config['position']))$options['position'] = (int)$config['position'];
86
  if (isset($config['display']))$options['display'] = (int)$config['display'];
87
+ if (isset($config['input_admin']))$optionsadvanced['input_admin'] = (int)$config['input_admin'];
88
+
89
+
90
+
91
  $optionsadvanced['excludecheckout'] = $config['excludecheckout'];
92
  $optionsadvanced['cutzerodecimal'] = $config['cutzerodecimal'];
93
+ $optionsadvanced['cutzerodecimal_suffix'] = isset($config['cutzerodecimal_suffix'])?$config['cutzerodecimal_suffix']:"";
94
+
95
 
96
  // formating symbols from admin, preparing to use. Maybe can better :)
97
  // если в админке будут внесены несколько значений для одной валюты, то использоваться будет только одна
104
  unset($symbolreplace['currency'][$symbolreplaceKey]);
105
  unset($symbolreplace['precision'][$symbolreplaceKey]);
106
  unset($symbolreplace['cutzerodecimal'][$symbolreplaceKey]);
107
+ unset($symbolreplace['cutzerodecimal_suffix'][$symbolreplaceKey]);
108
  unset($symbolreplace['position'][$symbolreplaceKey]);
109
  unset($symbolreplace['display'][$symbolreplaceKey]);
110
  unset($symbolreplace['symbol'][$symbolreplaceKey]);
120
  if (array_key_exists($displayCurrencyCode, $configSubData))
121
  $optionsadvanced['cutzerodecimal'] = (int)$configSubData[$displayCurrencyCode];
122
 
123
+
124
+
125
+ if(isset($symbolreplace['cutzerodecimal_suffix'])){
126
+ $configSubData = array_combine($symbolreplace['currency'], $symbolreplace['cutzerodecimal_suffix']);
127
+ if (array_key_exists($displayCurrencyCode, $configSubData))
128
+ if($configSubData[$displayCurrencyCode]!=""){
129
+ $optionsadvanced["cutzerodecimal_suffix"] = $configSubData[$displayCurrencyCode];
130
+ }
131
+ }
132
+
133
  $configSubData = array_combine($symbolreplace['currency'], $symbolreplace['position']);
134
  if (array_key_exists($displayCurrencyCode, $configSubData))
135
  $options['position'] = (int)$configSubData[$displayCurrencyCode];
app/code/community/ET/CurrencyManager/Model/Currency.php CHANGED
@@ -47,7 +47,6 @@ public function format($price, $options=array(), $includeContainer = true, $addB
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();
@@ -55,14 +54,22 @@ public function format($price, $options=array(), $includeContainer = true, $addB
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'];
47
  public function formatTxt($price, $options=array())
48
  {
49
  $answer = parent::formatTxt($price, $options);
 
50
  if(Mage::helper('currencymanager')->isEnabled())
51
  {
52
  $store = Mage::app()->getStore()->getStoreId();
54
  $optionsAdvanced = Mage::helper('currencymanager')->getOptions($options);
55
  $options = Mage::helper('currencymanager')->getOptions($options,true);
56
 
57
+ $answer = parent::formatTxt($price, $options);
58
+
59
+ $suffix = isset($optionsAdvanced['cutzerodecimal_suffix'])?$optionsAdvanced['cutzerodecimal_suffix']:"";
60
 
61
  if (count($options)>0)
62
  {
63
+
64
+ if (($moduleName == 'admin'))
65
+ {
66
+ $answer = parent::formatTxt($price, $options);
67
+ }
68
+
69
+
70
  if (!(($moduleName == 'checkout') & $optionsAdvanced['excludecheckout']))
71
  {
72
+
73
  if($price==0)
74
  if(isset($optionsAdvanced['zerotext']))
75
  if($optionsAdvanced['zerotext']!="")return $optionsAdvanced['zerotext'];
app/code/community/ET/CurrencyManager/etc/config.xml CHANGED
@@ -22,7 +22,7 @@
22
  <config>
23
  <modules>
24
  <ET_CurrencyManager>
25
- <version>0.2.0</version>
26
  <descr>
27
  <ru_RU><![CDATA[Позволяет управлять значениями локализации для валюты. Например: кол-во знаков после запятой для цены или символ валюты.]]>
28
  </ru_RU>
@@ -59,6 +59,11 @@
59
  <currencymanager>
60
  <class>ET_CurrencyManager_Block</class>
61
  </currencymanager>
 
 
 
 
 
62
  </blocks>
63
  <resources>
64
  <currencymanager_setup>
@@ -88,7 +93,9 @@
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>
22
  <config>
23
  <modules>
24
  <ET_CurrencyManager>
25
+ <version>0.2.2</version>
26
  <descr>
27
  <ru_RU><![CDATA[Позволяет управлять значениями локализации для валюты. Например: кол-во знаков после запятой для цены или символ валюты.]]>
28
  </ru_RU>
59
  <currencymanager>
60
  <class>ET_CurrencyManager_Block</class>
61
  </currencymanager>
62
+ <adminhtml>
63
+ <rewrite>
64
+ <catalog_product_helper_form_price>ET_CurrencyManager_Block_Adminhtml_Formprice</catalog_product_helper_form_price>
65
+ </rewrite>
66
+ </adminhtml>
67
  </blocks>
68
  <resources>
69
  <currencymanager_setup>
93
  <enabled>1</enabled>
94
  <excludecheckout>0</excludecheckout>
95
  <enabledadm>0</enabledadm>
96
+ <input_admin>0</input_admin>
97
  <cutzerodecimal>0</cutzerodecimal>
98
+ <cutzerodecimal_suffix>,-</cutzerodecimal_suffix>
99
  <precision>0</precision>
100
  <position>8</position>
101
  <display>2</display>
app/code/community/ET/CurrencyManager/etc/system.xml CHANGED
@@ -100,6 +100,17 @@
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>
@@ -127,18 +138,17 @@
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>
100
  <show_in_store>1</show_in_store>
101
  </enabledadm>
102
 
103
+ <input_admin translate="label">
104
+ <label>Enable for Inputs</label>
105
+ <frontend_type>select</frontend_type>
106
+ <source_model>adminhtml/system_config_source_yesno</source_model>
107
+ <sort_order>220</sort_order>
108
+ <show_in_default>1</show_in_default>
109
+ <show_in_website>1</show_in_website>
110
+ <show_in_store>1</show_in_store>
111
+ </input_admin>
112
+
113
+
114
  <heading_global translate="label">
115
  <label>Currency options (global)</label>
116
  <frontend_model>currencymanager/adminhtml_heading</frontend_model>
138
  <show_in_website>1</show_in_website>
139
  <show_in_store>1</show_in_store>
140
  </cutzerodecimal>
141
+
142
  <cutzerodecimal_suffix translate="label comment">
143
  <label>Replaces Cuted Zero Decimals</label>
144
+ <comment>Used only if Cut Zero Decimals = Yes, default ",-"</comment>
145
+ <frontend_type>text</frontend_type>
146
+ <sort_order>325</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
  </cutzerodecimal_suffix>
151
+
152
  <position translate="label">
153
  <label>Symbol position</label>
154
  <frontend_type>select</frontend_type>
app/code/community/ET/ET_CurrencyManager_ChangeLog.txt CHANGED
@@ -16,6 +16,15 @@ TODO:
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).
@@ -23,7 +32,6 @@ ver. 0.2.0
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
 
16
  + Add ability to add price suffix. Example: make from 99.00 USD this 99,- USD
17
 
18
  =====================================
19
+
20
+ ver. 0.2.2 (17/08/2011)
21
+ + Replace zero decimals with suffix. Example: display 49,- instead of 49.00 or 49, but 49.99 remains unchanged.
22
+ + Enable/Disable price rounding (precision parameter) on product input\edit page
23
+ * small bug fixes
24
+
25
+ ver. 0.2.1 (22/07/2011)
26
+ * Fixed skipping currency formatting for admin dashboard
27
+
28
  ver. 0.2.0
29
  + restyled configuration
30
  + added abilty to set currency specific options (all, not only symbol replace/ Actual for multi currency stores without store views).
32
  + added ability to replace zero prices with any string. Example: instead 0.00 display FREE
33
  * changed Cut Zero Decimal algoritm (now it's work fine with any currency precision, not only precision=2)
34
 
 
35
  ver. 0.1.5
36
  + Added ability to cut zero decimals if it = 0. (price == floor(price))
37
 
app/code/community/ET/ET_CurrencyManager_Description.txt CHANGED
@@ -6,6 +6,7 @@ ET Currency Manager lets shop owner manage display of prices on website in simpl
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 $
@@ -14,6 +15,7 @@ With this extension you can:
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
 
@@ -29,6 +31,7 @@ RU:
29
 
30
  * Указать количество знаков после запятой для отображения цен на сайте (для округления используется встроенный алгоритм Магенто). Пример: вместо 49.99 показывать или 50 или 49.9900
31
  * Отображать цены без "копеек". Пример: Вместо 49.00 показывать 49, но цену 49.99 не изменять.
 
32
  * Указать позицию символа валюты: перед ценой или после. Пример: $ 49.99 или 49.99 $
33
  * Указать, что использовать в качестве символа валюты. Пример: (не использовать; использовать код - EUR, USD; использовать символ - €, $; использовать название - Евро, Американский доллар)
34
  * Заменять символ валюты на свой (только текстовый). Пример: Вместо $ выводить Money.
@@ -37,6 +40,7 @@ RU:
37
  * Использовать различные настройки для каждой валюты отдельно.
38
  * Включать и отключать модуль для пользовательской части и панели администрирования независимо друг от друга.
39
  * Отключать округление цены на странице заказа.
 
40
 
41
  Важно: модуль меняет исключительно отображение валюты, а не саму цену. (Пример: Товар стоит 49.99; Можно показывать цену клиентам как 50; Но при оплате с клиента будет удержано 49.99, так как это реальная стоимость товара).
42
 
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 $
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
 
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.
40
  * Использовать различные настройки для каждой валюты отдельно.
41
  * Включать и отключать модуль для пользовательской части и панели администрирования независимо друг от друга.
42
  * Отключать округление цены на странице заказа.
43
+ * Включать округление цены на странице ввода товара.
44
 
45
  Важно: модуль меняет исключительно отображение валюты, а не саму цену. (Пример: Товар стоит 49.99; Можно показывать цену клиентам как 50; Но при оплате с клиента будет удержано 49.99, так как это реальная стоимость товара).
46
 
app/design/frontend/default/default/layout/et_currencymanager.xml CHANGED
@@ -23,6 +23,7 @@
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>
23
  <layout version="0.1.0">
24
  <default>
25
  <reference name="head">
26
+ <block ifconfig="currencymanager/general/enabled" type="currencymanager/js" name="currencymanager.js.config" template="et_currencymanager/js.phtml"></block>
27
  <action ifconfig="currencymanager/general/cutzerodecimal" method="addItem"><type>skin_js</type><name>et_currencymanager/et_currencymanager.js</name></action>
28
  <action ifconfig="currencymanager/general/enabled" method="addItem"><type>skin_js</type><name>et_currencymanager/et_currencymanager_round.js</name></action>
29
  </reference>
app/design/frontend/default/default/template/et_currencymanager/js.phtml ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ <script>
22
+ etCurrencyManagerJsConfig=<?php print $this->getJsonConfig();?>
23
+ </script>
app/locale/en_US/ET_Currencymanager.csv CHANGED
@@ -38,4 +38,8 @@
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"
 
 
 
 
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"
42
+ "Used only if Cut Zero Decimals = Yes, default "",-""","Used only if Cut Zero Decimals = Yes, default "",-"""
43
+ "Enable for Inputs","Enable for Inputs"
44
+ "Suffix:","Suffix:"
45
+ "Replaces Cuted Zero Decimals","Replaces Cuted Zero Decimals"
app/locale/ru_RU/ET_Currencymanager.csv CHANGED
@@ -39,4 +39,7 @@
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: ,-","Используется только при значении Отбрасывать нули после запятой = Да. По умолчанию: ,-"
 
 
 
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","Заменить отброшенные нули на значение"
package.xml CHANGED
@@ -1,23 +1,22 @@
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>
8
  <extends/>
9
- <summary>Changes:
10
- Added support for dynamic prices (Bundled, Configurable, Simple with custom options).</summary>
11
  <description>Currency Manager module allow to change in admin currency's display parametrs:
12
  * symbol
13
  * precision
14
  * symbol position
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>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>ET_CurrencyManager</name>
4
+ <version>0.2.2</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/afl-3.0.php">AFL v3.0</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>auto-converted</user><email>support@etwebsolutions.com</email></author><author><name>Andrej</name><user>auto-converted</user><email>support@etwebsolutions.com</email></author></authors>
17
+ <date>2011-08-18</date>
18
+ <time>06:53:50</time>
19
+ <contents><target name="magelocale"><dir name="en_US"><file name="ET_Currencymanager.csv" hash="c763398c9a2bcba295fe3ba623b6614f"/></dir><dir name="ru_RU"><file name="ET_Currencymanager.csv" hash="98bfa39b23bc23d511ed8cf1fd6977c1"/></dir></target><target name="magecommunity"><dir name="ET"><dir name="CurrencyManager"><dir name="Block"><dir name="Adminhtml"><file name="Formprice.php" hash="ca0be84893611f4c2ee870241ae14981"/><file name="Heading.php" hash="e60e170675c34ecfad27627fb40bbc17"/><file name="Symbolreplace.php" hash="8fbda51ecded6b82cafd5385c5fd8675"/></dir><file name="Js.php" hash="336a2b57ab7bcfdb6926cea9f3c724fe"/></dir><dir name="etc"><file name="config.xml" hash="d7becbc5aa8679f218364729a1b78caa"/><file name="system.xml" hash="99c95b7a2e2459617156cc38cc66e88a"/></dir><dir name="Helper"><file name="Data.php" hash="15b55f1f73a6b0ef19348d0d88b247cd"/></dir><dir name="Model"><file name="Currency.php" hash="e9292f4773ea244a48aa1fc55e8cc099"/><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="8845d5544f8a393693a7e39f2c72b1cf"/><file name="ET_CurrencyManager_Description.txt" hash="71f8a20d656437cd150c17ba138fced6"/><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="29d7a346ee4fad01afa5dc7b4661f1b5"/><file name="et_currencymanager_round.js" hash="6e337696b5afdfeb44d37c46311ff1e0"/></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="6bccf55ecf305295e74b3b3edc07c374"/></dir><dir name="template"><dir name="et_currencymanager"><file name="js.phtml" hash="2d3e3c3e8993781385bedad19641c2f6"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="ET_CurrencyManager.xml" hash="c1951d24b4320ed1bf3704363b0ace86"/></dir></target></contents>
20
  <compatible/>
21
  <dependencies/>
22
  </package>
skin/frontend/default/default/et_currencymanager/et_currencymanager.js CHANGED
@@ -2,7 +2,7 @@ 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;
@@ -10,5 +10,4 @@ if(typeof(Product)!="undefined"){
10
  var price2return = formatCurrency(price, tmpPriceFormat);
11
  return price2return;
12
  }});
13
-
14
- }
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;
10
  var price2return = formatCurrency(price, tmpPriceFormat);
11
  return price2return;
12
  }});
13
+ }
 
skin/frontend/default/default/et_currencymanager/et_currencymanager_round.js CHANGED
@@ -21,18 +21,65 @@ if(typeof(Product)!="undefined"){
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
  }
21
  }
22
  else {
23
  precision=2;
24
+ if(typeof(etCurrencyManagerJsConfig.precision)!="undefined")precision=etCurrencyManagerJsConfig.precision;
25
  if(typeof(optionsPrice)!="undefined")
26
  if(typeof(optionsPrice.priceFormat)!="undefined")
27
  precision=optionsPrice.priceFormat.requiredPrecision;
28
+ if(typeof(etCurrencyManagerJsConfig.cutzerodecimal)!="undefined")
29
+ if(etCurrencyManagerJsConfig.cutzerodecimal!=0)
30
+ if(price-parseInt(price)==0){
31
+ precision=0;
32
+ }
33
+ if(precision>0)str+= this.priceTemplate.evaluate({price:price.toFixed(precision)});
34
+ else{
35
+
36
+ if(typeof(etCurrencyManagerJsConfig.cutzerodecimal_suffix)!="undefined")
37
+ if(etCurrencyManagerJsConfig.cutzerodecimal_suffix.length>0){
38
+ price= price.toFixed(0)+""+etCurrencyManagerJsConfig.cutzerodecimal_suffix;
39
+ }
40
+ str+= this.priceTemplate.evaluate({price:price});
41
+ }
42
  }
43
  return str;
44
  }
45
 
46
 
47
  });
48
+ }
49
+
50
+
51
+
52
+ try{
53
+
54
+ originalFormatCurrency=window.formatCurrency;
55
+
56
+ window.formatCurrency= function formatCurrency(price, format, showPlus){
57
+ //zeroSymbol
58
+ if(typeof(etCurrencyManagerJsConfig)!="undefined"){
59
+ if(price==0)if(typeof(etCurrencyManagerJsConfig.zerotext)!="undefined")return etCurrencyManagerJsConfig.zerotext;
60
+ }
61
+ //cut zero decimal
62
+ if(price-parseInt(price)==0)
63
+ if(typeof(etCurrencyManagerJsConfig.cutzerodecimal)!="undefined")
64
+ if(etCurrencyManagerJsConfig.cutzerodecimal!=0){
65
+ format.precision=0;
66
+ format.requiredPrecision=0;
67
+
68
+ var for_replace = originalFormatCurrency(price, format, showPlus);
69
+
70
+
71
+ if(typeof(etCurrencyManagerJsConfig.cutzerodecimal_suffix)!="undefined")
72
+ if(etCurrencyManagerJsConfig.cutzerodecimal_suffix.length>0){
73
+ return for_replace.replace(price, price+""+etCurrencyManagerJsConfig.cutzerodecimal_suffix);
74
+
75
+ }
76
+ }
77
+
78
+ return originalFormatCurrency(price, format, showPlus);
79
+
80
+
81
+ }
82
+ }
83
+ catch (e){
84
+ //do nothing
85
  }