wp_price_decimal - Version 1.0.0

Version Notes

first release

Download this release

Release Info

Developer Magento Core Team
Extension wp_price_decimal
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

app/code/community/WP/PriceDecimal/Helper/Data.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class WP_PriceDecimal_Helper_Data extends Mage_Core_Helper_Abstract
4
+ {
5
+
6
+ }
app/code/community/WP/PriceDecimal/Model/Currency.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class WP_PriceDecimal_Model_Currency extends Mage_Directory_Model_Currency
4
+ {
5
+ /**
6
+ * Format price to currency format
7
+ *
8
+ * @param double $price
9
+ * @param bool $includeContainer
10
+ * @return string
11
+ */
12
+ public function format($price, $options=array(), $includeContainer = true, $addBrackets = false)
13
+ {
14
+ $config = Mage::getStoreConfig('price_decimal/general');
15
+ if (!$config['enabled']) return parent::format($price, $options, $includeContainer, $addBrackets);
16
+ $precision = 0; if (isset($config['precision']) && ($config['precision'] + 0) >= 0) $precision = $config['precision'] + 0;
17
+ return $this->formatPrecision($price, $precision, $options, $includeContainer, $addBrackets);
18
+ }
19
+ }
app/code/community/WP/PriceDecimal/etc/adminhtml.xml ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <config>
3
+ <acl>
4
+ <resources>
5
+ <admin>
6
+ <children>
7
+ <system>
8
+ <children>
9
+ <config>
10
+ <children>
11
+ <price_decimal translate="title" module="pricedecimal">
12
+ <title>Price Decimal Section</title>
13
+ <sort_order>200</sort_order>
14
+ </price_decimal>
15
+ </children>
16
+ </config>
17
+ </children>
18
+ </system>
19
+ </children>
20
+ </admin>
21
+ </resources>
22
+ </acl>
23
+ </config>
app/code/community/WP/PriceDecimal/etc/config.xml ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <WP_PriceDecimal>
5
+ <version>1.0.0</version>
6
+ </WP_PriceDecimal>
7
+ </modules>
8
+ <global>
9
+ <helpers>
10
+ <pricedecimal>
11
+ <class>WP_PriceDecimal_Helper</class>
12
+ </pricedecimal>
13
+ </helpers>
14
+ <models>
15
+ <directory>
16
+ <rewrite>
17
+ <currency>WP_PriceDecimal_Model_Currency</currency>
18
+ </rewrite>
19
+ </directory>
20
+ </models>
21
+ <resources>
22
+ <pricedecimal_setup>
23
+ <setup>
24
+ <module>WP_PriceDecimal</module>
25
+ </setup>
26
+ <connection>
27
+ <use>core_setup</use>
28
+ </connection>
29
+ </pricedecimal_setup>
30
+ <pricedecimal_write>
31
+ <connection>
32
+ <use>core_write</use>
33
+ </connection>
34
+ </pricedecimal_write>
35
+ <pricedecimal_read>
36
+ <connection>
37
+ <use>core_read</use>
38
+ </connection>
39
+ </pricedecimal_read>
40
+ </resources>
41
+ </global>
42
+ <default>
43
+ <price_decimal>
44
+ <general>
45
+ <enabled>1</enabled>
46
+ <precision>0</precision>
47
+ </general>
48
+ </price_decimal>
49
+ </default>
50
+ </config>
app/code/community/WP/PriceDecimal/etc/system.xml ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <tabs>
4
+ <web_and_people translate="label" module="pricedecimal">
5
+ <label>Web-And-People</label>
6
+ <sort_order>150</sort_order>
7
+ </web_and_people>
8
+ </tabs>
9
+ <sections>
10
+ <price_decimal translate="label" module="pricedecimal">
11
+ <label>Price Decimal</label>
12
+ <tab>web_and_people</tab>
13
+ <frontend_type>text</frontend_type>
14
+ <sort_order>100</sort_order>
15
+ <show_in_default>1</show_in_default>
16
+ <show_in_website>1</show_in_website>
17
+ <show_in_store>1</show_in_store>
18
+ <groups>
19
+ <general translate="label">
20
+ <label>General</label>
21
+ <frontend_type>text</frontend_type>
22
+ <sort_order>10</sort_order>
23
+ <show_in_default>1</show_in_default>
24
+ <show_in_website>1</show_in_website>
25
+ <show_in_store>1</show_in_store>
26
+ <fields>
27
+ <enabled translate="label">
28
+ <label>Enable</label>
29
+ <frontend_type>select</frontend_type>
30
+ <source_model>adminhtml/system_config_source_yesno</source_model>
31
+ <sort_order>1</sort_order>
32
+ <show_in_default>1</show_in_default>
33
+ <show_in_website>1</show_in_website>
34
+ <show_in_store>1</show_in_store>
35
+ </enabled>
36
+ <precision translate="label comment">
37
+ <label>Precision</label>
38
+ <comment>Number of decimal (e.g. 0, 1, 2). </comment>
39
+ <frontend_type>text</frontend_type>
40
+ <sort_order>3</sort_order>
41
+ <show_in_default>1</show_in_default>
42
+ <show_in_website>1</show_in_website>
43
+ <show_in_store>1</show_in_store>
44
+ </precision>
45
+ </fields>
46
+ </general>
47
+ </groups>
48
+ </price_decimal>
49
+ </sections>
50
+ </config>
app/etc/modules/WP_PriceDecimal.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <WP_PriceDecimal>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ </WP_PriceDecimal>
8
+ </modules>
9
+ </config>
package.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>wp_price_decimal</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Decimal price (WebAndPeople.com)</summary>
10
+ <description>Decimal price (WebAndPeople.com)</description>
11
+ <notes>first release</notes>
12
+ <authors><author><name>WebAndPeople</name><user>auto-converted</user><email>design@webandpeople.com</email></author><author><name>y.gerassimenko</name><user>auto-converted</user><email>y.gerassimenko@webandpeople.com</email></author></authors>
13
+ <date>2010-08-30</date>
14
+ <time>17:57:06</time>
15
+ <contents><target name="mageetc"><dir name="modules"><file name="WP_PriceDecimal.xml" hash="9b870760e423ab063bd152305552564c"/></dir></target><target name="magecommunity"><dir name="WP"><dir name="PriceDecimal"><dir name="etc"><file name="adminhtml.xml" hash="b9fd1982d451e1f903ca17e9d54477e2"/><file name="config.xml" hash="0de8307d00a8b13a06c3876149e44ca1"/><file name="system.xml" hash="1de46bfbebdc5f5ed6be5a737b5bc0d9"/></dir><dir name="Helper"><file name="Data.php" hash="15bf7377bbd5f631a3437acff9c69d93"/></dir><dir name="Model"><file name="Currency.php" hash="d32363396e2acfc32c75b18fe0a9e582"/></dir></dir></dir></target></contents>
16
+ <compatible/>
17
+ <dependencies/>
18
+ </package>