Version Notes
Added param - Exclude Checkout, to leave decimal price in the shopping cart (e.g. due to taxes)
Download this release
Release Info
Developer | Magento Core Team |
Extension | wp_price_decimal |
Version | 1.1.0 |
Comparing to | |
See all releases |
Code changes from version 1.0.2 to 1.1.0
app/code/community/WP/PriceDecimal/Model/Currency.php
CHANGED
@@ -2,18 +2,20 @@
|
|
2 |
|
3 |
class WP_PriceDecimal_Model_Currency extends Mage_Directory_Model_Currency
|
4 |
{
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
|
|
|
|
19 |
}
|
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 |
+
$moduleName = Mage::app()->getRequest()->getModuleName(); $skeep = false;
|
16 |
+
if ($moduleName == 'checkout' && $config['exclude_cart']) $skeep = true;
|
17 |
+
if (!$config['enabled'] || $skeep) return parent::format($price, $options, $includeContainer, $addBrackets);
|
18 |
+
$precision = 0; if (isset($config['precision']) && ($config['precision'] + 0) >= 0) $precision = $config['precision'] + 0;
|
19 |
+
return $this->formatPrecision($price, $precision, $options, $includeContainer, $addBrackets);
|
20 |
+
}
|
21 |
}
|
app/code/community/WP/PriceDecimal/etc/adminhtml.xml
CHANGED
@@ -1,23 +1,23 @@
|
|
1 |
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
<config>
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
<children>
|
7 |
-
<system>
|
8 |
-
<children>
|
9 |
-
<config>
|
10 |
<children>
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
</children>
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
</children>
|
20 |
-
</admin>
|
21 |
-
</resources>
|
22 |
-
</acl>
|
23 |
</config>
|
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
CHANGED
@@ -44,6 +44,7 @@
|
|
44 |
<general>
|
45 |
<enabled>1</enabled>
|
46 |
<precision>0</precision>
|
|
|
47 |
</general>
|
48 |
</price_decimal>
|
49 |
</default>
|
44 |
<general>
|
45 |
<enabled>1</enabled>
|
46 |
<precision>0</precision>
|
47 |
+
<exclude_cart>0</exclude_cart>
|
48 |
</general>
|
49 |
</price_decimal>
|
50 |
</default>
|
app/code/community/WP/PriceDecimal/etc/system.xml
CHANGED
@@ -42,6 +42,16 @@
|
|
42 |
<show_in_website>1</show_in_website>
|
43 |
<show_in_store>1</show_in_store>
|
44 |
</precision>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
</fields>
|
46 |
</general>
|
47 |
</groups>
|
42 |
<show_in_website>1</show_in_website>
|
43 |
<show_in_store>1</show_in_store>
|
44 |
</precision>
|
45 |
+
<exclude_cart translate="label comment">
|
46 |
+
<label>Exclude Checkout</label>
|
47 |
+
<comment>Select "Yes" to leave decimal price in the shopping cart (e.g. due to taxes)</comment>
|
48 |
+
<frontend_type>select</frontend_type>
|
49 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
50 |
+
<sort_order>5</sort_order>
|
51 |
+
<show_in_default>1</show_in_default>
|
52 |
+
<show_in_website>1</show_in_website>
|
53 |
+
<show_in_store>1</show_in_store>
|
54 |
+
</exclude_cart>
|
55 |
</fields>
|
56 |
</general>
|
57 |
</groups>
|
package.xml
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>wp_price_decimal</name>
|
4 |
-
<version>1.0
|
5 |
<stability>stable</stability>
|
6 |
-
<license uri="http://www.opensource.org/licenses/
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
-
<summary>Decimal price (WebAndPeople.com)</summary>
|
10 |
-
<description>Decimal price (WebAndPeople.com)</description>
|
11 |
-
<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>
|
14 |
-
<time>
|
15 |
-
<contents><target name="
|
16 |
<compatible/>
|
17 |
<dependencies/>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>wp_price_decimal</name>
|
4 |
+
<version>1.1.0</version>
|
5 |
<stability>stable</stability>
|
6 |
+
<license uri="http://www.opensource.org/licenses/academic.php">Academic Free License (AFL)</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
+
<summary>Decimal price (WebAndPeople.com) for magento v1.4</summary>
|
10 |
+
<description>Decimal price (WebAndPeople.com) for magento v1.4</description>
|
11 |
+
<notes>Added param - Exclude Checkout, to leave decimal price in the shopping cart (e.g. due to taxes)</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>2011-01-06</date>
|
14 |
+
<time>14:44:33</time>
|
15 |
+
<contents><target name="mageweb"><dir name="app"><dir name="code"><dir name="community"><dir name="WP"><dir name="PriceDecimal"><dir name="Helper"><file name="Data.php" hash="15bf7377bbd5f631a3437acff9c69d93"/></dir><dir name="Model"><file name="Currency.php" hash="360b2515266fcbfa696bacdc0a492d8f"/></dir><dir name="etc"><file name="adminhtml.xml" hash="d5e354aff4dce552608b26d6c076877e"/><file name="config.xml" hash="72bdab3e7b5f4750464357f1997ee26b"/><file name="system.xml" hash="0200370cd427a9de7f13c610bbc43e78"/></dir></dir></dir></dir></dir><dir name="etc"><dir name="modules"><file name="WP_PriceDecimal.xml" hash="9b870760e423ab063bd152305552564c"/></dir></dir></dir></target></contents>
|
16 |
<compatible/>
|
17 |
<dependencies/>
|
18 |
</package>
|