Tatvic_Google_Analytics_Enhanced_Ecommerce - Version 2.0.8

Version Notes

Integration between Enhanced Ecommerce Feature of Universal Analytics and Magento

Download this release

Release Info

Developer Khushboo
Extension Tatvic_Google_Analytics_Enhanced_Ecommerce
Version 2.0.8
Comparing to
See all releases


Code changes from version 2.0.7 to 2.0.8

app/code/community/Tatvic/Uaee/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Tatvic_Uaee>
5
- <version>2.0.4</version>
6
  </Tatvic_Uaee>
7
  </modules>
8
  <global>
2
  <config>
3
  <modules>
4
  <Tatvic_Uaee>
5
+ <version>2.0.8</version>
6
  </Tatvic_Uaee>
7
  </modules>
8
  <global>
app/design/frontend/base/default/template/tatvic/uaee/uaee.phtml CHANGED
@@ -1,4 +1,3 @@
1
- <?php /** */ ?>
2
  <?php if ($this->isActive()):
3
  ?>
4
 
@@ -89,15 +88,14 @@
89
  //exec_tvc_t_sth = true;
90
 
91
  <?php
92
- $_SESSION["limit"] = Mage::getBlockSingleton('catalog/product_list_toolbar')->getLimit();
93
- $_SESSION["direction"] = Mage::getBlockSingleton('catalog/product_list_toolbar')->getCurrentDirection();
94
- $_SESSION["order"] = Mage::getBlockSingleton('catalog/product_list_toolbar')->getCurrentOrder();
95
- $page = $this->getRequest()->getParam('p');
96
- if ($page != "") {
97
- $_SESSION["page"] = $page;
98
- } else {
99
- $_SESSION["page"] = 1;
100
- }
101
  ?>
102
 
103
  <?php
@@ -114,8 +112,11 @@
114
  <?php
115
  $category = Mage::getSingleton('catalog/category');
116
  $category->load($this->getHomeId());
117
- $collection = $category->getProductCollection();
118
- $collection->addAttributeToSelect('*')->addAttributeToSort($_SESSION["order"], $_SESSION["direction"])->setPageSize($_SESSION["limit"])->setCurPage($_SESSION["page"]);
 
 
 
119
  $products = $collection->getItems();
120
  $catName = $category->getName();
121
  $catIds = "";
@@ -170,7 +171,7 @@
170
  <?php $catIds = "";
171
  $position++;
172
  endif;
173
- } $_SESSION["page"] = 1; ?>
174
  exec_tvc_t_hi = true;
175
 
176
 
@@ -234,7 +235,11 @@
234
  $catId = $_category_detail->getId();
235
  $catName = $_category_detail->getName();
236
  $category = Mage::getSingleton('catalog/category')->load($catId);
237
- $collection = $category->getProductCollection()->addAttributeToSelect('*')->addAttributeToSort($_SESSION["order"], $_SESSION["direction"])->setPageSize($_SESSION["limit"])->setCurPage($_SESSION["page"]);
 
 
 
 
238
  $catIds = "";
239
  $position = 1;
240
  $products = $collection->getItems();
@@ -281,7 +286,7 @@
281
 
282
  <?php $catIds = "";
283
  $position++;
284
- $_SESSION["page"] = 1;
285
  endif;
286
  } ?>
287
  catName = "<?php echo $catName; ?>";
@@ -299,6 +304,7 @@
299
  if (strpos($this->getRequest()->getPathInfo(), '/catalogsearch/result/') !== false):
300
 
301
  $_q = addslashes(Mage::app()->getRequest()->getQuery('q'));
 
302
  ?>
303
 
304
  var catalogSearch = {};
@@ -306,25 +312,22 @@
306
  <?php
307
  $position = 1;
308
 
309
- $_Products = Mage::getSingleton('catalog/product')
310
- ->getCollection()
311
- ->addAttributeToSelect('*')
312
- ->addAttributeToFilter(
313
- array(
314
- array('attribute' => 'name', 'like' => '%' . $_q . '%'),
315
- array('attribute' => 'price', 'like' => '%' . $_q . '%'),
316
- array('attribute' => 'description', 'like' => '%' . $_q . '%'),
317
- array('attribute' => 'url_key', 'like' => '%' . $_q . '%'),
318
- array('attribute' => 'sku', 'like' => '%' . $_q . '%'),
319
- array('attribute' => 'entity_id', 'like' => '%' . $_q . '%')
320
- )
321
- )->setPageSize($_SESSION["limit"])->setCurPage($_SESSION["page"]);
322
 
323
  $catIds = "";
324
  ?>
325
 
326
  <?php
327
- foreach ($_Products as $_product) {
328
  ?>
329
 
330
  <?php
@@ -342,15 +345,15 @@
342
  $product_sku = $_product->getId();
343
  endif;
344
  ?>
345
- t_product_url_2 = "<?php echo trim(Mage::getUrl($_product->getUrlPath()), "/"); ?>";
346
- catalogSearch['<?php echo $_product->getProductUrl(); ?>'] = {'sku': '<?php echo addslashes($product_sku); ?>',
347
  'Name': '<?php echo addslashes($_product->getName()); ?>',
348
  'price': '<?php echo $_product->getFinalPrice(); ?>',
349
  'id': '<?php echo $_product->getId(); ?>',
350
  'categories': '<?php echo addslashes(trim($catIds, ",")); ?>',
351
  'position': '<?php echo $position; ?>',
352
  'brand': '<?php echo addslashes(t_getBrandValue($_product, $brand_code)); ?>',
353
- 'url2': t_product_url_2,
354
  'visibility': '<?php echo $_product->getVisibility(); ?>',
355
  'instock': '<?php echo $inStock; ?>',
356
  'stock': "<?php echo Mage::getSingleton('cataloginventory/stock_item')->loadByProduct($_product->getId())->getQty(); ?>"
@@ -361,7 +364,7 @@
361
  <?php $catIds = "";
362
  $position++;
363
  endif;
364
- } $_SESSION["page"] = 1; ?>
365
  exec_tvc_t_cs = true;
366
 
367
  <?php endif;
@@ -375,7 +378,7 @@
375
  if (isset($_COOKIE['tvc_metadata'])) {
376
 
377
  $tvc_metadata = array(
378
- 'plugin_version' => '2.0.7',
379
  'current_pkg' => Mage::getDesign()->getPackageName(),
380
  'current_theme' => Mage::getDesign()->getTheme('frontend'),
381
  'Plugin_data' => array('checkout_url' => Mage::getStoreConfig('tatvic_uaee/ecommerce/checkout_url'),
@@ -558,14 +561,14 @@
558
  ?>
559
  transactionObject = {};
560
  transactionObject = {
561
- 'tid': '<?php echo $_order->getData($this->getTransactionIdField()) ?>',
562
  'aid': '<?php echo addslashes(Mage::app()->getStore()->getName()) ?>',
563
  'revenue': '<?php echo $_order->getGrandTotal() ?>',
564
  'tax': '<?php echo $_order->getTaxAmount() ?>',
565
  'shipping': '<?php echo $_order->getShippingInclTax() ?>',
566
  'ccode': '<?php echo addslashes($_order->getCouponCode()); ?>'
567
  }
568
- //t_oid = '<?php echo $_order->getIncrementId(); // ?>';
569
  //exec_tvc_t_thnx = true;
570
 
571
  for (item in orderObject) {
 
1
  <?php if ($this->isActive()):
2
  ?>
3
 
88
  //exec_tvc_t_sth = true;
89
 
90
  <?php
91
+
92
+ //Call the filter/sorting options for the Product Collections.
93
+ $tvc_filteroptions = Mage::getBlockSingleton('catalog/product_list_toolbar');
94
+ $currentpage = (int) ($this->getRequest()->getParam('p')) ? $this->getRequest()->getParam('p') : 1;
95
+
96
+ // Use Magento's session functionality
97
+ $tvc_setpage = Mage::getSingleton('core/session')->setcurrpage($currentpage);
98
+ $tvc_getpage = Mage::getSingleton('core/session')->getcurrpage();
 
99
  ?>
100
 
101
  <?php
112
  <?php
113
  $category = Mage::getSingleton('catalog/category');
114
  $category->load($this->getHomeId());
115
+ $collection = $category->getProductCollection();
116
+ $collection->addAttributeToSelect('*')
117
+ ->addAttributeToSort($tvc_filteroptions->getCurrentOrder(), $tvc_filteroptions->getCurrentDirection())
118
+ ->setPageSize($tvc_filteroptions->getLimit())
119
+ ->setCurPage($tvc_getpage);
120
  $products = $collection->getItems();
121
  $catName = $category->getName();
122
  $catIds = "";
171
  <?php $catIds = "";
172
  $position++;
173
  endif;
174
+ } $currentpage = 1; ?>
175
  exec_tvc_t_hi = true;
176
 
177
 
235
  $catId = $_category_detail->getId();
236
  $catName = $_category_detail->getName();
237
  $category = Mage::getSingleton('catalog/category')->load($catId);
238
+ $collection = $category->getProductCollection()
239
+ ->addAttributeToSelect('*')
240
+ ->addAttributeToSort($tvc_filteroptions->getCurrentOrder(), $tvc_filteroptions->getCurrentDirection())
241
+ ->setPageSize($tvc_filteroptions->getLimit())
242
+ ->setCurPage($tvc_getpage);
243
  $catIds = "";
244
  $position = 1;
245
  $products = $collection->getItems();
286
 
287
  <?php $catIds = "";
288
  $position++;
289
+ $currentpage = 1;
290
  endif;
291
  } ?>
292
  catName = "<?php echo $catName; ?>";
304
  if (strpos($this->getRequest()->getPathInfo(), '/catalogsearch/result/') !== false):
305
 
306
  $_q = addslashes(Mage::app()->getRequest()->getQuery('q'));
307
+
308
  ?>
309
 
310
  var catalogSearch = {};
312
  <?php
313
  $position = 1;
314
 
315
+ $query = Mage::helper("catalogSearch")->getQuery();
316
+ $query->setQueryText($_q);
317
+ $collection = Mage::getResourceModel("catalog/product_collection");
318
+ $collection = $query->getSearchCollection();
319
+ $collection->addSearchFilter($_q);
320
+ $collection->addAttributeToSelect("*")
321
+ ->setOrder($tvc_filteroptions->getCurrentOrder(),$tvc_filteroptions->getCurrentDirection())
322
+ //->addAttributeToSort($tvc_filteroptions->getCurrentOrder(),$tvc_filteroptions->getCurrentDirection())
323
+ ->setPageSize($tvc_filteroptions->getLimit())
324
+ ->setCurPage($tvc_getpage);
 
 
 
325
 
326
  $catIds = "";
327
  ?>
328
 
329
  <?php
330
+ foreach ($collection as $_product) {
331
  ?>
332
 
333
  <?php
345
  $product_sku = $_product->getId();
346
  endif;
347
  ?>
348
+ catalogSearch['<?php echo $_product->getProductUrl(); ?>'] = {
349
+ 'sku': '<?php echo addslashes($product_sku); ?>',
350
  'Name': '<?php echo addslashes($_product->getName()); ?>',
351
  'price': '<?php echo $_product->getFinalPrice(); ?>',
352
  'id': '<?php echo $_product->getId(); ?>',
353
  'categories': '<?php echo addslashes(trim($catIds, ",")); ?>',
354
  'position': '<?php echo $position; ?>',
355
  'brand': '<?php echo addslashes(t_getBrandValue($_product, $brand_code)); ?>',
356
+ 'url2': '<?php echo $_product->getProductUrl(); ?>',
357
  'visibility': '<?php echo $_product->getVisibility(); ?>',
358
  'instock': '<?php echo $inStock; ?>',
359
  'stock': "<?php echo Mage::getSingleton('cataloginventory/stock_item')->loadByProduct($_product->getId())->getQty(); ?>"
364
  <?php $catIds = "";
365
  $position++;
366
  endif;
367
+ } $currentpage = 1; ?>
368
  exec_tvc_t_cs = true;
369
 
370
  <?php endif;
378
  if (isset($_COOKIE['tvc_metadata'])) {
379
 
380
  $tvc_metadata = array(
381
+ 'plugin_version' => '2.0.8',
382
  'current_pkg' => Mage::getDesign()->getPackageName(),
383
  'current_theme' => Mage::getDesign()->getTheme('frontend'),
384
  'Plugin_data' => array('checkout_url' => Mage::getStoreConfig('tatvic_uaee/ecommerce/checkout_url'),
561
  ?>
562
  transactionObject = {};
563
  transactionObject = {
564
+ 'tid': '<?php echo $_order->getIncrementId(); ?>',
565
  'aid': '<?php echo addslashes(Mage::app()->getStore()->getName()) ?>',
566
  'revenue': '<?php echo $_order->getGrandTotal() ?>',
567
  'tax': '<?php echo $_order->getTaxAmount() ?>',
568
  'shipping': '<?php echo $_order->getShippingInclTax() ?>',
569
  'ccode': '<?php echo addslashes($_order->getCouponCode()); ?>'
570
  }
571
+
572
  //exec_tvc_t_thnx = true;
573
 
574
  for (item in orderObject) {
package.xml CHANGED
@@ -1,18 +1,18 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Tatvic_Google_Analytics_Enhanced_Ecommerce</name>
4
- <version>2.0.7</version>
5
  <stability>stable</stability>
6
  <license>Tatvic</license>
7
  <channel>community</channel>
8
  <extends/>
9
- <summary>Compatibility with Magento's Search Functionality</summary>
10
  <description>Integration between Enhanced Ecommerce Feature of Universal Analytics and Magento</description>
11
  <notes>Integration between Enhanced Ecommerce Feature of Universal Analytics and Magento</notes>
12
  <authors><author><name>Khushboo Joshi</name><user>kj_tatvic</user><email>khushboo@tatvic.com</email></author></authors>
13
- <date>2016-05-30</date>
14
- <time>12:29:10</time>
15
- <contents><target name="magecommunity"><dir name="Tatvic"><dir name="Uaee"><dir name="Block"><file name="Uaee.php" hash="63cc48642c9352dd3e1e91d49c45e4cd"/></dir><dir name="Helper"><file name="Data.php" hash="439f09975392babfd79df03e516a5045"/></dir><dir name="Model"><dir name="System"><dir name="Config"><dir name="Source"><file name="Addto.php" hash="7cb95dcf8f2d0a923d344a3bca967ef6"/></dir></dir></dir></dir><dir name="etc"><file name="config.xml" hash="6145676fbeeaa2872300667b2589c819"/><file name="system.xml" hash="e1042977c59c835243e1e017294acdf7"/></dir><dir name="sql"><dir name="tatvic_uaee_setup"><file name="mysql4-install-1.0.0.php" hash="6267ac5101cea1efa4dfeee26ae83a03"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="tatvic_uaee.xml" hash="cd5ab16cf828ecfdb395bb9e4768b177"/></dir><dir name="template"><dir name="tatvic"><dir name="uaee"><file name="uaee.phtml" hash="965f9ffa268ed9d3adad7a45a6f94bd1"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Tatvic_Uaee.xml" hash="cd9f7e6a80b3e83efe0f190cd3f4f997"/></dir></target></contents>
16
  <compatible/>
17
- <dependencies><required><php><min>5.2.0</min><max>7.0.0</max></php></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Tatvic_Google_Analytics_Enhanced_Ecommerce</name>
4
+ <version>2.0.8</version>
5
  <stability>stable</stability>
6
  <license>Tatvic</license>
7
  <channel>community</channel>
8
  <extends/>
9
+ <summary>Minor Bug Fixes &amp; Optimization</summary>
10
  <description>Integration between Enhanced Ecommerce Feature of Universal Analytics and Magento</description>
11
  <notes>Integration between Enhanced Ecommerce Feature of Universal Analytics and Magento</notes>
12
  <authors><author><name>Khushboo Joshi</name><user>kj_tatvic</user><email>khushboo@tatvic.com</email></author></authors>
13
+ <date>2017-04-21</date>
14
+ <time>09:55:51</time>
15
+ <contents><target name="mageetc"><dir name="modules"><file name="Tatvic_Uaee.xml" hash="cd9f7e6a80b3e83efe0f190cd3f4f997"/></dir></target><target name="magecommunity"><dir name="Tatvic"><dir name="Uaee"><dir name="Block"><file name="Uaee.php" hash="63cc48642c9352dd3e1e91d49c45e4cd"/></dir><dir name="Helper"><file name="Data.php" hash="439f09975392babfd79df03e516a5045"/></dir><dir name="Model"><dir name="System"><dir name="Config"><dir name="Source"><file name="Addto.php" hash="7cb95dcf8f2d0a923d344a3bca967ef6"/></dir></dir></dir></dir><dir name="etc"><file name="config.xml" hash="5ec649e66e0b266ecf090270663e15cb"/><file name="system.xml" hash="e1042977c59c835243e1e017294acdf7"/></dir><dir name="sql"><dir name="tatvic_uaee_setup"><file name="mysql4-install-1.0.0.php" hash="6267ac5101cea1efa4dfeee26ae83a03"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="tatvic"><dir name="uaee"><file name="uaee.phtml" hash="8b967cad3dd71e3ed506bbbf994dc733"/></dir></dir></dir><dir name="layout"><file name="tatvic_uaee.xml" hash="cd5ab16cf828ecfdb395bb9e4768b177"/></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
+ <dependencies><required><php><min>5.2.0</min><max>7.0.1</max></php></required></dependencies>
18
  </package>