Version Notes
~ bugfix: decimal price in backand when Exclude Checkout = yes
Download this release
Release Info
Developer | Magento Core Team |
Extension | wp_price_decimal |
Version | 1.2.0 |
Comparing to | |
See all releases |
Code changes from version 1.1.0 to 1.2.0
- app/code/community/WP/PriceDecimal/Block/About.php +39 -0
- app/code/community/WP/PriceDecimal/Model/Currency.php +4 -1
- app/code/community/WP/PriceDecimal/etc/adminhtml.xml +0 -23
- app/code/community/WP/PriceDecimal/etc/config.xml +86 -51
- app/code/community/WP/PriceDecimal/etc/system.xml +87 -60
- package.xml +7 -7
app/code/community/WP/PriceDecimal/Block/About.php
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class WP_PriceDecimal_Block_About
|
4 |
+
extends Mage_Adminhtml_Block_Abstract
|
5 |
+
implements Varien_Data_Form_Element_Renderer_Interface
|
6 |
+
{
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Render fieldset html
|
10 |
+
*
|
11 |
+
* @param Varien_Data_Form_Element_Abstract $element
|
12 |
+
* @return string
|
13 |
+
*/
|
14 |
+
public function render(Varien_Data_Form_Element_Abstract $element)
|
15 |
+
{
|
16 |
+
$html = <<<HTML
|
17 |
+
<div style="background:url('http://www.webandpeople.com/template/public/images/logo.gif') no-repeat scroll 14px 14px #EAF0EE;border:1px solid #CCCCCC;margin-bottom:10px;padding:10px 5px 5px 164px;">
|
18 |
+
<p>
|
19 |
+
<b style="font-size:12px;">WebAndPeople</b>, a family of niche sites, provides small businesses with everything they need to start selling online.
|
20 |
+
</p>
|
21 |
+
<p>
|
22 |
+
<strong>PREMIUM and FREE MAGENTO TEMPALTES and EXTENSIONS</strong><br />
|
23 |
+
<a href="http://web-experiment.info" target="_blank">Web-Experiment.info</a> offers a wide choice of nice-looking and easily editable free and premium Magento Themes. At Web-Experiment, you can find free downloads or buy premium tempaltes for the extremely popular Magento eCommerce platform.<br />
|
24 |
+
<strong>MAGENTO HOSTING</strong></strong><br />
|
25 |
+
<a href="http://magenting.com" target="_blank">Magenting.com</a>, a new and improved hosting solution, is allowing you to easily create, promote, and manage your online store with Magento. Magenting users will receive a valuable set of tools and features, including automatic Magento eCommerce installation, automatic Magento template installation and a free or paid professional Magento hosting account.<br />
|
26 |
+
<strong>WEB DEVELOPMENT</strong><br />
|
27 |
+
<a href="http://webandpeople.com" target="_blank">WebAndPeople.com</a> is a team of professional Web developers and designers who are some of the best in the industry. WebAndPeople provides Web application development, custom Magento theme designs, and Website design services.<br />
|
28 |
+
<br />
|
29 |
+
</p>
|
30 |
+
<p>
|
31 |
+
Our themes and extensions on <a href="http://www.magentocommerce.com/magento-connect/developer/WebAndPeople" target="_blank">MagentoConnect</a><br />
|
32 |
+
Should you have any questions <a href="http://webandpeople.com/contact.html" target="_blank">Contact Us</a> or email at <a href="mailto:info@webandpeople.com">info@webandpeople.com</a>
|
33 |
+
<br />
|
34 |
+
</p>
|
35 |
+
</div>
|
36 |
+
HTML;
|
37 |
+
return $html;
|
38 |
+
}
|
39 |
+
}
|
app/code/community/WP/PriceDecimal/Model/Currency.php
CHANGED
@@ -12,8 +12,11 @@ class WP_PriceDecimal_Model_Currency extends Mage_Directory_Model_Currency
|
|
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();
|
|
|
|
|
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);
|
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();
|
16 |
+
$controllerName = Mage::app()->getRequest()->getControllerName();
|
17 |
+
$skeep = false;
|
18 |
if ($moduleName == 'checkout' && $config['exclude_cart']) $skeep = true;
|
19 |
+
if ($moduleName == 'admin' && $controllerName == 'sales_order_create' && $config['exclude_cart']) $skeep = true;
|
20 |
if (!$config['enabled'] || $skeep) return parent::format($price, $options, $includeContainer, $addBrackets);
|
21 |
$precision = 0; if (isset($config['precision']) && ($config['precision'] + 0) >= 0) $precision = $config['precision'] + 0;
|
22 |
return $this->formatPrecision($price, $precision, $options, $includeContainer, $addBrackets);
|
app/code/community/WP/PriceDecimal/etc/adminhtml.xml
DELETED
@@ -1,23 +0,0 @@
|
|
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
@@ -1,51 +1,86 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<config>
|
3 |
-
<modules>
|
4 |
-
<WP_PriceDecimal>
|
5 |
-
<version>1.0
|
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 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
</
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<WP_PriceDecimal>
|
5 |
+
<version>1.2.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 |
+
</global>
|
22 |
+
<adminhtml>
|
23 |
+
<acl>
|
24 |
+
<resources>
|
25 |
+
<all>
|
26 |
+
<title>Allow Everything</title>
|
27 |
+
</all>
|
28 |
+
<admin>
|
29 |
+
<children>
|
30 |
+
<system>
|
31 |
+
<children>
|
32 |
+
<config>
|
33 |
+
<children>
|
34 |
+
<price_decimal translate="title" module="pricedecimal">
|
35 |
+
<title><![CDATA[Web & People: Price Decimal]]></title>
|
36 |
+
<sort_order>1000</sort_order>
|
37 |
+
</price_decimal>
|
38 |
+
</children>
|
39 |
+
</config>
|
40 |
+
</children>
|
41 |
+
</system>
|
42 |
+
</children>
|
43 |
+
</admin>
|
44 |
+
</resources>
|
45 |
+
</acl>
|
46 |
+
</adminhtml>
|
47 |
+
<default>
|
48 |
+
<price_decimal>
|
49 |
+
<general>
|
50 |
+
<enabled>1</enabled>
|
51 |
+
<precision>0</precision>
|
52 |
+
<exclude_cart>0</exclude_cart>
|
53 |
+
<version>1.2.0</version>
|
54 |
+
</general>
|
55 |
+
</price_decimal>
|
56 |
+
</default>
|
57 |
+
<adminhtml>
|
58 |
+
<acl>
|
59 |
+
<resources>
|
60 |
+
<admin>
|
61 |
+
<children>
|
62 |
+
<system>
|
63 |
+
<children>
|
64 |
+
<config>
|
65 |
+
<children>
|
66 |
+
<about_webandpeople translate="title" module="pricedecimal">
|
67 |
+
<title><![CDATA[Web & People: About Us]]></title>
|
68 |
+
<sort_order>1000</sort_order>
|
69 |
+
</about_webandpeople>
|
70 |
+
</children>
|
71 |
+
</config>
|
72 |
+
</children>
|
73 |
+
</system>
|
74 |
+
</children>
|
75 |
+
</admin>
|
76 |
+
</resources>
|
77 |
+
</acl>
|
78 |
+
</adminhtml>
|
79 |
+
<global>
|
80 |
+
<blocks>
|
81 |
+
<pricedecimal>
|
82 |
+
<class>WP_PriceDecimal_Block</class>
|
83 |
+
</pricedecimal>
|
84 |
+
</blocks>
|
85 |
+
</global>
|
86 |
+
</config>
|
app/code/community/WP/PriceDecimal/etc/system.xml
CHANGED
@@ -1,60 +1,87 @@
|
|
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 |
-
<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 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
</
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
<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 |
+
<version translate="label comment">
|
56 |
+
<label>Current Version</label>
|
57 |
+
<comment><![CDATA[The current version of the installed extension]]></comment>
|
58 |
+
<frontend_type>label</frontend_type>
|
59 |
+
<sort_order>100</sort_order>
|
60 |
+
<show_in_default>1</show_in_default>
|
61 |
+
<show_in_website>1</show_in_website>
|
62 |
+
<show_in_store>1</show_in_store>
|
63 |
+
</version>
|
64 |
+
</fields>
|
65 |
+
</general>
|
66 |
+
</groups>
|
67 |
+
</price_decimal>
|
68 |
+
<about_webandpeople translate="label" module="pricedecimal">
|
69 |
+
<label>About Us</label>
|
70 |
+
<tab>web_and_people</tab>
|
71 |
+
<frontend_type>text</frontend_type>
|
72 |
+
<sort_order>99</sort_order>
|
73 |
+
<show_in_default>1</show_in_default>
|
74 |
+
<show_in_website>1</show_in_website>
|
75 |
+
<show_in_store>1</show_in_store>
|
76 |
+
<groups>
|
77 |
+
<info>
|
78 |
+
<frontend_model>pricedecimal/about</frontend_model>
|
79 |
+
<sort_order>10</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 |
+
</info>
|
84 |
+
</groups>
|
85 |
+
</about_webandpeople>
|
86 |
+
</sections>
|
87 |
+
</config>
|
package.xml
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>wp_price_decimal</name>
|
4 |
-
<version>1.
|
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)
|
10 |
-
<description>Decimal price (WebAndPeople.com)
|
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>2011-
|
14 |
-
<time>
|
15 |
-
<contents><target name="mageweb"><dir name="app"><dir name="code"><dir name="community"><dir name="WP"><dir name="PriceDecimal"><dir name="
|
16 |
<compatible/>
|
17 |
<dependencies/>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>wp_price_decimal</name>
|
4 |
+
<version>1.2.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)</summary>
|
10 |
+
<description>Decimal price (WebAndPeople.com)</description>
|
11 |
+
<notes>~ bugfix: decimal price in backand when Exclude Checkout = yes</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-07-31</date>
|
14 |
+
<time>02:15:02</time>
|
15 |
+
<contents><target name="mageweb"><dir name="app"><dir name="code"><dir name="community"><dir name="WP"><dir name="PriceDecimal"><dir name="Block"><file name="About.php" hash="5c0719ff5bda0feb45cde267e28b3714"/></dir><dir name="Helper"><file name="Data.php" hash="15bf7377bbd5f631a3437acff9c69d93"/></dir><dir name="Model"><file name="Currency.php" hash="3127adf6b1e2ca9121256ccb252853d7"/></dir><dir name="etc"><file name="config.xml" hash="2f102ab8fc9db2d6db2c33581613d037"/><file name="system.xml" hash="7ab1bf4ba9bb964753363c052de9a70f"/></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>
|