QuBit_UniversalVariable - Version 1.0.1

Version Notes

Converted price quotes from string to integer

Download this release

Release Info

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


Code changes from version 1.0.0 to 1.0.1

app/code/local/QuBit/UniversalVariable/Model/Page/Observer.php CHANGED
@@ -88,13 +88,13 @@ class QuBit_UniversalVariable_Model_Page_Observer {
88
 
89
  $transaction['order_id'] = $orderId;
90
  $transaction['currency'] = $this->_getCurrency();
91
- $transaction['subtotal'] = $order->getSubtotal();
92
  // TODO: subtotal_include_tax
93
- $transaction['total'] = $order->getGrandTotal();
94
  $transaction['voucher'] = $order->getCouponCode();
95
  // TODO: voucher_discount
96
- $transaction['tax'] = $order->getTax();
97
- $transaction['shipping_cost'] = $order->getShippingAmount();
98
  $transaction['shipping_method'] = $order->getShippingMethod();
99
  $transaction['billing'] = $this->_getAddress($billingAddress);
100
  $transaction['delivery'] = $this->_getAddress($shippingAddress);
@@ -125,8 +125,8 @@ class QuBit_UniversalVariable_Model_Page_Observer {
125
  $product_model['sku_code'] = $product->getSku();
126
  $product_model['url'] = $product->getProductUrl();
127
  $product_model['name'] = $product->getName();
128
- $product_model['unit_price'] = $product->getPrice();
129
- $product_model['unit_sale_price'] = $product->getFinalPrice();
130
  $product_model['currency'] = $this->_getCurrency();
131
  $product_model['description'] = $product->getDescription();
132
  $product_model['stock'] = $this->_getProuctStock($product);
@@ -152,7 +152,7 @@ class QuBit_UniversalVariable_Model_Page_Observer {
152
  $litem_model = array();
153
  $litem_model['product'] = $this->_getProductModel($item->getProduct());
154
  $litem_model['quantity'] = $item->getQtyToInvoice();
155
- $litem_model['subtotal'] = $item->getPrice();
156
  array_push($line_items, $litem_model);
157
  }
158
  return $line_items;
@@ -175,12 +175,12 @@ class QuBit_UniversalVariable_Model_Page_Observer {
175
 
176
  $basket['id'] = Mage::getSingleton('checkout/session')->getQuoteId();
177
  $basket['currency'] = $this->_getCurrency();
178
- $basket['subtotal'] = $subTotal;
179
  // TODO: subtotal_incluce_tax
180
  // TODO: tax
181
  // TODO: shipping_cost
182
  // TODO: shipping_method
183
- $basket['total'] = $grandTotal;
184
  $basket['line_items'] = $line_items;
185
  $this->_basket = $basket;
186
  }
@@ -223,7 +223,7 @@ class QuBit_UniversalVariable_Model_Page_Observer {
223
  }
224
 
225
  public function getListing() {
226
- return $_listing;
227
  }
228
  }
229
  ?>
88
 
89
  $transaction['order_id'] = $orderId;
90
  $transaction['currency'] = $this->_getCurrency();
91
+ $transaction['subtotal'] = (float) $order->getSubtotal();
92
  // TODO: subtotal_include_tax
93
+ $transaction['total'] = (float) $order->getGrandTotal();
94
  $transaction['voucher'] = $order->getCouponCode();
95
  // TODO: voucher_discount
96
+ $transaction['tax'] = (float) $order->getTax();
97
+ $transaction['shipping_cost'] = (float) $order->getShippingAmount();
98
  $transaction['shipping_method'] = $order->getShippingMethod();
99
  $transaction['billing'] = $this->_getAddress($billingAddress);
100
  $transaction['delivery'] = $this->_getAddress($shippingAddress);
125
  $product_model['sku_code'] = $product->getSku();
126
  $product_model['url'] = $product->getProductUrl();
127
  $product_model['name'] = $product->getName();
128
+ $product_model['unit_price'] = (float) $product->getPrice();
129
+ $product_model['unit_sale_price'] = (float) $product->getFinalPrice();
130
  $product_model['currency'] = $this->_getCurrency();
131
  $product_model['description'] = $product->getDescription();
132
  $product_model['stock'] = $this->_getProuctStock($product);
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;
175
 
176
  $basket['id'] = Mage::getSingleton('checkout/session')->getQuoteId();
177
  $basket['currency'] = $this->_getCurrency();
178
+ $basket['subtotal'] = (float) $subTotal;
179
  // TODO: subtotal_incluce_tax
180
  // TODO: tax
181
  // TODO: shipping_cost
182
  // TODO: shipping_method
183
+ $basket['total'] = (float) $grandTotal;
184
  $basket['line_items'] = $line_items;
185
  $this->_basket = $basket;
186
  }
223
  }
224
 
225
  public function getListing() {
226
+ return $this->_listing;
227
  }
228
  }
229
  ?>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>QuBit_UniversalVariable</name>
4
- <version>1.0.0</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>1.0.0 release allow system output universal variables and configure OpenTag script thought configuration panel. </notes>
16
  <authors><author><name>Jing Dong</name><user>qubitproducts</user><email>jing@qubitdigital.com</email></author></authors>
17
- <date>2012-08-02</date>
18
- <time>11:25:13</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="2b6d9ed912920a883c3637857940c4f7"/></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.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
  <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>