Version Notes
Added total_discount for a line item in basket and transaction; it's useful to calculate average product cost if any complicated sales discount rule applied.
Download this release
Release Info
Developer | Jing Dong |
Extension | QuBit_UniversalVariable |
Version | 1.0.7 |
Comparing to | |
See all releases |
Code changes from version 1.0.6 to 1.0.7
app/code/local/QuBit/UniversalVariable/Model/Page/Observer.php
CHANGED
@@ -147,9 +147,10 @@ class QuBit_UniversalVariable_Model_Page_Observer {
|
|
147 |
|
148 |
if ($product && $product->isVisibleInSiteVisibility()) {
|
149 |
$litem_model = array();
|
150 |
-
$litem_model['product']
|
151 |
-
$litem_model['quantity']
|
152 |
-
$litem_model['subtotal']
|
|
|
153 |
array_push($line_items, $litem_model);
|
154 |
}
|
155 |
}
|
@@ -165,9 +166,10 @@ class QuBit_UniversalVariable_Model_Page_Observer {
|
|
165 |
|
166 |
if ($product && $product->isVisibleInSiteVisibility()) {
|
167 |
$litem_model = array();
|
168 |
-
$litem_model['product']
|
169 |
-
$litem_model['quantity']
|
170 |
-
$litem_model['subtotal']
|
|
|
171 |
array_push($line_items, $litem_model);
|
172 |
}
|
173 |
}
|
147 |
|
148 |
if ($product && $product->isVisibleInSiteVisibility()) {
|
149 |
$litem_model = array();
|
150 |
+
$litem_model['product'] = $this->_getProductModel($product);
|
151 |
+
$litem_model['quantity'] = $item->getQty();
|
152 |
+
$litem_model['subtotal'] = (float) $item->getRowTotalInclTax();
|
153 |
+
$litem_model['total_discount'] = (float) $item->getDiscountAmount();
|
154 |
array_push($line_items, $litem_model);
|
155 |
}
|
156 |
}
|
166 |
|
167 |
if ($product && $product->isVisibleInSiteVisibility()) {
|
168 |
$litem_model = array();
|
169 |
+
$litem_model['product'] = $this->_getProductModel($product);
|
170 |
+
$litem_model['quantity'] = (float) $item->getQtyOrdered();
|
171 |
+
$litem_model['subtotal'] = (float) $item->getRowTotalInclTax();
|
172 |
+
$litem_model['total_discount'] = (float) $item->getDiscountAmount();
|
173 |
array_push($line_items, $litem_model);
|
174 |
}
|
175 |
}
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>QuBit_UniversalVariable</name>
|
4 |
-
<version>1.0.
|
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,11 +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.
|
13 |

|
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>
|
16 |
<authors><author><name>Jing Dong</name><user>qubitproducts</user><email>jing@qubitdigital.com</email></author></authors>
|
17 |
-
<date>2013-01-
|
18 |
-
<time>15:
|
19 |
-
<contents><target name="magelocal"><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="
|
20 |
<compatible/>
|
21 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
22 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>QuBit_UniversalVariable</name>
|
4 |
+
<version>1.0.7</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.
|
13 |

|
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 total_discount for a line item in basket and transaction; it's useful to calculate average product cost if any complicated sales discount rule applied.</notes>
|
16 |
<authors><author><name>Jing Dong</name><user>qubitproducts</user><email>jing@qubitdigital.com</email></author></authors>
|
17 |
+
<date>2013-01-16</date>
|
18 |
+
<time>15:54:27</time>
|
19 |
+
<contents><target name="magelocal"><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="a7a8fe071729d81e87c24ac4a580d1f5"/></dir><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><dir name="etc"><file name="config.xml" hash="fd936ed3360902482e81d86b6747543c"/><file name="system.xml" hash="944a9a1ca7984eae63f1e2e0800404f9"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><dir name="qubit"><file name="universal_variable.xml" hash="f568ad884f941850720324d35868c45c"/><file name=".DS_Store" hash="2632898af4a7dd21eb81072ff8eb1f04"/></dir></dir><dir name="template"><dir name="qubit"><file name="universal_variable.phtml" hash="f0d43cc0642c05a7a647042e244fe7e8"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="QuBit_all.xml" hash="549545c1cf35f87658a129ad5093d13f"/></dir></target></contents>
|
20 |
<compatible/>
|
21 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
22 |
</package>
|