QuBit_UniversalVariable - Version 1.0.2

Version Notes

showing the correct quantity values for basket and transaction line items; only use visible product in basket or a complete order to avoid duplicate; pricing correction

Download this release

Release Info

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


Code changes from version 1.0.1 to 1.0.2

app/code/local/QuBit/UniversalVariable/Model/Page/Observer.php CHANGED
@@ -86,7 +86,7 @@ class QuBit_UniversalVariable_Model_Page_Observer {
86
  $billingAddress = $order->getBillingAddress();
87
  $shippingAddress = $order->getShippingAddress();
88
 
89
- $transaction['order_id'] = $orderId;
90
  $transaction['currency'] = $this->_getCurrency();
91
  $transaction['subtotal'] = (float) $order->getSubtotal();
92
  // TODO: subtotal_include_tax
@@ -136,24 +136,29 @@ class QuBit_UniversalVariable_Model_Page_Observer {
136
  public function _getLineItems($items) {
137
  $line_items = array();
138
  foreach($items as $item) {
139
- $litem_model = array();
140
- $litem_model['product'] = $this->_getProductModel($item->getProduct());
141
- $litem_model['quantity'] = $item->getQty();
142
- $litem_model['subtotal'] = $item->getCalculationPrice() * $item -> getQty();
143
- array_push($line_items, $litem_model);
 
 
 
144
  }
145
  return $line_items;
146
  }
147
 
148
-
149
  public function _getInvoicedLineItems($items) {
150
  $line_items = array();
151
  foreach($items as $item) {
152
- $litem_model = array();
153
- $litem_model['product'] = $this->_getProductModel($item->getProduct());
154
- $litem_model['quantity'] = $item->getQtyToInvoice();
155
- $litem_model['subtotal'] = (float) $item->getPrice();
156
- array_push($line_items, $litem_model);
 
 
 
157
  }
158
  return $line_items;
159
  }
86
  $billingAddress = $order->getBillingAddress();
87
  $shippingAddress = $order->getShippingAddress();
88
 
89
+ $transaction['order_id'] = $order->getIncrementId();
90
  $transaction['currency'] = $this->_getCurrency();
91
  $transaction['subtotal'] = (float) $order->getSubtotal();
92
  // TODO: subtotal_include_tax
136
  public function _getLineItems($items) {
137
  $line_items = array();
138
  foreach($items as $item) {
139
+ $product = $item->getProduct();
140
+ if ($product->isVisibleInSiteVisibility()) {
141
+ $litem_model = array();
142
+ $litem_model['product'] = $this->_getProductModel($product);
143
+ $litem_model['quantity'] = $item->getQty();
144
+ $litem_model['subtotal'] = (float) $item->getRowTotalInclTax();
145
+ array_push($line_items, $litem_model);
146
+ }
147
  }
148
  return $line_items;
149
  }
150
 
 
151
  public function _getInvoicedLineItems($items) {
152
  $line_items = array();
153
  foreach($items as $item) {
154
+ $product = $item->getProduct();
155
+ if ($product->isVisibleInSiteVisibility()) {
156
+ $litem_model = array();
157
+ $litem_model['product'] = $this->_getProductModel($product);
158
+ $litem_model['quantity'] = (float) $item->getQtyOrdered();
159
+ $litem_model['subtotal'] = (float) $item->getRowTotalInclTax();
160
+ array_push($line_items, $litem_model);
161
+ }
162
  }
163
  return $line_items;
164
  }
app/code/local/QuBit/UniversalVariable/controllers/IndexController.php DELETED
@@ -1,15 +0,0 @@
1
- <?php
2
-
3
- class QuBit_UniversalVariable_IndexController
4
- extends Mage_Core_Controller_Front_Action {
5
-
6
- public function testAction () {
7
- echo "test index";
8
- }
9
-
10
- public function mamethodeAction () {
11
- echo "test mymethod";
12
- }
13
- }
14
-
15
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/QuBit/UniversalVariable/etc/api.xml ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!-- api.xml -->
2
+ <config>
3
+ <api>
4
+ <resources>
5
+ <universal_variable translate="title" module="tutorial">
6
+ <title>GrelaDesign tutorial DashBoard app API calls</title>
7
+ <model>universal_variable/main_api</model>
8
+ <acl>greladesign/tutorial</acl>
9
+ <methods>
10
+ <getUniversalVariable translate="title" module="tutorial">
11
+ <title>Get Universal Variable</title>
12
+ <method>getUniversalVariable</method><!-- here we specify the method name if we have a conflict with built in method or we want to change the name i.e. because it is lengthy -->
13
+ <acl>greladesign/tutorial/owneraccess</acl>
14
+ </getUniversalVariable>
15
+ </methods>
16
+ </universal_variable>
17
+ </resources>
18
+ </api>
19
+ </config>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>QuBit_UniversalVariable</name>
4
- <version>1.0.1</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,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.&#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>Converted price quotes from string to integer</notes>
16
  <authors><author><name>Jing Dong</name><user>qubitproducts</user><email>jing@qubitdigital.com</email></author></authors>
17
- <date>2012-08-06</date>
18
- <time>11:36:56</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="0af6989ffa9bd859fda429fba84a684e"/></dir><dir name="Model"><dir name="Page"><file name="Observer.php" hash="5427c36fea028ac674684a0a53fcfc6a"/></dir><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><dir name="controllers"><file name="IndexController.php" hash="5daac581cce2856275aab613046fa0ae"/></dir><dir name="etc"><file name="config.xml" hash="04a1473f38f3d7db75b6bbf833ab2af9"/><file name="system.xml" hash="944a9a1ca7984eae63f1e2e0800404f9"/></dir></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="db054d84a48d9dd833e99eca1d9fc8e0"/><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>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>QuBit_UniversalVariable</name>
4
+ <version>1.0.2</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>showing the correct quantity values for basket and transaction line items; only use visible product in basket or a complete order to avoid duplicate; pricing correction</notes>
16
  <authors><author><name>Jing Dong</name><user>qubitproducts</user><email>jing@qubitdigital.com</email></author></authors>
17
+ <date>2012-09-06</date>
18
+ <time>11:19:48</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="0af6989ffa9bd859fda429fba84a684e"/></dir><dir name="Model"><dir name="Page"><file name="Observer.php" hash="2c8b0711ac95f4fc68d7c6d46b1fb432"/></dir><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><dir name="etc"><file name="api.xml" hash="0f47187f8273a343b8e616265853635a"/><file name="config.xml" hash="04a1473f38f3d7db75b6bbf833ab2af9"/><file name="system.xml" hash="944a9a1ca7984eae63f1e2e0800404f9"/></dir></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="db054d84a48d9dd833e99eca1d9fc8e0"/><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>