Elgentos_Tierpercentages - Version 0.1.2

Version Notes

- Added a forgotten layout XML file
- Built in extra Javascript to check to prevent "Do you want to update the prices?" from being asked when filling out a new product.
- Checked M CE 1.7.0.0 compatibility

Download this release

Release Info

Developer Peter Jaap Blaakmeer
Extension Elgentos_Tierpercentages
Version 0.1.2
Comparing to
See all releases


Code changes from version 0.1.0 to 0.1.2

app/code/local/Elgentos/Tierpercentages/Model/Header.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Elgentos_Tierpercentages_Model_Header
3
+ {
4
+ private function getVersion() {
5
+ return Mage::getConfig()->getNode('modules/'.$this->getModulename(true).'/version');
6
+ }
7
+
8
+ private function getModulename($includePackagename=false) {
9
+ list($p,$m,$c,$a) = explode('_',get_class());
10
+ if($includePackagename) return $p.'_'.$m;
11
+ return strtoupper($m);
12
+ }
13
+
14
+ public function add($page) {
15
+ if($page->getPage()->getIdentifier()=='home') header('X-ELGENTOS-'.$this->getModulename().': '.$this->getVersion());
16
+ }
17
+ }
app/code/local/Elgentos/Tierpercentages/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Elgentos_Tierpercentages>
5
- <version>0.1.0</version>
6
  </Elgentos_Tierpercentages>
7
  </modules>
8
 
@@ -16,6 +16,20 @@
16
  </layout>
17
  </adminhtml>
18
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  <global>
20
  <blocks>
21
  <tierpercentages>
2
  <config>
3
  <modules>
4
  <Elgentos_Tierpercentages>
5
+ <version>0.1.2</version>
6
  </Elgentos_Tierpercentages>
7
  </modules>
8
 
16
  </layout>
17
  </adminhtml>
18
 
19
+ <frontend>
20
+ <events>
21
+ <cms_page_render>
22
+ <observers>
23
+ <tierpercentages>
24
+ <type>singleton</type>
25
+ <class>Elgentos_Tierpercentages_Model_Header</class>
26
+ <method>add</method>
27
+ </tierpercentages>
28
+ </observers>
29
+ </cms_page_render>
30
+ </events>
31
+ </frontend>
32
+
33
  <global>
34
  <blocks>
35
  <tierpercentages>
app/design/adminhtml/default/default/layout/tierpercentages.xml ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout>
3
+ <default>
4
+ <reference name="head">
5
+ <action method="addJs"><script>elgentos/tierpercentages.js</script></action>
6
+ </reference>
7
+ </default>
8
+ </layout>
app/design/adminhtml/default/default/template/tierpercentages/tier.phtml CHANGED
@@ -108,7 +108,6 @@ var tierPriceControl = {
108
  index: this.itemsCount++
109
  };
110
 
111
- data.percentage = '';
112
  if(arguments.length >= 4) {
113
  data.website_id = arguments[0];
114
  data.group = arguments[1];
108
  index: this.itemsCount++
109
  };
110
 
 
111
  if(arguments.length >= 4) {
112
  data.website_id = arguments[0];
113
  data.group = arguments[1];
js/elgentos/tierpercentages.js CHANGED
@@ -18,7 +18,7 @@ document.observe("dom:loaded", function() {
18
 
19
  $('price').observe('blur',function(event) {
20
  newPrice = $('price').value;
21
- if(normal_price!=newPrice && confirm("Do you want to update the tier prices?")) {
22
  $$('input.percentage').each(function (el) {
23
  id = el.id;
24
  price = $('price').value;
18
 
19
  $('price').observe('blur',function(event) {
20
  newPrice = $('price').value;
21
+ if(normal_price!='' && normal_price!=newPrice && confirm("Do you want to update the tier prices?")) {
22
  $$('input.percentage').each(function (el) {
23
  id = el.id;
24
  price = $('price').value;
package.xml CHANGED
@@ -1,18 +1,20 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Elgentos_Tierpercentages</name>
4
- <version>0.1.0</version>
5
  <stability>stable</stability>
6
  <license>GPL</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>This module allows you to fill out percentages in the Tier pricing part under Prices. It will automatically calculate the eventual price for you.</summary>
10
  <description>This module allows you to fill out percentages in the Tier pricing part under Prices. It will automatically calculate the eventual price for you.</description>
11
- <notes>First release</notes>
 
 
12
  <authors><author><name>Peter Jaap Blaakmeer</name><user>elgentos</user><email>peterjaap@elgentos.nl</email></author></authors>
13
- <date>2012-04-11</date>
14
- <time>14:12:05</time>
15
- <contents><target name="magelocal"><dir name="Elgentos"><dir name="Tierpercentages"><dir name="Block"><dir name="Adminhtml"><dir name="Catalog"><dir name="Product"><dir name="Edit"><dir name="Tab"><dir name="Price"><file name="Tier.php" hash="f93380fe4883013f84a610eee7a63538"/></dir></dir></dir></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="a7245b57ce0456eac30d2bb71338e684"/></dir><dir name="Model"><dir name="Mysql4"><file name="Setup.php" hash="79201aa741f6c1e1674de3e5abb00dbf"/></dir><dir name="Product"><dir name="Attribute"><dir name="Backend"><file name="Tierprice.php" hash="bd1595da177090282fca3cbe3cdfabcf"/></dir></dir></dir><dir name="Resource"><dir name="Eav"><dir name="Mysql4"><dir name="Product"><dir name="Attribute"><dir name="Backend"><file name="Tierprice.php" hash="00568c971b7c68447ca091f45dd6893e"/></dir></dir></dir></dir></dir></dir></dir><dir name="etc"><file name="config.xml" hash="c49e5fa08c6709295b82050d97fa1b9c"/></dir><dir name="sql"><dir name="tierpercentages_setup"><file name="mysql4-install-0.1.0.php" hash="3068e027808e2b3c3401b63b563bf947"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Elgentos_Tierpercentages.xml" hash="4804bbc80a133fc963630ecd5323a586"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="tierpercentages"><file name="tier.phtml" hash="831ac0aa1667ca76c404e04d7657f333"/></dir><dir name="layout"><file name="tierpercentages.xml" hash=""/></dir></dir></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="elgentos"><file name="tierpercentages.js" hash="a1216b62c86d77a902fa1c1a9e4dc35a"/></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>4.0.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Elgentos_Tierpercentages</name>
4
+ <version>0.1.2</version>
5
  <stability>stable</stability>
6
  <license>GPL</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>This module allows you to fill out percentages in the Tier pricing part under Prices. It will automatically calculate the eventual price for you.</summary>
10
  <description>This module allows you to fill out percentages in the Tier pricing part under Prices. It will automatically calculate the eventual price for you.</description>
11
+ <notes>- Added a forgotten layout XML file&#xD;
12
+ - Built in extra Javascript to check to prevent "Do you want to update the prices?" from being asked when filling out a new product.&#xD;
13
+ - Checked M CE 1.7.0.0 compatibility</notes>
14
  <authors><author><name>Peter Jaap Blaakmeer</name><user>elgentos</user><email>peterjaap@elgentos.nl</email></author></authors>
15
+ <date>2012-05-04</date>
16
+ <time>14:14:46</time>
17
+ <contents><target name="magelocal"><dir name="Elgentos"><dir name="Tierpercentages"><dir name="Block"><dir name="Adminhtml"><dir name="Catalog"><dir name="Product"><dir name="Edit"><dir name="Tab"><dir name="Price"><file name="Tier.php" hash="f93380fe4883013f84a610eee7a63538"/></dir></dir></dir></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="a7245b57ce0456eac30d2bb71338e684"/></dir><dir name="Model"><file name="Header.php" hash="2078074af094bab3e0e83fcb83432f7d"/><dir name="Mysql4"><file name="Setup.php" hash="79201aa741f6c1e1674de3e5abb00dbf"/></dir><dir name="Product"><dir name="Attribute"><dir name="Backend"><file name="Tierprice.php" hash="bd1595da177090282fca3cbe3cdfabcf"/></dir></dir></dir><dir name="Resource"><dir name="Eav"><dir name="Mysql4"><dir name="Product"><dir name="Attribute"><dir name="Backend"><file name="Tierprice.php" hash="00568c971b7c68447ca091f45dd6893e"/></dir></dir></dir></dir></dir></dir></dir><dir name="etc"><file name="config.xml" hash="7e242c39f450efc4f27cf55ef3c2af12"/></dir><dir name="sql"><dir name="tierpercentages_setup"><file name="mysql4-install-0.1.0.php" hash="3068e027808e2b3c3401b63b563bf947"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Elgentos_Tierpercentages.xml" hash="4804bbc80a133fc963630ecd5323a586"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="tierpercentages"><file name="tier.phtml" hash="7a2fed12922bfbaaffef1cf9d59663b2"/></dir></dir><dir name="layout"><file name="tierpercentages.xml" hash="7ff62649a8813c9ad5ba61ec9f14cde6"/></dir></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="elgentos"><file name="tierpercentages.js" hash="aec953095b258a64e68d3256c5addd11"/></dir></dir></target></contents>
18
  <compatible/>
19
  <dependencies><required><php><min>4.0.0</min><max>6.0.0</max></php></required></dependencies>
20
  </package>