MarKor_Changeprice - Version 1.0.0

Version Notes

- Configurable three places to display module.

Download this release

Release Info

Developer MarKor NET
Extension MarKor_Changeprice
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

app/code/community/MarKor/Changeprice/Helper/Data.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * MarKor NET
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * @category MarKorNET
13
+ * @package MarKor_Changeprice
14
+ * @author Marcin Korzystka <support@markornet.com>
15
+ * @copyright Copyright (c) MarKor NET (http://www.markornet.com)
16
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
+ */
18
+
19
+ class MarKor_Changeprice_Helper_Data extends Mage_Core_Helper_Abstract
20
+ {
21
+
22
+ }
app/code/community/MarKor/Changeprice/etc/adminhtml.xml ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * MarKor NET
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ *
13
+ * @category MarKorNET
14
+ * @package MarKor_Changeprice
15
+ * @author Marcin Korzystka <support@markornet.com>
16
+ * @copyright Copyright (c) MarKor NET (http://www.markornet.com)
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ */
19
+ -->
20
+ <config>
21
+ <acl>
22
+ <resources>
23
+ <all>
24
+ <title>Allow Everything</title>
25
+ </all>
26
+ <admin>
27
+ <children>
28
+ <system>
29
+ <children>
30
+ <config>
31
+ <children>
32
+ <changeprice>
33
+ <title>MarKorNET Change Price</title>
34
+ </changeprice>
35
+ </children>
36
+ </config>
37
+ </children>
38
+ </system>
39
+ </children>
40
+ </admin>
41
+ </resources>
42
+ </acl>
43
+ </config>
app/code/community/MarKor/Changeprice/etc/config.xml ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ /**
4
+ * MarKor NET
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ *
13
+ * @category MarKorNET
14
+ * @package MarKor_Changeprice
15
+ * @author Marcin Korzystka <support@markornet.com>
16
+ * @copyright Copyright (c) MarKor NET (http://www.markornet.com)
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ */
19
+ -->
20
+ <config>
21
+ <modules>
22
+ <MarKor_Changeprice>
23
+ <version>1.0.0</version>
24
+ </MarKor_Changeprice>
25
+ </modules>
26
+ <global>
27
+ <helpers>
28
+ <changeprice>
29
+ <class>MarKor_Changeprice_Helper</class>
30
+ </changeprice>
31
+ </helpers>
32
+ </global>
33
+ <frontend>
34
+ <layout>
35
+ <updates>
36
+ <MarKor_Changeprice module="MarKor_Changeprice">
37
+ <file>markor/changeprice.xml</file>
38
+ </MarKor_Changeprice>
39
+ </updates>
40
+ </layout>
41
+ </frontend>
42
+ </config>
app/code/community/MarKor/Changeprice/etc/system.xml ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ /**
4
+ * MarKor NET
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ *
13
+ * @category MarKorNET
14
+ * @package MarKor_Changeprice
15
+ * @author Marcin Korzystka <support@markornet.com>
16
+ * @copyright Copyright (c) MarKor NET (http://www.markornet.com)
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ */
19
+ -->
20
+ <config>
21
+ <tabs>
22
+ <markor translate="label" module="changeprice">
23
+ <label>MARKOR NET</label>
24
+ <sort_order>300</sort_order>
25
+ </markor>
26
+ </tabs>
27
+ <sections>
28
+ <changeprice translate="label" module="changeprice">
29
+ <label>Change Price</label>
30
+ <tab>markor</tab>
31
+ <frontend_type>text</frontend_type>
32
+ <sort_order>330</sort_order>
33
+ <show_in_default>1</show_in_default>
34
+ <show_in_website>1</show_in_website>
35
+ <show_in_store>1</show_in_store>
36
+ <groups>
37
+ <SAMPLE translate="label">
38
+ <label>Change Price Options</label>
39
+ <frontend_type>text</frontend_type>
40
+ <sort_order>100</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
+ <fields>
45
+ <footermode translate="label">
46
+ <label>Footer display</label>
47
+ <comment>If enabled, block will show in footer</comment>
48
+ <frontend_type>select</frontend_type>
49
+ <source_model>adminhtml/system_config_source_yesno</source_model>
50
+ <sort_order>10</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
+ </footermode>
55
+ <rightmode translate="label">
56
+ <label>Right display</label>
57
+ <comment>If enabled, block will show in right column</comment>
58
+ <frontend_type>select</frontend_type>
59
+ <source_model>adminhtml/system_config_source_yesno</source_model>
60
+ <sort_order>11</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
+ </rightmode>
65
+ <leftmode translate="label">
66
+ <label>Left display</label>
67
+ <comment>If enabled, block will show in left column</comment>
68
+ <frontend_type>select</frontend_type>
69
+ <source_model>adminhtml/system_config_source_yesno</source_model>
70
+ <sort_order>14</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
+ </leftmode>
75
+ </fields>
76
+ </SAMPLE>
77
+ </groups>
78
+ </changeprice>
79
+ </sections>
80
+ </config>
app/design/frontend/base/default/layout/markor/changeprice.xml ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * MarKor NET
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ *
13
+ * @category MarKorNET
14
+ * @package MarKor_Changeprice
15
+ * @author Marcin Korzystka <support@markornet.com>
16
+ * @copyright Copyright (c) MarKor NET (http://www.markornet.com)
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ */
19
+ -->
20
+ <layout version="0.0.1">
21
+ <!--
22
+ Default layout
23
+ -->
24
+ <default>
25
+ <reference name="head">
26
+ <action method="addJs">
27
+ <script>markor/changeprice/changeprice.js</script>
28
+ <sort_order>997</sort_order>
29
+ </action>
30
+ <action method="addCss">
31
+ <stylesheet>css/markor/changeprice/main.css</stylesheet>
32
+ <sort_order>997</sort_order>
33
+ </action>
34
+ </reference>
35
+ <reference name="left">
36
+ <block type="core/template" name="changepriceLeft">
37
+ <action method="setTemplate" ifconfig="changeprice/SAMPLE/leftmode"><template>markor/changeprice/left.phtml</template></action>
38
+ </block>
39
+ </reference>
40
+ <reference name="right">
41
+ <block type="core/template" name="changepriceRight">
42
+ <action method="setTemplate" ifconfig="changeprice/SAMPLE/rightmode"><template>markor/changeprice/left.phtml</template></action>
43
+ </block>
44
+ </reference>
45
+ <reference name="footer">
46
+ <block type="core/template" name="changeprice">
47
+ <action method="setTemplate" ifconfig="changeprice/SAMPLE/footermode"><template>markor/changeprice/left.phtml</template></action>
48
+ </block>
49
+ </reference>
50
+ </default>
51
+ </layout>
app/design/frontend/base/default/template/markor/changeprice/left.phtml ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * MarKor NET
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * @category MarKorNET
13
+ * @package MarKor_Changeprice
14
+ * @author Marcin Korzystka <support@markornet.com>
15
+ * @copyright Copyright (c) MarKor NET (http://www.markornet.com)
16
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
+ */
18
+ ?>
19
+ <div class="block changeprice">
20
+ <div class="block-title"><strong><span><?php echo $this->__('Catalog Price Scope'); ?></span></strong></div>
21
+ <div class="block-content">
22
+ <p><?php echo $this->__('Price Type'); ?></p>
23
+ <span id="pbrutto"><?php echo $this->helper('tax')->__('Incl. Tax:'); ?></span>/<span id="pnetto"><?php echo $this->helper('tax')->__('Excl. Tax:'); ?></span>
24
+ </div>
25
+ </div>
26
+ <script>
27
+ $j("#pnetto").click(function() {
28
+ $j("span.price-including-tax").css("display","none");
29
+ $j("span.price-excluding-tax").css("display","block");
30
+ Mage.Cookies.set('DisplayNet',1);
31
+ $j(this).css("text-decoration","none");
32
+ $j("#pbrutto").css("text-decoration","line-through");
33
+ });
34
+ $j("#pbrutto").click(function() {
35
+ $j("span.price-including-tax").css("display","block");
36
+ $j("span.price-excluding-tax").css("display","none");
37
+ Mage.Cookies.set('DisplayNet',0);
38
+ $j(this).css("text-decoration","none");
39
+ $j("#pnetto").css("text-decoration","line-through");
40
+ });
41
+ </script>
app/etc/modules/MarKor_Changeprice.xml ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * MarKor NET
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ *
13
+ * @category MarKorNET
14
+ * @package MarKor_Changeprice
15
+ * @author Marcin Korzystka <support@markornet.com>
16
+ * @copyright Copyright (c) MarKor NET (http://www.markornet.com)
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ */
19
+ -->
20
+ <config>
21
+ <modules>
22
+ <MarKor_Changeprice>
23
+ <active>true</active>
24
+ <codePool>community</codePool>
25
+ </MarKor_Changeprice>
26
+ </modules>
27
+ </config>
js/markor/changeprice/changeprice.js ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * MarKor NET
3
+ *
4
+ * NOTICE OF LICENSE
5
+ *
6
+ * This source file is subject to the Open Software License (OSL 3.0)
7
+ * that is bundled with this package in the file LICENSE.txt.
8
+ * It is also available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ *
11
+ * @category MarKorNET
12
+ * @package MarKor_Changeprice
13
+ * @author Marcin Korzystka <support@markornet.com>
14
+ * @copyright Copyright (c) MarKor NET (http://www.markornet.com)
15
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
+ */
17
+ jQuery(document).ready(function(){if(Mage.Cookies.get('DisplayNet')==1) {$j("span.price-including-tax").css("display","none"); $j("span.price-excluding-tax").css("display","block");}});
js/markor/changeprice/jquery.cookie.js ADDED
@@ -0,0 +1,117 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * jQuery Cookie Plugin v1.4.1
3
+ * https://github.com/carhartl/jquery-cookie
4
+ *
5
+ * Copyright 2013 Klaus Hartl
6
+ * Released under the MIT license
7
+ */
8
+ (function (factory) {
9
+ if (typeof define === 'function' && define.amd) {
10
+ // AMD
11
+ define(['jquery'], factory);
12
+ } else if (typeof exports === 'object') {
13
+ // CommonJS
14
+ factory(require('jquery'));
15
+ } else {
16
+ // Browser globals
17
+ factory(jQuery);
18
+ }
19
+ }(function ($) {
20
+
21
+ var pluses = /\+/g;
22
+
23
+ function encode(s) {
24
+ return config.raw ? s : encodeURIComponent(s);
25
+ }
26
+
27
+ function decode(s) {
28
+ return config.raw ? s : decodeURIComponent(s);
29
+ }
30
+
31
+ function stringifyCookieValue(value) {
32
+ return encode(config.json ? JSON.stringify(value) : String(value));
33
+ }
34
+
35
+ function parseCookieValue(s) {
36
+ if (s.indexOf('"') === 0) {
37
+ // This is a quoted cookie as according to RFC2068, unescape...
38
+ s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
39
+ }
40
+
41
+ try {
42
+ // Replace server-side written pluses with spaces.
43
+ // If we can't decode the cookie, ignore it, it's unusable.
44
+ // If we can't parse the cookie, ignore it, it's unusable.
45
+ s = decodeURIComponent(s.replace(pluses, ' '));
46
+ return config.json ? JSON.parse(s) : s;
47
+ } catch(e) {}
48
+ }
49
+
50
+ function read(s, converter) {
51
+ var value = config.raw ? s : parseCookieValue(s);
52
+ return $.isFunction(converter) ? converter(value) : value;
53
+ }
54
+
55
+ var config = $.cookie = function (key, value, options) {
56
+
57
+ // Write
58
+
59
+ if (value !== undefined && !$.isFunction(value)) {
60
+ options = $.extend({}, config.defaults, options);
61
+
62
+ if (typeof options.expires === 'number') {
63
+ var days = options.expires, t = options.expires = new Date();
64
+ t.setTime(+t + days * 864e+5);
65
+ }
66
+
67
+ return (document.cookie = [
68
+ encode(key), '=', stringifyCookieValue(value),
69
+ options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
70
+ options.path ? '; path=' + options.path : '',
71
+ options.domain ? '; domain=' + options.domain : '',
72
+ options.secure ? '; secure' : ''
73
+ ].join(''));
74
+ }
75
+
76
+ // Read
77
+
78
+ var result = key ? undefined : {};
79
+
80
+ // To prevent the for loop in the first place assign an empty array
81
+ // in case there are no cookies at all. Also prevents odd result when
82
+ // calling $.cookie().
83
+ var cookies = document.cookie ? document.cookie.split('; ') : [];
84
+
85
+ for (var i = 0, l = cookies.length; i < l; i++) {
86
+ var parts = cookies[i].split('=');
87
+ var name = decode(parts.shift());
88
+ var cookie = parts.join('=');
89
+
90
+ if (key && key === name) {
91
+ // If second argument (value) is a function it's a converter...
92
+ result = read(cookie, value);
93
+ break;
94
+ }
95
+
96
+ // Prevent storing a cookie that we couldn't decode.
97
+ if (!key && (cookie = read(cookie)) !== undefined) {
98
+ result[name] = cookie;
99
+ }
100
+ }
101
+
102
+ return result;
103
+ };
104
+
105
+ config.defaults = {};
106
+
107
+ $.removeCookie = function (key, options) {
108
+ if ($.cookie(key) === undefined) {
109
+ return false;
110
+ }
111
+
112
+ // Must not alter options, thus extending a fresh object...
113
+ $.cookie(key, '', $.extend({}, options, { expires: -1 }));
114
+ return !$.cookie(key);
115
+ };
116
+
117
+ }));
package.xml ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>MarKor_Changeprice</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Module to change price on frontend.</summary>
10
+ <description>Your products have price include tax?&#xD;
11
+ &#xD;
12
+ This module allow you change product's price for all catalog. You can change between 'exclude tax' and 'include tax'.</description>
13
+ <notes>- Configurable three places to display module.&#xD;
14
+ </notes>
15
+ <authors><author><name>MarKor NET</name><user>markornet</user><email>biuro@markornet.com</email></author></authors>
16
+ <date>2015-02-19</date>
17
+ <time>12:54:31</time>
18
+ <contents><target name="magecommunity"><dir name="MarKor"><dir name="Changeprice"><dir name="Helper"><file name="Data.php" hash="af788d63886a63cccfe7ab11d743a502"/></dir><dir name="etc"><file name="adminhtml.xml" hash="053f715d9cb32f6a1a1bf2aaf8bb8b69"/><file name="config.xml" hash="01bedcd7cff18149e8328c1722338362"/><file name="system.xml" hash="2f49c83cbfbbb8c004486a1747104143"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="markor"><file name="changeprice.xml" hash="f7312cc3c2a18021028a3d811d3a34f0"/></dir></dir><dir name="template"><dir name="markor"><dir name="changeprice"><file name="left.phtml" hash="41f2ad20f688f3ce64ce5a1478b72325"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="MarKor_Changeprice.xml" hash="85adadb53667c20a3e0123582e3981e5"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><dir name="markor"><dir name="changeprice"><file name="main.css" hash="1f6584ad20d49b0f3b454cf950b554bd"/></dir></dir></dir></dir></dir></dir></target><target name="mageweb"><dir name="js"><dir name="markor"><dir name="changeprice"><file name="changeprice.js" hash="4b9d7711d9b4e0c783f7214a304fc2d1"/><file name="jquery.cookie.js" hash="d5528dde0006c78be04817327c2f9b6f"/></dir></dir></dir></target></contents>
19
+ <compatible/>
20
+ <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
21
+ </package>
skin/frontend/base/default/css/markor/changeprice/main.css ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ .product-view .product-shop .price-box span.price-excluding-tax, .price-box .price-excluding-tax {display:none;}
2
+ #pbrutto, #pnetto {cursor: pointer; margin: 0 5px;}
3
+ #pnetto {text-decoration: line-through;}