QuBit_UniversalVariable - Version 1.3.0

Version Notes

Refactored [Thanks firewizard]

Magento version is now under a flag [security by obscurity]

Options for hiding stock information, using real product IDs and the product id (database entry id)

Flag to either user real User ID or a hashed version of it

Product line_items

Makes sure there is a valid delivery address to stop confirmation page error.

user has_transacted

updated branding from QuBit to Qubit

Download this release

Release Info

Developer Callum Rogan
Extension QuBit_UniversalVariable
Version 1.3.0
Comparing to
See all releases


Code changes from version 1.0.23 to 1.3.0

app/code/community/QuBit/UniversalVariable/Block/Uv.php DELETED
@@ -1,6 +0,0 @@
1
- <?php
2
- class QuBit_UniversalVariable_Block_Uv extends Mage_Core_Block_Template {
3
-
4
- }
5
-
6
- ?>
 
 
 
 
 
 
app/code/community/QuBit/UniversalVariable/Helper/Data.php CHANGED
@@ -1,7 +1,207 @@
1
  <?php
2
 
3
- class QuBit_UniversalVariable_Helper_Data extends Mage_Core_Helper_Abstract {
4
-
5
- }
 
 
6
 
7
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <?php
2
 
3
+ class QuBit_UniversalVariable_Helper_Data extends Mage_Core_Helper_Abstract
4
+ {
5
+ const CONFIG_KEY_OPENTAG_ENABLED = 'qubituv/opentag/enabled';
6
+ const CONFIG_KEY_OPENTAG_CONTAINER_ID = 'qubituv/opentag/container_id';
7
+ const CONFIG_KEY_OPENTAG_USE_ASYNC = 'qubituv/opentag/async';
8
 
9
+ const CONFIG_KEY_UV_ENABLED = 'qubituv/settings/enabled';
10
+
11
+ const CONFIG_KEY_ADV_PROD_ID = 'qubituv/advanced/show_product_id';
12
+ const CONFIG_KEY_ADV_STOCK = 'qubituv/advanced/show_stock_info';
13
+ const CONFIG_KEY_ADV_USER_ID = 'qubituv/advanced/show_user_id';
14
+ const CONFIG_KEY_ADV_CAT_BLOCK_NAME = 'qubituv/advanced/category_product_list_block';
15
+ const CONFIG_KEY_ADV_SRCH_BLOCK_NAME = 'qubituv/advanced/search_product_list_block';
16
+ const CONFIG_KEY_ADV_MAGENTO_VERSION = 'qubituv/advanced/show_magento_version';
17
+
18
+ /**
19
+ * @return mixed
20
+ */
21
+ public function getContainerId()
22
+ {
23
+ return Mage::getStoreConfig(self::CONFIG_KEY_OPENTAG_CONTAINER_ID);
24
+ }
25
+
26
+ /**
27
+ * @return bool
28
+ */
29
+ public function opentagEnabled()
30
+ {
31
+ return Mage::getStoreConfigFlag(self::CONFIG_KEY_OPENTAG_ENABLED) && $this->getContainerId();
32
+ }
33
+
34
+ /**
35
+ * @return bool
36
+ */
37
+ public function uvEnabled()
38
+ {
39
+ return Mage::getStoreConfigFlag(self::CONFIG_KEY_UV_ENABLED);
40
+ }
41
+
42
+ /**
43
+ * @return bool
44
+ */
45
+ public function useAsync()
46
+ {
47
+ return Mage::getStoreConfigFlag(self::CONFIG_KEY_OPENTAG_USE_ASYNC);
48
+ }
49
+
50
+ /**
51
+ * @return bool
52
+ */
53
+ public function shouldUseRealProductId()
54
+ {
55
+ return Mage::getStoreConfigFlag(self::CONFIG_KEY_ADV_PROD_ID);
56
+ }
57
+
58
+ /**
59
+ * @return bool
60
+ */
61
+ public function shouldShowProductStockInfo()
62
+ {
63
+ return Mage::getStoreConfigFlag(self::CONFIG_KEY_ADV_STOCK);
64
+ }
65
+
66
+ /**
67
+ * @return bool
68
+ */
69
+ public function shouldUseRealUserId()
70
+ {
71
+ return Mage::getStoreConfigFlag(self::CONFIG_KEY_ADV_USER_ID);
72
+ }
73
+
74
+ /**
75
+ * @return mixed
76
+ */
77
+ public function getCategoryProductListBlockName()
78
+ {
79
+ return Mage::getStoreConfig(self::CONFIG_KEY_ADV_CAT_BLOCK_NAME);
80
+ }
81
+
82
+ /**
83
+ * @return mixed
84
+ */
85
+ public function getSearchProductListBlockName()
86
+ {
87
+ return Mage::getStoreConfig(self::CONFIG_KEY_ADV_SRCH_BLOCK_NAME);
88
+ }
89
+
90
+ /**
91
+ * @return bool
92
+ */
93
+ public function shouldShowMagentoVersion()
94
+ {
95
+ return Mage::getStoreConfig(self::CONFIG_KEY_ADV_MAGENTO_VERSION);
96
+ }
97
+
98
+ /**
99
+ * @return QuBit_UniversalVariable_Model_Uv
100
+ */
101
+ public function getUv()
102
+ {
103
+ return Mage::getSingleton('qubituv/uv');
104
+ }
105
+
106
+ /**
107
+ * @return string
108
+ */
109
+ public function getRequestPath()
110
+ {
111
+ $r = Mage::app()->getRequest();
112
+ $path = array($r->getRouteName(), $r->getControllerName(), $r->getActionName());
113
+ return implode('_', $path);
114
+ }
115
+
116
+ /**
117
+ * @return bool
118
+ */
119
+ public function isHomePage()
120
+ {
121
+ return 'cms_index_index' == $this->getRequestPath();
122
+ }
123
+
124
+ /**
125
+ * @return bool
126
+ */
127
+ public function isContentPage()
128
+ {
129
+ return 'cms_page_view' == $this->getRequestPath();
130
+ }
131
+
132
+ /**
133
+ * @return bool
134
+ */
135
+ public function isCategoryPage()
136
+ {
137
+ return 'catalog_category_view' == $this->getRequestPath();
138
+ }
139
+
140
+ /**
141
+ * @return bool
142
+ */
143
+ public function isSearchPage()
144
+ {
145
+ return 'catalogsearch_advanced_result' == $this->getRequestPath()
146
+ || 'catalogsearch_result_index' == $this->getRequestPath();
147
+ }
148
+
149
+ /**
150
+ * @return bool
151
+ */
152
+ public function isProductPage()
153
+ {
154
+ $p = Mage::registry('current_product');
155
+ return $p instanceof Mage_Catalog_Model_Product && $p->getId();
156
+ }
157
+
158
+ /**
159
+ * @return bool
160
+ */
161
+ public function isCartPage()
162
+ {
163
+ return 'checkout_cart_index' == $this->getRequestPath();
164
+ }
165
+
166
+ /**
167
+ * @return bool
168
+ */
169
+ public function isCheckoutPage()
170
+ {
171
+ $r = Mage::app()->getRequest();
172
+ return false !== strpos($r->getRouteName(), 'checkout') && 'success' != $r->getActionName();
173
+ }
174
+
175
+ public function isConfirmationPage()
176
+ {
177
+ /*
178
+ * default controllerName is "onepage"
179
+ * relax the check, only check if contains checkout
180
+ * somecheckout systems has different prefix/postfix,
181
+ * but all contains checkout
182
+ */
183
+ $r = Mage::app()->getRequest();
184
+ return false !== strpos($r->getRouteName(), 'checkout') && 'success' == $r->getActionName();
185
+ }
186
+
187
+ /**
188
+ * @param Mage_Customer_Model_Customer $customer
189
+ * @return bool
190
+ */
191
+ public function hasCustomerTransacted(Mage_Customer_Model_Customer $customer)
192
+ {
193
+ if (!$customer->getId()) {
194
+ return false;
195
+ }
196
+
197
+ /** @var Mage_Core_Model_Resource $r */
198
+ $r = Mage::getSingleton('core/resource');
199
+
200
+ $read = $r->getConnection('core_read');
201
+ $select = $read->select()
202
+ ->from($r->getTableName('sales/order'), array('c' => new Zend_Db_Expr('COUNT(*)')))
203
+ ->where('customer_id = ?', $customer->getId());
204
+
205
+ return $read->fetchOne($select) > 0;
206
+ }
207
+ }
app/code/community/QuBit/UniversalVariable/Model/Observer.php ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class QuBit_UniversalVariable_Model_Observer
4
+ {
5
+ /**
6
+ * Observes controller_action_layout_render_before
7
+ * @param Varien_Event_Observer $observer
8
+ */
9
+ public function processListingData(Varien_Event_Observer $observer)
10
+ {
11
+ /** @var QuBit_UniversalVariable_Helper_Data $helper */
12
+ $helper = Mage::helper('qubituv');
13
+
14
+ $layout = Mage::app()->getLayout();
15
+
16
+ /** @var Mage_Catalog_Block_Product_List $block */
17
+ $block = $layout->getBlock($helper->getCategoryProductListBlockName());
18
+ if (!$block instanceof Mage_Catalog_Block_Product_List) {
19
+ $block = $layout->getBlock($helper->getSearchProductListBlockName());
20
+ if (!$block instanceof Mage_Catalog_Block_Product_List) {
21
+ return;
22
+ }
23
+ }
24
+
25
+ $uv = $helper->getUv();
26
+ $listing = $uv->getListing();
27
+
28
+ /** @var Mage_Catalog_Model_Resource_Product_Collection $collection */
29
+ $collection = $block->getLoadedProductCollection();
30
+
31
+ $listing['result_count'] = $collection->getSize();
32
+ $listing['items'] = array();
33
+ foreach($collection as $product) {
34
+ $listing['items'][] = $uv->getProductData($product);
35
+ }
36
+
37
+ $toolbar = $block->getToolbarBlock();
38
+ $listing['sort_by'] = $toolbar->getCurrentOrder() . '_' . $toolbar->getCurrentDirection();
39
+ $listing['layout'] = $toolbar->getCurrentMode();
40
+
41
+ $uv->setListing($listing);
42
+ }
43
+ }
app/code/community/QuBit/UniversalVariable/Model/Page/Observer.php DELETED
@@ -1,501 +0,0 @@
1
- <?php
2
-
3
- class QuBit_UniversalVariable_Model_Page_Observer {
4
-
5
- // This is the UV specification Version
6
- // http://tools.qubitproducts.com/uv/developers/specification
7
- protected $_version = "1.2";
8
- protected $_user = null;
9
- protected $_page = null;
10
- protected $_basket = null;
11
- protected $_product = null;
12
- protected $_search = null;
13
- protected $_transaction = null;
14
- protected $_listing = null;
15
- protected $_events = array();
16
-
17
- protected function _getRequest() {
18
- return Mage::app()->getFrontController()->getRequest();
19
- }
20
-
21
- /*
22
- * Returns Controller Name
23
- */
24
- protected function _getControllerName() {
25
- return $this->_getRequest()->getControllerName();
26
- }
27
-
28
- protected function _getActionName() {
29
- return $this->_getRequest()->getActionName();
30
- }
31
-
32
- protected function _getModuleName() {
33
- return $this->_getRequest()->getModuleName();
34
- }
35
-
36
- protected function _getRouteName() {
37
- return $this->_getRequest()->getRouteName();
38
- }
39
-
40
- protected function _getCustomer() {
41
- return Mage::helper('customer')->getCustomer();
42
- }
43
-
44
- protected function _getBreadcrumb() {
45
- return Mage::helper('catalog')->getBreadcrumbPath();
46
- }
47
-
48
- protected function _getCategory($category_id) {
49
- return Mage::getModel('catalog/category')->load($category_id);
50
- }
51
-
52
- protected function _getCurrentProduct() {
53
- return Mage::registry('current_product');
54
- }
55
-
56
- protected function _getProduct($productId) {
57
- return Mage::getModel('catalog/product')->load($productId);
58
- }
59
-
60
- protected function _getCurrentCategory() {
61
- return Mage::registry('current_category');
62
- }
63
-
64
- protected function _getCatalogSearch() {
65
- return Mage::getSingleton('catalogsearch/advanced');
66
- }
67
-
68
- protected function _getCheckoutSession() {
69
- return Mage::getSingleton('checkout/session');
70
- }
71
-
72
- protected function _getSalesOrder() {
73
- return Mage::getModel('sales/order');
74
- }
75
-
76
- protected function _getOrderAddress() {
77
- return Mage::getModel('sales/order_address');
78
- }
79
-
80
- /*
81
- * Determine which page type we're on
82
- */
83
-
84
- public function _isHome() {
85
- if (Mage::app()->getRequest()->getRequestString() == "/") {
86
- return true;
87
- } else {
88
- return false;
89
- }
90
- }
91
-
92
- public function _isContent() {
93
- if ($this->_getModuleName() == 'cms') {
94
- return true;
95
- } else {
96
- return false;
97
- }
98
- }
99
-
100
- public function _isCategory() {
101
- if ($this->_getControllerName() == 'category') {
102
- return true;
103
- } else {
104
- return false;
105
- }
106
- }
107
-
108
- public function _isSearch() {
109
- if ($this->_getModuleName() == 'catalogsearch') {
110
- return true;
111
- } else {
112
- return false;
113
- }
114
- }
115
-
116
- public function _isProduct() {
117
- $onCatalog = false;
118
- if(Mage::registry('current_product')) {
119
- $onCatalog = true;
120
- }
121
- return $onCatalog;
122
- }
123
-
124
- public function _isBasket() {
125
- $request = $this->_getRequest();
126
- $module = $request->getModuleName();
127
- $controller = $request->getControllerName();
128
- $action = $request->getActionName();
129
- if ($module == 'checkout' && $controller == 'cart' && $action == 'index'){
130
- return true;
131
- } else {
132
- return false;
133
- }
134
- }
135
-
136
- public function _isCheckout() {
137
- if (strpos($this->_getModuleName(), 'checkout') !== false && $this->_getActionName() != 'success') {
138
- return true;
139
- } else {
140
- return false;
141
- }
142
- }
143
-
144
- public function _isConfirmation() {
145
- // default controllerName is "onepage"
146
- // relax the check, only check if contains checkout
147
- // somecheckout systems has different prefix/postfix,
148
- // but all contains checkout
149
- if (strpos($this->_getModuleName(), 'checkout') !== false && $this->_getActionName() == "success") {
150
- return true;
151
- } else {
152
- return false;
153
- }
154
- }
155
-
156
-
157
- /*
158
- * Get information on pages to pass to front end
159
- */
160
-
161
- public function getVersion() {
162
- return $this->_version;
163
- }
164
-
165
- public function getUser() {
166
- return $this->_user;
167
- }
168
-
169
- public function getPage() {
170
- return $this->_page;
171
- }
172
-
173
- public function getProduct() {
174
- return $this->_product;
175
- }
176
-
177
- public function getBasket() {
178
- return $this->_basket;
179
- }
180
-
181
- public function getTransaction() {
182
- return $this->_transaction;
183
- }
184
-
185
- public function getListing() {
186
- return $this->_listing;
187
- }
188
-
189
- public function getMageVersion() {
190
- return Mage::getVersion();
191
- }
192
-
193
- public function getEvents() {
194
- return array();
195
- }
196
-
197
-
198
- /*
199
- * Set the model attributes to be passed front end
200
- */
201
-
202
- public function _getPageType() {
203
- if ($this->_isHome()) {
204
- return 'home';
205
- } elseif ($this->_isContent()) {
206
- return 'content';
207
- } elseif ($this->_isCategory()) {
208
- return 'category';
209
- } elseif ($this->_isSearch()) {
210
- return 'search';
211
- } elseif ($this->_isProduct()) {
212
- return 'product';
213
- } elseif ($this->_isBasket()) {
214
- return 'basket';
215
- } elseif ($this->_isCheckout()) {
216
- return 'checkout';
217
- } elseif ($this->_isConfirmation()) {
218
- return 'confirmation';
219
- } else {
220
- return $this->_getModuleName();
221
- }
222
- }
223
-
224
- public function _getPageBreadcrumb() {
225
- $arr = $this->_getBreadcrumb();
226
- $breadcrumb = array();
227
- foreach ($arr as $category) {
228
- $breadcrumb[] = $category['label'];
229
- }
230
- return $breadcrumb;
231
- }
232
-
233
- public function _setPage() {
234
- $this->_page = array();
235
- $this->_page['type'] = $this->_getPageType();
236
- // WARNING: `page.category` will be deprecated in the next release
237
- // We will follow the specification that uses `page.type`
238
- // Please migrate any frontend JavaScripts using this `universal_variable.page.category` variable
239
- $this->_page['category'] = $this->_page['type'];
240
- $this->_page['breadcrumb'] = $this->_getPageBreadcrumb();
241
- }
242
-
243
- // Set the user info
244
- public function _setUser() {
245
- $this->_user = array();
246
- $user = $this->_getCustomer();
247
- $user_id = $user->getEntityId();
248
-
249
- if ($this->_isConfirmation()) {
250
- $orderId = $this->_getCheckoutSession()->getLastOrderId();
251
- if ($orderId) {
252
- $order = $this->_getSalesOrder()->load($orderId);
253
- $email = $order->getCustomerEmail();
254
- }
255
- } else {
256
- $email = $user->getEmail();
257
- }
258
-
259
- if ($email) {
260
- $this->_user['email'] = $email;
261
- }
262
-
263
- if ($user_id) {
264
- $this->_user['user_id'] = (string) $user_id;
265
- }
266
- $this->_user['returning'] = $user_id ? true : false;
267
- $this->_user['language'] = Mage::getStoreConfig('general/locale/code', Mage::app()->getStore()->getId());;
268
-
269
- }
270
-
271
- public function _getAddress($address) {
272
- $billing = array();
273
- if ($address) {
274
- $billing['name'] = $address->getName();
275
- $billing['address'] = $address->getStreetFull();
276
- $billing['city'] = $address->getCity();
277
- $billing['postcode'] = $address->getPostcode();
278
- $billing['country'] = $address->getCountry();
279
- $state = $address->getRegion();
280
- $billing['state'] = $state ? $state : '';
281
- }
282
- return $billing;
283
- }
284
-
285
- public function _getProductStock($product) {
286
- return (int) Mage::getModel('cataloginventory/stock_item')->loadByProduct($product)->getQty();
287
- }
288
-
289
- public function _getCurrency() {
290
- return Mage::app()->getStore()->getCurrentCurrencyCode();
291
- }
292
-
293
- public function _getProductModel($product) {
294
- $product_model = array();
295
- $product_model['id'] = $product->getId();
296
- $product_model['sku_code'] = $product->getSku();
297
- $product_model['url'] = $product->getProductUrl();
298
- $product_model['name'] = $product->getName();
299
- $product_model['unit_price'] = (float) $product->getPrice();
300
- $product_model['unit_sale_price'] = (float) $product->getFinalPrice();
301
- $product_model['currency'] = $this->_getCurrency();
302
- $product_model['description'] = strip_tags($product->getShortDescription());
303
- $product_model['stock'] = (int) $this->_getProductStock($product);
304
-
305
- $categories = $this->_getProductCategories($product);
306
- if (isset($categories[0])) {
307
- $product_model['category'] = $categories[0];
308
- }
309
- if (isset($categories[1])) {
310
- $product_model['subcategory'] = $categories[1];
311
- }
312
-
313
- return $product_model;
314
- }
315
-
316
- public function _getProductCategories($product) {
317
- $cats = $product->getCategoryIds();
318
- if ($cats) {
319
- $category_names = array();
320
- foreach ($cats as $category_id) {
321
- $_cat = $this->_getCategory($category_id);
322
- $category_names[] = $_cat->getName();
323
- }
324
- return $category_names;
325
- } else {
326
- return false;
327
- }
328
- }
329
-
330
- public function _getLineItems($items, $page_type) {
331
- $line_items = array();
332
- foreach($items as $item) {
333
- $productId = $item->getProductId();
334
- $product = $this->_getProduct($productId);
335
- // product needs to be visible
336
- if ($product->isVisibleInSiteVisibility()) {
337
- $litem_model = array();
338
- $litem_model['product'] = $this->_getProductModel($product);
339
-
340
-
341
- $litem_model['subtotal'] = (float) $item->getRowTotalInclTax();
342
- $litem_model['total_discount'] = (float) $item->getDiscountAmount();
343
-
344
- if ($page_type == 'basket') {
345
- $litem_model['quantity'] = (float) $item->getQty();
346
- } else {
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
- }
360
- return $line_items;
361
- }
362
-
363
- public function _setListing() {
364
- $this->_listing = array();
365
- if ($this->_isCategory()) {
366
- $category = $this->_getCurrentCategory();
367
- } elseif ($this->_isSearch()) {
368
- $category = $this->_getCatalogSearch();
369
- if (isset($_GET['q'])) {
370
- $this->_listing['query'] = $_GET['q'];
371
- }
372
- }
373
- }
374
-
375
- public function _setProduct() {
376
- $product = $this->_getCurrentProduct();
377
- if (!$product) return false;
378
- $this->_product = $this->_getProductModel($product);
379
- }
380
-
381
- public function _setBasket() {
382
- $cart = $this->_getCheckoutSession();
383
-
384
- if (!isset($cart)) {
385
- return;
386
- }
387
-
388
- $basket = array();
389
- $quote = $cart->getQuote();
390
-
391
- // Set normal params
392
- $basket_id = $this->_getCheckoutSession()->getQuoteId();
393
- if ($basket_id) {
394
- $basket['id'] = (string) $basket_id;
395
- }
396
- $basket['currency'] = $this->_getCurrency();
397
- $basket['subtotal'] = (float) $quote->getSubtotal();
398
- $basket['tax'] = (float) $quote->getShippingAddress()->getTaxAmount();
399
- $basket['subtotal_include_tax'] = (boolean) $this->_doesSubtotalIncludeTax($quote, $basket['tax']);
400
- $basket['shipping_cost'] = (float) $quote->getShippingAmount();
401
- $basket['shipping_method'] = $this->_extractShippingMethod($quote);
402
- $basket['total'] = (float) $quote->getGrandTotal();
403
-
404
- // Line items
405
- $items = $quote->getAllItems();
406
- $basket['line_items'] = $this->_getLineItems($items, 'basket');
407
-
408
- $this->_basket = $basket;
409
- }
410
-
411
- public function _doesSubtotalIncludeTax($order, $tax) {
412
- /* Conditions:
413
- - if tax is zero, then set to false
414
- - Assume that if grand total is bigger than total after subtracting shipping, then subtotal does NOT include tax
415
- */
416
- $grandTotalWithoutShipping = $order->getGrandTotal() - $order->getShippingAmount();
417
- if ($tax == 0 || $grandTotalWithoutShipping > $order->getSubtotal()) {
418
- return false;
419
- } else {
420
- return true;
421
- }
422
- }
423
-
424
- public function _extractShippingMethod($order) {
425
- $shipping_method = $order->getShippingMethod();
426
- return $shipping_method ? $shipping_method : '';
427
- }
428
-
429
- public function _setTranscation() {
430
- $orderId = $this->_getCheckoutSession()->getLastOrderId();
431
- if ($orderId) {
432
- $transaction = array();
433
- $order = $this->_getSalesOrder()->load($orderId);
434
-
435
- // Get general details
436
- $transaction['order_id'] = $order->getIncrementId();
437
- $transaction['currency'] = $this->_getCurrency();
438
- $transaction['subtotal'] = (float) $order->getSubtotal();
439
- $transaction['tax'] = (float) $order->getTaxAmount();
440
- $transaction['subtotal_include_tax'] = $this->_doesSubtotalIncludeTax($order, $transaction['tax']);
441
- $transaction['payment_type'] = $order->getPayment()->getMethodInstance()->getTitle();
442
- $transaction['total'] = (float) $order->getGrandTotal();
443
-
444
- $voucher = $order->getCouponCode();
445
- $transaction['voucher'] = $voucher ? $voucher : "";
446
- $voucher_discount = -1 * $order->getDiscountAmount();
447
- $transaction['voucher_discount'] = $voucher_discount ? $voucher_discount : 0;
448
-
449
-
450
- $transaction['shipping_cost'] = (float) $order->getShippingAmount();
451
- $transaction['shipping_method'] = $this->_extractShippingMethod($order);
452
-
453
- // Get addresses
454
- if (method_exists($order,'getShippingAddress')) {
455
- $shippingId = $order->getShippingAddress()->getId();
456
- $shippingAddress = $order->getShippingAddress();
457
- $transaction['delivery'] = $this->_getAddress($shippingAddress);
458
- $address = $this->_getOrderAddress()->load($shippingId);
459
- }
460
-
461
- $billingAddress = $order->getBillingAddress();
462
- $transaction['billing'] = $this->_getAddress($billingAddress);
463
-
464
- // Get items
465
- $items = $order->getAllItems();
466
- $line_items = $this->_getLineItems($items, 'transaction');
467
- $transaction['line_items'] = $line_items;
468
-
469
- $this->_transaction = $transaction;
470
- }
471
- }
472
-
473
- public function setUniversalVariable($observer) {
474
- $this->_setUser();
475
- $this->_setPage();
476
-
477
- if ($this->_isProduct()) {
478
- $this->_setProduct();
479
- }
480
-
481
- if ($this->_isCategory()) {
482
- $this->_setListing();
483
- }
484
-
485
- if ($this->_isCategory() || $this->_isSearch()) {
486
- $this->_setListing();
487
- }
488
-
489
- if (!$this->_isConfirmation()) {
490
- $this->_setBasket();
491
- }
492
-
493
- if ($this->_isConfirmation()) {
494
- $this->_setTranscation();
495
- }
496
-
497
- return $this;
498
- }
499
-
500
- }
501
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/QuBit/UniversalVariable/Model/Uv.php ADDED
@@ -0,0 +1,376 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Class QuBit_UniversalVariable_Model_Uv
5
+ *
6
+ * @method QuBit_UniversalVariable_Model_Uv setVersion() setVersion(mixed $version)
7
+ * @method QuBit_UniversalVariable_Model_Uv setEvents() setEvents(array $events)
8
+ * @method QuBit_UniversalVariable_Model_Uv setProduct() setProduct($data)
9
+ * @method QuBit_UniversalVariable_Model_Uv setPage() setPage($data)
10
+ * @method QuBit_UniversalVariable_Model_Uv setUser() setUser($data)
11
+ * @method QuBit_UniversalVariable_Model_Uv setListing() setListing($data)
12
+ * @method QuBit_UniversalVariable_Model_Uv setBasket() setBasket($data)
13
+ * @method QuBit_UniversalVariable_Model_Uv setTransaction() setTransaction($data)
14
+ * @method QuBit_UniversalVariable_Model_Uv setMagentoVersion() setMagentoVersion(mixed $version)
15
+ */
16
+
17
+ class QuBit_UniversalVariable_Model_Uv extends Varien_Object
18
+ {
19
+
20
+ /**
21
+ * This is the UV specification Version
22
+ * @var string
23
+ * @url http://tools.qubitproducts.com/uv/developers/specification
24
+ */
25
+ protected $_version = "1.3.0";
26
+
27
+ protected function _construct()
28
+ {
29
+ $this
30
+ ->setVersion($this->_version)
31
+ ->setEvents(array())
32
+ ->_initUser()
33
+ ->_initPage();
34
+
35
+ if ($this->helper()->isProductPage()) {
36
+ $this->_initProduct();
37
+ }
38
+
39
+ if ($this->helper()->shouldShowMagentoVersion()) {
40
+ $this->setMagentoVersion(Mage::getVersion());
41
+ }
42
+
43
+ if ($this->helper()->isCategoryPage() || $this->helper()->isSearchPage()) {
44
+ $this->_initListing();
45
+ }
46
+
47
+ //if ($this->helper()->isCartPage()) {
48
+ $this->_initCart();
49
+ //}
50
+
51
+ if ($this->helper()->isConfirmationPage()) {
52
+ $this->_initTransaction();
53
+ }
54
+ }
55
+
56
+ /**
57
+ * @return string json encoded UV data
58
+ */
59
+ public function getUvData()
60
+ {
61
+ $data = $this->toArray(array('version', 'magento_version', 'page', 'user', 'product', 'basket', 'listing', 'transaction', 'events'));
62
+ $data = array_filter($data);
63
+
64
+ $transport = new Varien_Object($data);
65
+ Mage::dispatchEvent('qubituv_before_to_json', array('uv' => $transport));
66
+
67
+ return Zend_Json::encode($transport->getData());
68
+ }
69
+
70
+ /**
71
+ * @return QuBit_UniversalVariable_Helper_Data
72
+ */
73
+ protected function helper() {
74
+ return Mage::helper('qubituv');
75
+ }
76
+
77
+ protected function _initPage()
78
+ {
79
+ $breadcrumb = array();
80
+ foreach (Mage::helper('catalog')->getBreadcrumbPath() as $category) {
81
+ $breadcrumb[] = $category['label'];
82
+ }
83
+
84
+ if ($this->helper()->isHomePage()) {
85
+ $type = 'home';
86
+ } elseif ($this->helper()->isContentPage()) {
87
+ $type = 'content';
88
+ } elseif ($this->helper()->isCategoryPage()) {
89
+ $type = 'category';
90
+ } elseif ($this->helper()->isSearchPage()) {
91
+ $type = 'search';
92
+ } elseif ($this->helper()->isProductPage()) {
93
+ $type = 'product';
94
+ } elseif ($this->helper()->isCartPage()) {
95
+ $type = 'basket';
96
+ } elseif ($this->helper()->isCheckoutPage()) {
97
+ $type = 'checkout';
98
+ } elseif ($this->helper()->isConfirmationPage()) {
99
+ $type = 'confirmation';
100
+ } else {
101
+ $type = trim(Mage::app()->getRequest()->getRequestUri(), '/');
102
+ }
103
+
104
+ $this->setPage(array(
105
+ 'type' => $type,
106
+ 'breadcrumb' => $breadcrumb,
107
+ ));
108
+
109
+ return $this;
110
+ }
111
+
112
+ protected function _initUser()
113
+ {
114
+ /** @var Mage_Customer_Model_Customer $user */
115
+ $user = Mage::helper('customer')->getCustomer();
116
+
117
+ if ($this->helper()->isConfirmationPage()) {
118
+ if ($orderId = Mage::getSingleton('checkout/session')->getLastOrderId()) {
119
+ $order = Mage::getModel('sales/order')->load($orderId);
120
+ $email = $order->getCustomerEmail();
121
+ $name = trim($order->getCustomerFirstname() . ' ' . $order->getCustomerLastname());
122
+ }
123
+ } else {
124
+ $email = $user->getEmail();
125
+ $name = trim($user->getFirstname() . ' ' . $user->getLastname());
126
+ }
127
+
128
+ $data = array();
129
+ if (!empty($email)) {
130
+ $data['email'] = $email;
131
+ }
132
+
133
+ if (!empty($name)) {
134
+ $data['name'] = $name;
135
+ }
136
+
137
+ $data['has_transacted'] = false;
138
+ if ($user->getId()) {
139
+ $data['user_id'] = $this->helper()->shouldUseRealUserId() ?
140
+ (string)$user->getId() :
141
+ md5($user->getId() . $user->getEmail());
142
+
143
+ $data['has_transacted'] = $this->helper()->hasCustomerTransacted($user);
144
+ }
145
+
146
+ $data['customer_group'] = Mage::getSingleton('customer/session')->getCustomerGroupId();
147
+
148
+ $data['returning'] = $user->getId() ? true : false;
149
+ $data['language'] = Mage::getStoreConfig('general/locale/code');
150
+
151
+ $this->setUser($data);
152
+ return $this;
153
+ }
154
+
155
+ /**
156
+ * @param Mage_Customer_Model_Address_Abstract $address
157
+ * @return array
158
+ */
159
+ protected function _getAddressData(Mage_Customer_Model_Address_Abstract $address)
160
+ {
161
+ $data = array();
162
+ if ($address) {
163
+ $data['name'] = $address->getName();
164
+ $data['address'] = $address->getStreetFull();
165
+ $data['city'] = $address->getCity();
166
+ $data['postcode'] = $address->getPostcode();
167
+ $data['country'] = $address->getCountry();
168
+ $data['state'] = $address->getRegion() ? $address->getRegion() : '';
169
+ }
170
+
171
+ return $data;
172
+ }
173
+
174
+ /**
175
+ * @return string
176
+ */
177
+ protected function _getCurrency()
178
+ {
179
+ return Mage::app()->getStore()->getCurrentCurrencyCode();
180
+ }
181
+
182
+ /**
183
+ * @param Mage_Catalog_Model_Product $product
184
+ * @return array
185
+ */
186
+ public function getProductData(Mage_Catalog_Model_Product $product)
187
+ {
188
+ $id = $product->getId();
189
+ if (!$this->helper()->shouldUseRealProductId()) {
190
+ $id = $product->getSku() ? $product->getSku() : md5($id);
191
+ }
192
+ $data = array(
193
+ 'id' => $id,
194
+ 'url' => $product->getProductUrl(),
195
+ 'name' => $product->getName(),
196
+ 'unit_price' => (float)$product->getPrice(),
197
+ 'unit_sale_price' => (float)$product->getFinalPrice(),
198
+ 'currency' => $this->_getCurrency(),
199
+ 'description' => strip_tags($product->getShortDescription()),
200
+ 'sku_code' => $product->getSku()
201
+ );
202
+
203
+ if ($this->helper()->shouldShowProductStockInfo()) {
204
+ $data['stock'] = (int)Mage::getModel('cataloginventory/stock_item')->loadByProduct($product)->getQty();
205
+ }
206
+
207
+ $catIndex = $catNames = array();
208
+ $limit = 2; $k = 0;
209
+ foreach ($product->getCategoryIds() as $catId) {
210
+ if (++$k > $limit) {
211
+ break;
212
+ }
213
+ if (!isset($catIndex[$catId])) {
214
+ $catIndex[$catId] = Mage::getModel('catalog/category')->load($catId);
215
+ }
216
+ $catNames[] = $catIndex[$catId]->getName();
217
+ }
218
+
219
+ if (isset($catNames[0])) {
220
+ $data['category'] = $catNames[0];
221
+ }
222
+ if (isset($catNames[1])) {
223
+ $data['subcategory'] = $catNames[1];
224
+ }
225
+
226
+ return $data;
227
+ }
228
+
229
+ protected function _getLineItems($items, $pageType)
230
+ {
231
+ $data = array();
232
+ foreach ($items as $item) {
233
+ /** @var Mage_Catalog_Model_Product $product */
234
+ $product = Mage::getModel('catalog/product')->load($item->getProductId());
235
+ // product needs to be visible
236
+ if (!$product->isVisibleInSiteVisibility()) {
237
+ continue;
238
+ }
239
+
240
+ $line = array();
241
+ $line['product'] = $this->getProductData($product);
242
+ $line['subtotal'] = (float)$item->getRowTotalInclTax();
243
+ $line['total_discount'] = (float)$item->getDiscountAmount();
244
+
245
+ $line['quantity'] = $pageType == 'basket' ? (float)$item->getQty() : (float)$item->getQtyOrdered();
246
+
247
+ // Recalculate unit_sale_price after voucher applied Github: #35
248
+ // https://github.com/QubitProducts/UniversalVariable-Magento-Extension/issues/35
249
+ $line['product']['unit_sale_price'] -= $line['total_discount'] / $line['quantity'];
250
+
251
+ $data[] = $line;
252
+ }
253
+
254
+ return $data;
255
+ }
256
+
257
+ /**
258
+ * None of the listing variables can be properly set here
259
+ * since the product collection is being loaded
260
+ * in the Mage_Catalog_Block_Product_List::_beforeToHtml method
261
+ *
262
+ * @see QuBit_UniversalVariable_Model_Observer::processListingData
263
+ */
264
+ protected function _initListing()
265
+ {
266
+ $data = array();
267
+ if ($this->helper()->isSearchPage()) {
268
+ $data['query'] = Mage::helper('catalogsearch')->getQueryText();
269
+ }
270
+
271
+ $this->setListing($data);
272
+ return $this;
273
+ }
274
+
275
+ protected function _initProduct()
276
+ {
277
+ $product = Mage::registry('current_product');
278
+ if (!$product instanceof Mage_Catalog_Model_Product || !$product->getId()) {
279
+ return false;
280
+ }
281
+
282
+ $this->setProduct($this->getProductData($product));
283
+ return $this;
284
+ }
285
+
286
+ protected function _initCart()
287
+ {
288
+ /** @var Mage_Sales_Model_Quote $quote */
289
+ $quote = Mage::getSingleton('checkout/session')->getQuote();
290
+
291
+ if ($quote->getItemsCount() > 0) {
292
+
293
+ $data = array();
294
+ if ($quote->getId()) {
295
+ $data['id'] = (string)$quote->getId();
296
+ }
297
+
298
+ $data['currency'] = $this->_getCurrency();
299
+ $data['subtotal'] = (float)$quote->getSubtotal();
300
+ $data['tax'] = (float)$quote->getShippingAddress()->getTaxAmount();
301
+ $data['subtotal_include_tax'] = (boolean)$this->_doesSubtotalIncludeTax($quote, $data['tax']);
302
+ $data['shipping_cost'] = (float)$quote->getShippingAmount();
303
+ $data['shipping_method'] = $quote->getShippingMethod() ? $quote->getShippingMethod() : '';
304
+ $data['total'] = (float)$quote->getGrandTotal();
305
+
306
+ // Line items
307
+ $data['line_items'] = $this->_getLineItems($quote->getAllVisibleItems(), 'basket');
308
+
309
+ $this->setBasket($data);
310
+ return $this;
311
+ }
312
+ }
313
+
314
+ /**
315
+ * @param $order
316
+ * @param $tax
317
+ * @return bool
318
+ * @todo implement this Magento-style
319
+ */
320
+ protected function _doesSubtotalIncludeTax($order, $tax)
321
+ {
322
+ /* Conditions:
323
+ - if tax is zero, then set to false
324
+ - Assume that if grand total is bigger than total after subtracting shipping, then subtotal does NOT include tax
325
+ */
326
+ $grandTotalWithoutShipping = $order->getGrandTotal() - $order->getShippingAmount();
327
+ return !($tax == 0 || $grandTotalWithoutShipping > $order->getSubtotal());
328
+ }
329
+
330
+ protected function _initTransaction()
331
+ {
332
+ $orderId = Mage::getSingleton('checkout/session')->getLastOrderId();
333
+ if (!$orderId) {
334
+ return $this;
335
+ }
336
+
337
+ /** @var Mage_Sales_Model_Order $order */
338
+ $order = Mage::getModel('sales/order')->load($orderId);
339
+
340
+ $transaction = array();
341
+
342
+ $transaction['order_id'] = $order->getIncrementId();
343
+ $transaction['currency'] = $this->_getCurrency();
344
+ $transaction['subtotal'] = (float)$order->getSubtotal();
345
+ $transaction['tax'] = (float)$order->getTaxAmount();
346
+ $transaction['subtotal_include_tax'] = $this->_doesSubtotalIncludeTax($order, $transaction['tax']);
347
+ $transaction['payment_type'] = $order->getPayment()->getMethodInstance()->getTitle();
348
+ $transaction['total'] = (float)$order->getGrandTotal();
349
+
350
+ if ($order->getCouponCode()) {
351
+ $transaction['voucher'] = array($order->getCouponCode());
352
+ }
353
+
354
+ if ($order->getDiscountAmount() > 0) {
355
+ $transaction['voucher_discount'] = -1 * $order->getDiscountAmount();
356
+ }
357
+
358
+ $transaction['shipping_cost'] = (float)$order->getShippingAmount();
359
+ $transaction['shipping_method'] = $order->getShippingMethod() ? $order->getShippingMethod() : '';
360
+
361
+ // Get addresses
362
+ $shippingAddress = $order->getShippingAddress();
363
+ if ($shippingAddress instanceof Mage_Sales_Model_Order_Address) {
364
+ $transaction['delivery'] = $this->_getAddressData($shippingAddress);
365
+ }
366
+
367
+ $transaction['billing'] = $this->_getAddressData($order->getBillingAddress());
368
+
369
+ // Get items
370
+ $transaction['line_items'] = $this->_getLineItems($order->getAllVisibleItems(), 'transaction');
371
+
372
+ $this->setTransaction($transaction);
373
+ return $this;
374
+ }
375
+
376
+ }
app/code/community/QuBit/UniversalVariable/etc/adminhtml.xml CHANGED
@@ -8,10 +8,10 @@
8
  <children>
9
  <config>
10
  <children>
11
- <qubit_universalvariable translate="title" module="universal_variable_main">
12
- <sort_order>0</sort_order>
13
- <title>Manage QuBit Script</title>
14
- </qubit_universalvariable>
15
  </children>
16
  </config>
17
  </children>
8
  <children>
9
  <config>
10
  <children>
11
+ <qubituv translate="title" module="qubituv">
12
+ <sort_order>1000</sort_order>
13
+ <title>Manage Qubit Universal Variable</title>
14
+ </qubituv>
15
  </children>
16
  </config>
17
  </children>
app/code/community/QuBit/UniversalVariable/etc/config.xml CHANGED
@@ -1,85 +1,70 @@
1
  <?xml version="1.0"?>
2
- <config>
3
  <modules>
4
- <QuBit_UniversalVariable>
5
- <version>1.0.0</version>
6
- </QuBit_UniversalVariable>
7
  </modules>
8
 
9
- <adminhtml>
10
- <acl>
11
- <resources>
12
- <admin>
13
- <children>
14
- <system>
15
- <children>
16
- <config>
17
- <children>
18
- <universalvariable_options>
19
- <title>UV Module Section</title>
20
- </universalvariable_options>
21
- </children>
22
- </config>
23
- </children>
24
- </system>
25
- </children>
26
- </admin>
27
- </resources>
28
- </acl>
29
- </adminhtml>
30
-
31
  <global>
32
- <models>
33
- <universal_variable_main>
34
- <class>QuBit_UniversalVariable_Model</class>
35
- </universal_variable_main>
36
- </models>
37
- <helpers>
38
- <universal_variable_main>
39
- <class>QuBit_UniversalVariable_Helper</class>
40
- </universal_variable_main>
41
- </helpers>
42
- <blocks>
43
- <universal_variable_main>
44
- <class>QuBit_UniversalVariable_Block</class>
45
- </universal_variable_main>
46
- </blocks>
47
  </global>
48
 
49
  <frontend>
50
-
51
- <!-- Layout -->
52
- <layout>
53
- <updates>
54
- <qubit_universal_variable>
55
- <file>qubit/universal_variable.xml</file>
56
- </qubit_universal_variable>
57
- </updates>
58
- </layout>
59
- <events>
60
- <controller_action_layout_load_before>
61
- <observers>
62
- <QuBit_UniversalVariable_Model_Page_Observer>
63
- <type>singleton</type>
64
- <class>universal_variable_main/page_observer</class>
65
- <method>setUniversalVariable</method>
66
- </QuBit_UniversalVariable_Model_Page_Observer>
67
- </observers>
68
- </controller_action_layout_load_before>
69
- </events>
 
 
 
 
 
 
70
  </frontend>
71
 
72
- <!-- Admin Configuration Default Values -->
73
  <default>
74
- <!-- <QuBit_UniversalVariable>
75
- <QuBit_UniversalVariable_Settings>
76
- <QuBit_OpenTag_Async>1</QuBit_OpenTag_Async>
77
- </QuBit_UniversalVariable_Settings>
78
- </QuBit_UniversalVariable> -->
79
- <qubit>
80
- <qubit_opentag_async>1</qubit_opentag_async>
81
- <qubit_opentag_enabled>1</qubit_opentag_enabled>
82
- <qubit_universal_variable_enabled>1</qubit_universal_variable_enabled>
83
- </qubit>
 
 
 
 
 
 
 
84
  </default>
85
  </config>
1
  <?xml version="1.0"?>
2
+ <config>
3
  <modules>
4
+ <QuBit_UniversalVariable>
5
+ <version>1.3.0</version>
6
+ </QuBit_UniversalVariable>
7
  </modules>
8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  <global>
10
+ <models>
11
+ <qubituv>
12
+ <class>QuBit_UniversalVariable_Model</class>
13
+ </qubituv>
14
+ </models>
15
+ <helpers>
16
+ <qubituv>
17
+ <class>QuBit_UniversalVariable_Helper</class>
18
+ </qubituv>
19
+ </helpers>
 
 
 
 
 
20
  </global>
21
 
22
  <frontend>
23
+ <layout>
24
+ <updates>
25
+ <qubit_universal_variable>
26
+ <file>qubit/uv.xml</file>
27
+ </qubit_universal_variable>
28
+ </updates>
29
+ </layout>
30
+ <translate>
31
+ <modules>
32
+ <QuBit_UniversalVariable>
33
+ <files>
34
+ <default>QuBit_UniversalVariable.csv</default>
35
+ </files>
36
+ </QuBit_UniversalVariable>
37
+ </modules>
38
+ </translate>
39
+ <events>
40
+ <controller_action_layout_render_before>
41
+ <observers>
42
+ <qubituv_process_listing_data>
43
+ <class>qubituv/observer</class>
44
+ <method>processListingData</method>
45
+ </qubituv_process_listing_data>
46
+ </observers>
47
+ </controller_action_layout_render_before>
48
+ </events>
49
  </frontend>
50
 
 
51
  <default>
52
+ <qubituv>
53
+ <settings>
54
+ <enabled>1</enabled>
55
+ </settings>
56
+ <opentag>
57
+ <enabled>1</enabled>
58
+ <container_id></container_id>
59
+ <async>1</async>
60
+ </opentag>
61
+ <advanced>
62
+ <show_product_id>0</show_product_id>
63
+ <show_stock_info>0</show_stock_info>
64
+ <show_user_id>0</show_user_id>
65
+ <category_product_list_block>product_list</category_product_list_block>
66
+ <search_product_list_block>search_result_list</search_product_list_block>
67
+ </advanced>
68
+ </qubituv>
69
  </default>
70
  </config>
app/code/community/QuBit/UniversalVariable/etc/system.xml CHANGED
@@ -1,94 +1,157 @@
1
  <?xml version="1.0"?>
2
  <config>
3
  <tabs>
4
- <QuBit_tab translate="label">
5
- <label>Universal Variable</label>
6
- <sort_order>100</sort_order>
7
- </QuBit_tab>
8
  </tabs>
9
 
10
  <sections>
11
- <qubit_universalvariable translate="label">
12
  <label>Configuration</label>
13
- <tab>QuBit_tab</tab>
14
  <frontend_type>text</frontend_type>
15
- <sort_order>2</sort_order>
16
  <show_in_default>1</show_in_default>
17
  <show_in_website>1</show_in_website>
18
  <show_in_store>1</show_in_store>
 
19
  <groups>
20
- <QuBit_UniversalVariable_Settings translate="label">
21
  <label>Universal Variable Configuration</label>
22
  <sort_order>1</sort_order>
23
  <show_in_default>1</show_in_default>
24
  <show_in_website>1</show_in_website>
25
  <show_in_store>1</show_in_store>
26
  <fields>
27
- <QuBit_UniversalVariable_Enabled translate="label">
28
  <label>Enable Universal Variable</label>
29
  <frontend_type>select</frontend_type>
30
  <source_model>adminhtml/system_config_source_yesno</source_model>
31
- <config_path>qubit/qubit_universal_variable_enabled</config_path>
32
- <comment><![CDATA[ Variables output on every page are based on <br/>
33
- <a href="https://github.com/QubitProducts/UniversalVariable " target="_blank">Universal Variable Specification</a> ]]></comment>
34
  <sort_order>1</sort_order>
35
  <show_in_default>1</show_in_default>
36
  <show_in_website>1</show_in_website>
37
  <show_in_store>1</show_in_store>
38
- </QuBit_UniversalVariable_Enabled>
39
  </fields>
40
- </QuBit_UniversalVariable_Settings>
41
 
42
- <QuBit_OpenTag_Settings translate="label">
43
- <label>QuBit OpenTag Configuration</label>
44
  <sort_order>2</sort_order>
45
  <show_in_default>1</show_in_default>
46
  <show_in_website>1</show_in_website>
47
  <show_in_store>1</show_in_store>
48
  <fields>
49
- <QuBit_OpenTag_Container translate="label">
 
 
 
 
 
 
 
 
 
 
50
  <label>Container ID</label>
51
  <frontend_type>text</frontend_type>
52
- <config_path>qubit/qubit_opentag_container_id</config_path>
53
- <comment><![CDATA[ Click 'Embed' button in OpenTag interface for the container you'd like to implement.<br/>
54
- Your container ID should look like 1234-56789, for example: <br/>
55
- &lt;script src="//d3c3cq33003psk.cloudfront.net/opentag-<strong>1234-56789</strong>.js" async defer&gt;&lt;/script&gt; <br/>
56
- You can <a href="https://opentag.qubitproducts.com/QDashboard/" target="_blank">Sign In</a> or <a href="https://opentag.qubitproducts.com/QDashboard/register.html" target="_blank"> Signup an OpenTag account</a>.
57
- ]]>
58
- </comment>
59
  <sort_order>1</sort_order>
60
  <show_in_default>1</show_in_default>
61
  <show_in_website>1</show_in_website>
62
  <show_in_store>1</show_in_store>
63
- </QuBit_OpenTag_Container>
64
-
65
- <QuBit_OpenTag_Async translate="label">
66
- <label>Asynchronous</label>
67
  <frontend_type>select</frontend_type>
68
  <source_model>adminhtml/system_config_source_yesno</source_model>
69
- <config_path>qubit/qubit_opentag_async</config_path>
70
- <comment><![CDATA[ Asynchronous is recommended. ]]></comment>
71
- <sort_order>2</sort_order>
72
  <show_in_default>1</show_in_default>
73
  <show_in_website>1</show_in_website>
74
  <show_in_store>1</show_in_store>
75
- </QuBit_OpenTag_Async>
 
 
76
 
77
- <QuBit_OpenTag_Enabled translate="label">
78
- <label>Enable OpenTag</label>
 
 
 
 
 
 
 
79
  <frontend_type>select</frontend_type>
80
  <source_model>adminhtml/system_config_source_yesno</source_model>
81
- <config_path>qubit/qubit_opentag_enabled</config_path>
82
- <sort_order>3</sort_order>
83
  <show_in_default>1</show_in_default>
84
  <show_in_website>1</show_in_website>
85
  <show_in_store>1</show_in_store>
86
- </QuBit_OpenTag_Enabled>
87
- </fields>
88
- </QuBit_OpenTag_Settings>
89
 
 
 
 
 
 
 
 
 
 
 
90
 
91
- </groups>
92
- </qubit_universalvariable>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
93
  </sections>
94
  </config>
1
  <?xml version="1.0"?>
2
  <config>
3
  <tabs>
4
+ <qubituv translate="label">
5
+ <label>Qubit Universal Variable</label>
6
+ <sort_order>1000</sort_order>
7
+ </qubituv>
8
  </tabs>
9
 
10
  <sections>
11
+ <qubituv translate="label">
12
  <label>Configuration</label>
13
+ <tab>qubituv</tab>
14
  <frontend_type>text</frontend_type>
15
+ <sort_order>10</sort_order>
16
  <show_in_default>1</show_in_default>
17
  <show_in_website>1</show_in_website>
18
  <show_in_store>1</show_in_store>
19
+
20
  <groups>
21
+ <settings translate="label">
22
  <label>Universal Variable Configuration</label>
23
  <sort_order>1</sort_order>
24
  <show_in_default>1</show_in_default>
25
  <show_in_website>1</show_in_website>
26
  <show_in_store>1</show_in_store>
27
  <fields>
28
+ <enabled translate="label comment">
29
  <label>Enable Universal Variable</label>
30
  <frontend_type>select</frontend_type>
31
  <source_model>adminhtml/system_config_source_yesno</source_model>
32
+ <comment><![CDATA[Variables output on every page are based on <br/><a href="https://github.com/QubitProducts/UniversalVariable " target="_blank">Universal Variable Specification</a>]]></comment>
 
 
33
  <sort_order>1</sort_order>
34
  <show_in_default>1</show_in_default>
35
  <show_in_website>1</show_in_website>
36
  <show_in_store>1</show_in_store>
37
+ </enabled>
38
  </fields>
39
+ </settings>
40
 
41
+ <opentag translate="label">
42
+ <label>Qubit OpenTag Configuration</label>
43
  <sort_order>2</sort_order>
44
  <show_in_default>1</show_in_default>
45
  <show_in_website>1</show_in_website>
46
  <show_in_store>1</show_in_store>
47
  <fields>
48
+ <enabled translate="label">
49
+ <label>Enable OpenTag</label>
50
+ <frontend_type>select</frontend_type>
51
+ <source_model>adminhtml/system_config_source_yesno</source_model>
52
+ <sort_order>1</sort_order>
53
+ <show_in_default>1</show_in_default>
54
+ <show_in_website>1</show_in_website>
55
+ <show_in_store>1</show_in_store>
56
+ </enabled>
57
+
58
+ <container_id translate="label comment">
59
  <label>Container ID</label>
60
  <frontend_type>text</frontend_type>
61
+ <comment><![CDATA[Click 'Embed' button in OpenTag interface for the container you'd like to implement.<br/>Your container ID should look like 1234-56789, for example: <br/>&lt;script src="//d3c3cq33003psk.cloudfront.net/opentag-<strong>1234-56789</strong>.js" async defer&gt;&lt;/script&gt; <br/>You can <a href="https://opentag.qubitproducts.com/QDashboard/" target="_blank">Sign In</a> or <a href="https://opentag.qubitproducts.com/QDashboard/register.html" target="_blank">Signup for an OpenTag account</a>.]]></comment>
 
 
 
 
 
 
62
  <sort_order>1</sort_order>
63
  <show_in_default>1</show_in_default>
64
  <show_in_website>1</show_in_website>
65
  <show_in_store>1</show_in_store>
66
+ </container_id>
67
+
68
+ <async translate="label comment">
69
+ <label>Asynchronous loading</label>
70
  <frontend_type>select</frontend_type>
71
  <source_model>adminhtml/system_config_source_yesno</source_model>
72
+ <comment><![CDATA[Asynchronous is recommended.]]></comment>
73
+ <sort_order>10</sort_order>
 
74
  <show_in_default>1</show_in_default>
75
  <show_in_website>1</show_in_website>
76
  <show_in_store>1</show_in_store>
77
+ </async>
78
+ </fields>
79
+ </opentag>
80
 
81
+ <advanced>
82
+ <label>Advanced Settings</label>
83
+ <sort_order>5</sort_order>
84
+ <show_in_default>1</show_in_default>
85
+ <show_in_website>1</show_in_website>
86
+ <show_in_store>1</show_in_store>
87
+ <fields>
88
+ <show_product_id translate="label comment">
89
+ <label>Show real product IDs</label>
90
  <frontend_type>select</frontend_type>
91
  <source_model>adminhtml/system_config_source_yesno</source_model>
92
+ <comment><![CDATA[Show the real, numerical ID of the product. If set to no, it will use the SKU. <strong>Recommended value:</strong> No]]></comment>
93
+ <sort_order>10</sort_order>
94
  <show_in_default>1</show_in_default>
95
  <show_in_website>1</show_in_website>
96
  <show_in_store>1</show_in_store>
97
+ </show_product_id>
 
 
98
 
99
+ <show_stock_info translate="label comment">
100
+ <label>Show stock information</label>
101
+ <frontend_type>select</frontend_type>
102
+ <source_model>adminhtml/system_config_source_yesno</source_model>
103
+ <comment><![CDATA[If set to yes, it will show the stock product qty]]></comment>
104
+ <sort_order>20</sort_order>
105
+ <show_in_default>1</show_in_default>
106
+ <show_in_website>1</show_in_website>
107
+ <show_in_store>1</show_in_store>
108
+ </show_stock_info>
109
 
110
+ <show_user_id translate="label comment">
111
+ <label>Show real user ID</label>
112
+ <frontend_type>select</frontend_type>
113
+ <source_model>adminhtml/system_config_source_yesno</source_model>
114
+ <comment><![CDATA[Show the real, numerical ID of the user. If set to no, it will use a hash. <strong>Recommended value:</strong> No]]></comment>
115
+ <sort_order>30</sort_order>
116
+ <show_in_default>1</show_in_default>
117
+ <show_in_website>1</show_in_website>
118
+ <show_in_store>1</show_in_store>
119
+ </show_user_id>
120
+
121
+ <show_magento_version translate="label comment">
122
+ <label>Show Magento version number in the Universal Variable</label>
123
+ <frontend_type>select</frontend_type>
124
+ <source_model>adminhtml/system_config_source_yesno</source_model>
125
+ <comment><![CDATA[Show Magento version in UV <strong>Recommended value: </strong> No]]></comment>
126
+ <sort_order>40</sort_order>
127
+ <show_in_default>1</show_in_default>
128
+ <show_in_website>1</show_in_website>
129
+ <show_in_store>1</show_in_store>
130
+ </show_magento_version>
131
+
132
+ <category_product_list_block translate="label comment">
133
+ <label>Product list block name on category pages</label>
134
+ <frontend_type>text</frontend_type>
135
+ <comment><![CDATA[The name of the <em>catalog/product_list</em> block on category pages. <strong>Default value: </strong>product_list]]></comment>
136
+ <sort_order>50</sort_order>
137
+ <show_in_default>1</show_in_default>
138
+ <show_in_website>1</show_in_website>
139
+ <show_in_store>1</show_in_store>
140
+ </category_product_list_block>
141
+
142
+ <search_product_list_block translate="label comment">
143
+ <label>Product list block name on search result pages</label>
144
+ <frontend_type>text</frontend_type>
145
+ <comment><![CDATA[The name of the <em>catalog/product_list</em> block on search result pages. <strong>Default value: </strong>search_result_list]]></comment>
146
+ <sort_order>60</sort_order>
147
+ <show_in_default>1</show_in_default>
148
+ <show_in_website>1</show_in_website>
149
+ <show_in_store>1</show_in_store>
150
+ </search_product_list_block>
151
+
152
+ </fields>
153
+ </advanced>
154
+ </groups>
155
+ </qubituv>
156
  </sections>
157
  </config>
app/design/frontend/base/default/layout/qubit/universal_variable.xml DELETED
@@ -1,8 +0,0 @@
1
- <?xml version="1.0"?>
2
- <layout version="0.1.0">
3
- <default>
4
- <reference name="head">
5
- <block type="universal_variable_main/uv" name="universal_variable" as="universal_variable" template="qubit/universal_variable.phtml"/>
6
- </reference>
7
- </default>
8
- </layout>
 
 
 
 
 
 
 
 
app/design/frontend/base/default/layout/qubit/uv.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+
3
+ <layout version="0.1.0">
4
+ <default>
5
+ <reference name="head">
6
+ <block type="core/template" name="qubit_uv" template="qubit/uv.phtml"/>
7
+ </reference>
8
+ </default>
9
+ </layout>
app/design/frontend/base/default/template/qubit/universal_variable.phtml DELETED
@@ -1,60 +0,0 @@
1
- <?php
2
- /* @var $this QuBit_UniversalVariable_Block_Uv */
3
- $qubit_opentag_container_id = Mage::getStoreConfig('qubit/qubit_opentag_container_id');
4
- $qubit_opentag_async = Mage::getStoreConfig('qubit/qubit_opentag_async');
5
- $qubit_opentag_enabled = Mage::getStoreConfig('qubit/qubit_opentag_enabled');
6
- $qubit_universal_variable_enabled = Mage::getStoreConfig('qubit/qubit_universal_variable_enabled');
7
-
8
- $observer = 'universal_variable_main/page_observer';
9
- $mage = Mage::getSingleton($observer);
10
-
11
- if ($qubit_opentag_async == 1) {
12
- $qubit_opentag_async = 'async defer';
13
- } else {
14
- $qubit_opentag_async = '';
15
- };
16
- ?>
17
-
18
- <?php if ($qubit_universal_variable_enabled == 1) :?>
19
- <?php
20
- // extract variable only when universal variable is enabled
21
- $version = $mage->getVersion();
22
- $page = $mage->getPage();
23
- $user = $mage->getUser();
24
- $product = $mage->getProduct();
25
- $basket = $mage->getBasket();
26
- $listing = $mage->getListing();
27
- $transaction = $mage->getTransaction();
28
- $magento_version = $mage->getMageVersion();
29
- $events = $mage->getEvents();
30
- ?>
31
- <!-- Universal Variable Start -->
32
- <script type="text/javascript">
33
- window.universal_variable = window.universal_variable || {};
34
- window.universal_variable.version = <?php echo json_encode($version); ?>;
35
- window.universal_variable.magento_version = <?php echo json_encode($magento_version) ?>;
36
- window.universal_variable.page = <?php echo json_encode($page); ?>;
37
- window.universal_variable.user = <?php echo json_encode($user); ?>;
38
- <?php if ($product) : ?>
39
- window.universal_variable.product = <?php echo json_encode($product) ?>;
40
- <?php endif; ?>
41
- <?php if ($basket) : ?>
42
- window.universal_variable.basket = <?php echo json_encode($basket) ?>;
43
- <?php endif; ?>
44
- <?php if ($listing): ?>
45
- window.universal_variable.listing = <?php echo json_encode($listing) ?>;
46
- <?php endif; ?>
47
- <?php if ($transaction): ?>
48
- window.universal_variable.transaction = <?php echo json_encode($transaction) ?>;
49
- <?php endif; ?>
50
- window.universal_variable.events = <?php echo json_encode($events); ?>;
51
- </script>
52
- <!-- Universal Variable End -->
53
- <?php endif;?>
54
-
55
- <?php if ($qubit_opentag_container_id && $qubit_opentag_enabled == 1) :?>
56
- <!-- QuBit OpenTag Start -->
57
- <script type="text/javascript" src='//d3c3cq33003psk.cloudfront.net/opentag-<?php echo $qubit_opentag_container_id;?>.js' <?php echo $qubit_opentag_async;?>></script>
58
- <!-- QuBit OpenTag End -->
59
-
60
- <?php endif;?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/base/default/template/qubit/uv.phtml ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* @var $helper QuBit_UniversalVariable_Helper_Data */
3
+ $helper = $this->helper('qubituv');
4
+
5
+ $uv = $helper->getUv();
6
+ ?>
7
+
8
+ <?php if ($helper->uvEnabled()): ?>
9
+ <script type="text/javascript">
10
+ var uv = <?php echo $uv->getUvData(); ?>;
11
+ window.universal_variable = $H(window.universal_variable || {}).merge(uv).toObject();
12
+ </script>
13
+ <?php endif;?>
14
+ <?php if ($helper->opentagEnabled()): ?>
15
+ <script type="text/javascript" src="//d3c3cq33003psk.cloudfront.net/opentag-<?php echo $helper->getContainerId();?>.js" <?php if ($helper->useAsync()): ?>async defer<?php endif; ?>></script>
16
+ <?php endif;?>
app/etc/modules/QuBit_UniversalVariable.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version = "1.0"?>
2
+ <config>
3
+ <modules>
4
+ <QuBit_UniversalVariable>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ </QuBit_UniversalVariable>
8
+ </modules>
9
+ </config>
app/etc/modules/QuBit_all.xml DELETED
@@ -1,9 +0,0 @@
1
- <?xml version = "1.0"?>
2
- <config>
3
- <modules>
4
- <QuBit_UniversalVariable>
5
- <active>true</active>
6
- <codePool>community</codePool>
7
- </QuBit_UniversalVariable>
8
- </modules>
9
- </config>
 
 
 
 
 
 
 
 
 
app/locale/en_US/QuBit_UniversalVariable.csv ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Qubit Universal Variable,Qubit Universal Variable
2
+ Configuration,Configuration
3
+ Universal Variable Configuration,Universal Variable Configuration
4
+ Enable Universal Variable,Enable Universal Variable
5
+ "Variables output on every page are based on <br/><a href=""https://github.com/QubitProducts/UniversalVariable"" target=""_blank"">Universal Variable Specification</a>","Variables output on every page are based on <br/><a href=""https://github.com/QubitProducts/UniversalVariable"" target=""_blank"">Universal Variable Specification</a>"
6
+ Qubit OpenTag Configuration,Qubit OpenTag Configuration
7
+ Container ID,Container ID
8
+ "Click 'Embed' button in OpenTag interface for the container you'd like to implement.<br/>Your container ID should look like 1234-56789, for example: <br/>&lt;script src=""//d3c3cq33003psk.cloudfront.net/opentag-<strong>1234-56789</strong>.js"" async defer&gt;&lt;/script&gt; <br/>You can <a href=""https://opentag.qubitproducts.com/QDashboard/"" target=""_blank"">Sign In</a> or <a href=""https://opentag.qubitproducts.com/QDashboard/register.html"" target=""_blank"">Signup for an OpenTag account</a>.","Click 'Embed' button in OpenTag interface for the container you'd like to implement.<br/>Your container ID should look like 1234-56789, for example: <br/>&lt;script src=""//d3c3cq33003psk.cloudfront.net/opentag-<strong>1234-56789</strong>.js"" async defer&gt;&lt;/script&gt; <br/>You can <a href=""https://opentag.qubitproducts.com/QDashboard/"" target=""_blank"">Sign In</a> or <a href=""https://opentag.qubitproducts.com/QDashboard/register.html"" target=""_blank"">Signup for an OpenTag account</a>."
9
+ Enable OpenTag,Enable OpenTag
10
+ Asynchronous loading,Asynchronous loading
11
+ Asynchronous is recommended.,Asynchronous is recommended.
12
+ Manage Qubit Universal Variable,Manage Qubit Universal Variable
13
+ Advanced Settings,Advanced Settings
14
+ Show real product IDs,Show real product IDs
15
+ "Show the real, numerical ID of the product. If set to no, it will use the SKU. <strong>Recommended value:</strong> No","Show the real, numerical ID of the product. If set to no, it will use the SKU. <strong>Recommended value:</strong> No"
16
+ Show stock information,Show stock information
17
+ "If set to yes, it will show the stock product qty","If set to yes, it will show the stock product qty"
18
+ Show real user ID,Show real user ID
19
+ "Show the real, numerical ID of the user. If set to no, it will use a hash. <strong>Recommended value:</strong> No","Show the real, numerical ID of the user. If set to no, it will use a hash. <strong>Recommended value:</strong> No"
20
+ Product list block name on category pages,Product list block name on category pages
21
+ "The name of the <em>catalog/product_list</em> block on category pages. <strong>Default value: </strong>product_list","The name of the <em>catalog/product_list</em> block on category pages. <strong>Default value: </strong>product_list"
22
+ Product list block name on search result pages,Product list block name on search result pages
23
+ "The name of the <em>catalog/product_list</em> block on search result pages. <strong>Default value: </strong>search_result_list","The name of the <em>catalog/product_list</em> block on search result pages. <strong>Default value: </strong>search_result_list"
24
+ Show Magento version number in the Universal Variable, Show Magento version number in the Universal Variable
25
+ Show Magento version in UV <strong>Recommended value: </strong> No, Show Magento version in UV <strong>Recommended value: </strong> No
package.xml CHANGED
@@ -1,23 +1,34 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>QuBit_UniversalVariable</name>
4
- <version>1.0.23</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>
8
  <extends/>
9
- <summary>QuBit Universal Variable is our suggested way to structure the data presented on your pages. Affiliates, remarking or advertising tags become easier to implement.&#xD;
10
- &#xD;
11
- </summary>
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 missing ACL node to fix the save issue in Magento 1.9&#xD;
16
- - Fix bug where if products aren't shippable (virtual products etc)</notes>
17
- <authors><author><name>Jing Dong</name><user>qubitproducts</user><email>jing@qubitdigital.com</email></author></authors>
18
- <date>2014-07-17</date>
19
- <time>10:06:20</time>
20
- <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="4ef0fd01571e1052a2c23c69f00b5693"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="35f6ea94bc8984d18119a6fc5e63ec9f"/><file name="config.xml" hash="dcea21a4642c6e05aa0ef2c3b4b9e745"/><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>
 
 
 
 
 
 
 
 
 
 
 
21
  <compatible/>
22
- <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
23
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>QuBit_UniversalVariable</name>
4
+ <version>1.3.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>
8
  <extends/>
9
+ <summary>Universal Variable provides a standardised JSON structure for data relating to the user journey of your visitors, such user details, products viewed and transactions. Data contained in Universal Variable are pushed automatically to Qubit&#x2019;s platform and Opentag scripts.</summary>
10
+ <description>Universal Variable provides a standardised JSON structure for data relating to the user journey of your visitors, such user details, products viewed and transactions. Data contained in Universal Variable are pushed automatically to Qubit&#x2019;s platform and Opentag scripts.&#xD;
11
+ &#xD;
12
+ This extension plugs into your Magento installation and automatically inserts Universal Variable and Opentag to the top of your pages, taking away 99% of the development work of implementing Universal Variable on your site.</description>
13
+ <notes>Refactored [Thanks firewizard]&#xD;
14
+ &#xD;
15
+ Magento version is now under a flag [security by obscurity]&#xD;
16
+ &#xD;
17
+ Options for hiding stock information, using real product IDs and the product id (database entry id) &#xD;
18
+ &#xD;
19
+ Flag to either user real User ID or a hashed version of it&#xD;
20
+ &#xD;
21
+ Product line_items&#xD;
22
+ &#xD;
23
+ Makes sure there is a valid delivery address to stop confirmation page error.&#xD;
24
+ &#xD;
25
+ user has_transacted&#xD;
26
+ &#xD;
27
+ updated branding from QuBit to Qubit</notes>
28
+ <authors><author><name>Callum Rogan</name><user>rogy</user><email>callum@qubitproducts.com</email></author></authors>
29
+ <date>2015-01-30</date>
30
+ <time>12:40:44</time>
31
+ <contents><target name="magecommunity"><dir name="QuBit"><dir name="UniversalVariable"><dir name="Helper"><file name="Data.php" hash="20ee1c7742638407ae4fc5d4119efb4e"/></dir><dir name="Model"><file name="Observer.php" hash="928c127e4468dc4316ce124dc5711c33"/><file name="Uv.php" hash="8b4ad81aff8955138de89a7ba03dfb23"/></dir><dir name="etc"><file name="adminhtml.xml" hash="e708e1e94c34a3d0340b2c26d142b938"/><file name="config.xml" hash="5c9cb4ad71799e842799cba5130dc219"/><file name="system.xml" hash="d6f80fb4487a5e73de6886d2c909f90d"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="QuBit_UniversalVariable.xml" hash="78415ff310ffbb380e1a95633caf4926"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="qubit"><file name="uv.phtml" hash="3b639da939fde63dafc3a8ff956e140d"/></dir></dir><dir name="layout"><dir name="qubit"><file name="uv.xml" hash="149b99e8bc633f90cef5700301e12590"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="QuBit_UniversalVariable.csv" hash="db8b84cbc643341df36f2ba05275ef71"/></dir></target></contents>
32
  <compatible/>
33
+ <dependencies><required><php><min>5.1.0</min><max>6.0.1</max></php></required></dependencies>
34
  </package>