QuBit_UniversalVariable - Version 1.0.21

Version Notes

* Apply voucher discount on top of product unit_sale_price. GitHub issue #35

Download this release

Release Info

Developer Jing Dong
Extension QuBit_UniversalVariable
Version 1.0.21
Comparing to
See all releases


Code changes from version 1.0.20 to 1.0.21

app/code/community/QuBit/UniversalVariable/Model/Page/Observer.php CHANGED
@@ -347,6 +347,13 @@ class QuBit_UniversalVariable_Model_Page_Observer {
347
  $litem_model['quantity'] = (float) $item->getQtyOrdered();
348
  }
349
 
 
 
 
 
 
 
 
350
  array_push($line_items, $litem_model);
351
  }
352
  }
347
  $litem_model['quantity'] = (float) $item->getQtyOrdered();
348
  }
349
 
350
+ // Recalculate unit_sale_price after voucher applied Github: #35
351
+ // https://github.com/QubitProducts/UniversalVariable-Magento-Extension/issues/35
352
+ $unit_sale_price_after_discount = $litem_model['product']['unit_sale_price'];
353
+ $unit_sale_price_after_discount =
354
+ $unit_sale_price_after_discount - ($litem_model['total_discount'] / $litem_model['quantity']);
355
+ $litem_model['product']['unit_sale_price'] = $unit_sale_price_after_discount;
356
+
357
  array_push($line_items, $litem_model);
358
  }
359
  }
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>QuBit_UniversalVariable</name>
4
- <version>1.0.20</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/osl-3.0.php">Extension license name (OSL v3.0)</license>
7
  <channel>community</channel>
@@ -12,13 +12,11 @@
12
  <description>QuBit OpenTag recommends creating the releavant JavaScript object on your page prior to the OpenTag container script. This will assure the values are present on the page when a script tries to access them.&#xD;
13
  &#xD;
14
  If a page does not have the variables of an object that are mentioned below, simply do not even declare them. For example, if your pages only have category and no subcategory, just declare your category. Likewise, if you feel the need to extend the objects below or feel like renaming them, please do so. However, please take a note of the new variable names or the edited ones, because in order to access them from your scripts in your OpenTag container, you will need to use the new variable names.</description>
15
- <notes>* Added state variable in shipping and delivery address. (if state/region is not avaialbe, it will be exported as empty string to be used by tracking script)&#xD;
16
- &#xD;
17
- * Big refactoring and clean code, disable UV execution on admin page. (https://github.com/QubitProducts/UniversalVariable-Magento-Extension/pull/32)</notes>
18
  <authors><author><name>Jing Dong</name><user>qubitproducts</user><email>jing@qubitdigital.com</email></author></authors>
19
- <date>2014-01-13</date>
20
- <time>11:24:30</time>
21
- <contents><target name="magecommunity"><dir name="QuBit"><dir name="UniversalVariable"><dir name="Block"><file name="Uv.php" hash="9b5cd71bebc9576b5d0714b3fe5c13bb"/></dir><dir name="Helper"><file name="Data.php" hash="b05ea847c16520d5e6eec91e9f604886"/></dir><dir name="Model"><dir name="Page"><file name="Observer.php" hash="7adc18a6bd74117594c7001c17545c59"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="35f6ea94bc8984d18119a6fc5e63ec9f"/><file name="config.xml" hash="fa918eeac4d6e2b9692642b23789d7c8"/><file name="system.xml" hash="26e9e0d4d1559c8c5fbb69fe707e43a3"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="qubit"><file name="universal_variable.xml" hash="d492e66356dadf46ead546118d8b91ac"/></dir></dir><dir name="template"><dir name="qubit"><file name="universal_variable.phtml" hash="1775b4ca50c1df8e9542dd2c7bcd14f1"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="QuBit_all.xml" hash="a0b70506c32aeeb4198d59d86a019ec9"/></dir></target></contents>
22
  <compatible/>
23
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
24
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>QuBit_UniversalVariable</name>
4
+ <version>1.0.21</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/osl-3.0.php">Extension license name (OSL v3.0)</license>
7
  <channel>community</channel>
12
  <description>QuBit OpenTag recommends creating the releavant JavaScript object on your page prior to the OpenTag container script. This will assure the values are present on the page when a script tries to access them.&#xD;
13
  &#xD;
14
  If a page does not have the variables of an object that are mentioned below, simply do not even declare them. For example, if your pages only have category and no subcategory, just declare your category. Likewise, if you feel the need to extend the objects below or feel like renaming them, please do so. However, please take a note of the new variable names or the edited ones, because in order to access them from your scripts in your OpenTag container, you will need to use the new variable names.</description>
15
+ <notes>* Apply voucher discount on top of product unit_sale_price. GitHub issue #35</notes>
 
 
16
  <authors><author><name>Jing Dong</name><user>qubitproducts</user><email>jing@qubitdigital.com</email></author></authors>
17
+ <date>2014-04-07</date>
18
+ <time>16:23:59</time>
19
+ <contents><target name="magecommunity"><dir name="QuBit"><dir name="UniversalVariable"><dir name="Block"><file name="Uv.php" hash="9b5cd71bebc9576b5d0714b3fe5c13bb"/></dir><dir name="Helper"><file name="Data.php" hash="b05ea847c16520d5e6eec91e9f604886"/></dir><dir name="Model"><dir name="Page"><file name="Observer.php" hash="ba0227af39ad69cc95c25ee81a24bb5b"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="35f6ea94bc8984d18119a6fc5e63ec9f"/><file name="config.xml" hash="fa918eeac4d6e2b9692642b23789d7c8"/><file name="system.xml" hash="26e9e0d4d1559c8c5fbb69fe707e43a3"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="qubit"><file name="universal_variable.xml" hash="d492e66356dadf46ead546118d8b91ac"/></dir></dir><dir name="template"><dir name="qubit"><file name="universal_variable.phtml" hash="1775b4ca50c1df8e9542dd2c7bcd14f1"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="QuBit_all.xml" hash="a0b70506c32aeeb4198d59d86a019ec9"/></dir></target></contents>
20
  <compatible/>
21
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
22
  </package>