yireo_googletagmanager - Version 1.2.0

Version Notes

No notes

Download this release

Release Info

Developer Yireo
Extension yireo_googletagmanager
Version 1.2.0
Comparing to
See all releases


Code changes from version 1.1.1 to 1.2.0

app/code/community/Yireo/GoogleTagManager/Block/Category.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * GoogleTagManager plugin for Magento
4
+ *
5
+ * @package Yireo_GoogleTagManager
6
+ * @author Yireo (http://www.yireo.com/)
7
+ * @copyright Copyright (C) 2014 Yireo (http://www.yireo.com/)
8
+ * @license Open Source License (OSL v3)
9
+ */
10
+
11
+ class Yireo_GoogleTagManager_Block_Category extends Yireo_GoogleTagManager_Block_Default
12
+ {
13
+ }
app/code/community/Yireo/GoogleTagManager/Block/Custom.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * GoogleTagManager plugin for Magento
4
+ *
5
+ * @package Yireo_GoogleTagManager
6
+ * @author Yireo (http://www.yireo.com/)
7
+ * @copyright Copyright (C) 2014 Yireo (http://www.yireo.com/)
8
+ * @license Open Source License (OSL v3)
9
+ */
10
+
11
+ class Yireo_GoogleTagManager_Block_Custom extends Yireo_GoogleTagManager_Block_Default
12
+ {
13
+ }
app/code/community/Yireo/GoogleTagManager/Block/Default.php CHANGED
@@ -5,7 +5,7 @@
5
  * @package Yireo_GoogleTagManager
6
  * @author Yireo (http://www.yireo.com/)
7
  * @copyright Copyright (C) 2014 Yireo (http://www.yireo.com/)
8
- * @license Open Source License
9
  */
10
 
11
  class Yireo_GoogleTagManager_Block_Default extends Mage_Core_Block_Template
@@ -24,4 +24,29 @@ class Yireo_GoogleTagManager_Block_Default extends Mage_Core_Block_Template
24
  {
25
  return Mage::helper('googletagmanager')->getConfigValue($key, $default_value);
26
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
  }
5
  * @package Yireo_GoogleTagManager
6
  * @author Yireo (http://www.yireo.com/)
7
  * @copyright Copyright (C) 2014 Yireo (http://www.yireo.com/)
8
+ * @license Open Source License (OSL v3)
9
  */
10
 
11
  class Yireo_GoogleTagManager_Block_Default extends Mage_Core_Block_Template
24
  {
25
  return Mage::helper('googletagmanager')->getConfigValue($key, $default_value);
26
  }
27
+
28
+ public function hasAttributes()
29
+ {
30
+ $attributes = $this->getAttributes();
31
+ if(!empty($attributes)) {
32
+ return true;
33
+ }
34
+ return false;
35
+ }
36
+
37
+ public function getAttributesAsJson()
38
+ {
39
+ $attributes = $this->getAttributes();
40
+ return json_encode($attributes);
41
+ }
42
+
43
+ public function setAttribute($name, $value)
44
+ {
45
+ Mage::getSingleton('googletagmanager/container')->setData($name, $value);
46
+ }
47
+
48
+ public function getAttributes()
49
+ {
50
+ return Mage::getSingleton('googletagmanager/container')->getData();
51
+ }
52
  }
app/code/community/Yireo/GoogleTagManager/Block/Order.php CHANGED
@@ -5,7 +5,7 @@
5
  * @package Yireo_GoogleTagManager
6
  * @author Yireo (http://www.yireo.com/)
7
  * @copyright Copyright (C) 2014 Yireo (http://www.yireo.com/)
8
- * @license Open Source License
9
  */
10
 
11
  class Yireo_GoogleTagManager_Block_Order extends Yireo_GoogleTagManager_Block_Default
5
  * @package Yireo_GoogleTagManager
6
  * @author Yireo (http://www.yireo.com/)
7
  * @copyright Copyright (C) 2014 Yireo (http://www.yireo.com/)
8
+ * @license Open Source License (OSL v3)
9
  */
10
 
11
  class Yireo_GoogleTagManager_Block_Order extends Yireo_GoogleTagManager_Block_Default
app/code/community/Yireo/GoogleTagManager/Block/Product.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * GoogleTagManager plugin for Magento
4
+ *
5
+ * @package Yireo_GoogleTagManager
6
+ * @author Yireo (http://www.yireo.com/)
7
+ * @copyright Copyright (C) 2014 Yireo (http://www.yireo.com/)
8
+ * @license Open Source License (OSL v3)
9
+ */
10
+
11
+ class Yireo_GoogleTagManager_Block_Product extends Yireo_GoogleTagManager_Block_Default
12
+ {
13
+ }
app/code/community/Yireo/GoogleTagManager/Block/Quote.php CHANGED
@@ -5,7 +5,7 @@
5
  * @package Yireo_GoogleTagManager
6
  * @author Yireo (http://www.yireo.com/)
7
  * @copyright Copyright (C) 2014 Yireo (http://www.yireo.com/)
8
- * @license Open Source License
9
  */
10
 
11
  class Yireo_GoogleTagManager_Block_Quote extends Yireo_GoogleTagManager_Block_Default
5
  * @package Yireo_GoogleTagManager
6
  * @author Yireo (http://www.yireo.com/)
7
  * @copyright Copyright (C) 2014 Yireo (http://www.yireo.com/)
8
+ * @license Open Source License (OSL v3)
9
  */
10
 
11
  class Yireo_GoogleTagManager_Block_Quote extends Yireo_GoogleTagManager_Block_Default
app/code/community/Yireo/GoogleTagManager/Block/Script.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * GoogleTagManager plugin for Magento
4
+ *
5
+ * @package Yireo_GoogleTagManager
6
+ * @author Yireo (http://www.yireo.com/)
7
+ * @copyright Copyright (C) 2014 Yireo (http://www.yireo.com/)
8
+ * @license Open Source License (OSL v3)
9
+ */
10
+
11
+ class Yireo_GoogleTagManager_Block_Script extends Mage_Core_Block_Abstract
12
+ {
13
+ public function toHtml()
14
+ {
15
+ return Mage::helper('googletagmanager')->getHeaderScript();
16
+ }
17
+ }
app/code/community/Yireo/GoogleTagManager/Helper/Data.php CHANGED
@@ -5,7 +5,7 @@
5
  * @package Yireo_GoogleTagManager
6
  * @author Yireo (http://www.yireo.com/)
7
  * @copyright Copyright (C) 2014 Yireo (http://www.yireo.com/)
8
- * @license Open Source License
9
  */
10
 
11
  class Yireo_GoogleTagManager_Helper_Data extends Mage_Core_Helper_Abstract
@@ -25,16 +25,36 @@ class Yireo_GoogleTagManager_Helper_Data extends Mage_Core_Helper_Abstract
25
  */
26
  public function getHeaderScript()
27
  {
28
- $html = '';
29
 
30
  // Check for the frontend layout
31
  if (!($layout = Mage::app()->getFrontController()->getAction()->getLayout())) {
32
- return $html;
33
  }
34
 
35
  // Check for the Google Tag Manager block
36
  if (!($block = $layout->getBlock('googletagmanager'))) {
37
- return $html;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
  }
39
 
40
  // Add order-information
@@ -42,20 +62,31 @@ class Yireo_GoogleTagManager_Helper_Data extends Mage_Core_Helper_Abstract
42
  if(!empty($lastOrderId)) {
43
  $order = Mage::getModel('sales/order')->loadByIncrementId($lastOrderId);
44
  $orderBlock = $layout->getBlock('googletagmanager_order');
45
- $orderBlock->setQuote($order);
46
- $html .= $orderBlock->toHtml();
 
 
47
 
48
  // Add quote-information
49
  } else {
50
  $quote = Mage::getModel('checkout/cart')->getQuote();
51
  if($quote->getId() > 0) {
52
  $quoteBlock = $layout->getBlock('googletagmanager_quote');
53
- $quoteBlock->setQuote($quote);
54
- $html .= $quoteBlock->toHtml();
 
 
55
  }
56
  }
57
 
58
- $html .= $block->toHtml();
 
 
 
 
 
 
 
59
  return $html;
60
  }
61
  }
5
  * @package Yireo_GoogleTagManager
6
  * @author Yireo (http://www.yireo.com/)
7
  * @copyright Copyright (C) 2014 Yireo (http://www.yireo.com/)
8
+ * @license Open Source License (OSL v3)
9
  */
10
 
11
  class Yireo_GoogleTagManager_Helper_Data extends Mage_Core_Helper_Abstract
25
  */
26
  public function getHeaderScript()
27
  {
28
+ $childScript = '';
29
 
30
  // Check for the frontend layout
31
  if (!($layout = Mage::app()->getFrontController()->getAction()->getLayout())) {
32
+ return $childScript;
33
  }
34
 
35
  // Check for the Google Tag Manager block
36
  if (!($block = $layout->getBlock('googletagmanager'))) {
37
+ return $childScript;
38
+ }
39
+
40
+ // Add product-information
41
+ $currentProduct = Mage::registry('current_product');
42
+ if(!empty($currentProduct)) {
43
+ $productBlock = $layout->getBlock('googletagmanager_product');
44
+ if($productBlock) {
45
+ $productBlock->setProduct($currentProduct);
46
+ $childScript .= $productBlock->toHtml();
47
+ }
48
+ }
49
+
50
+ // Add category-information
51
+ $currentCategory = Mage::registry('current_category');
52
+ if(!empty($currentCategory)) {
53
+ $categoryBlock = $layout->getBlock('googletagmanager_category');
54
+ if($categoryBlock) {
55
+ $categoryBlock->setCategory($currentCategory);
56
+ $childScript .= $categoryBlock->toHtml();
57
+ }
58
  }
59
 
60
  // Add order-information
62
  if(!empty($lastOrderId)) {
63
  $order = Mage::getModel('sales/order')->loadByIncrementId($lastOrderId);
64
  $orderBlock = $layout->getBlock('googletagmanager_order');
65
+ if($orderBlock) {
66
+ $orderBlock->setOrder($order);
67
+ $childScript .= $orderBlock->toHtml();
68
+ }
69
 
70
  // Add quote-information
71
  } else {
72
  $quote = Mage::getModel('checkout/cart')->getQuote();
73
  if($quote->getId() > 0) {
74
  $quoteBlock = $layout->getBlock('googletagmanager_quote');
75
+ if($quoteBlock) {
76
+ $quoteBlock->setQuote($quote);
77
+ $childScript .= $quoteBlock->toHtml();
78
+ }
79
  }
80
  }
81
 
82
+ // Add custom information
83
+ $customBlock = $layout->getBlock('googletagmanager_custom');
84
+ if($customBlock) {
85
+ $childScript .= $customBlock->toHtml();
86
+ }
87
+
88
+ $block->setChildScript($childScript);
89
+ $html = $block->toHtml();
90
  return $html;
91
  }
92
  }
app/code/community/Yireo/GoogleTagManager/Model/Container.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * GoogleTagManager plugin for Magento
4
+ *
5
+ * @package Yireo_GoogleTagManager
6
+ * @author Yireo (http://www.yireo.com/)
7
+ * @copyright Copyright (C) 2014 Yireo (http://www.yireo.com/)
8
+ * @license Open Source License (OSL v3)
9
+ */
10
+
11
+ class Yireo_GoogleTagManager_Model_Container extends Mage_Core_Model_Abstract
12
+ {
13
+ }
app/code/community/Yireo/GoogleTagManager/Model/Observer.php CHANGED
@@ -5,7 +5,7 @@
5
  * @package Yireo_GoogleTagManager
6
  * @author Yireo (http://www.yireo.com/)
7
  * @copyright Copyright (C) 2014 Yireo (http://www.yireo.com/)
8
- * @license Open Source License
9
  */
10
 
11
  class Yireo_GoogleTagManager_Model_Observer
5
  * @package Yireo_GoogleTagManager
6
  * @author Yireo (http://www.yireo.com/)
7
  * @copyright Copyright (C) 2014 Yireo (http://www.yireo.com/)
8
+ * @license Open Source License (OSL v3)
9
  */
10
 
11
  class Yireo_GoogleTagManager_Model_Observer
app/code/community/Yireo/GoogleTagManager/etc/config.xml CHANGED
@@ -6,13 +6,13 @@
6
  * @package Yireo_GoogleTagManager
7
  * @author Yireo
8
  * @copyright Copyright (C) 2014 Yireo (http://www.yireo.com/)
9
- * @license Open Software License
10
  */
11
  -->
12
  <config>
13
  <modules>
14
  <Yireo_GoogleTagManager>
15
- <version>1.1.1</version>
16
  </Yireo_GoogleTagManager>
17
  </modules>
18
 
6
  * @package Yireo_GoogleTagManager
7
  * @author Yireo
8
  * @copyright Copyright (C) 2014 Yireo (http://www.yireo.com/)
9
+ * @license Open Source License (OSL v3)
10
  */
11
  -->
12
  <config>
13
  <modules>
14
  <Yireo_GoogleTagManager>
15
+ <version>1.2.0</version>
16
  </Yireo_GoogleTagManager>
17
  </modules>
18
 
app/code/community/Yireo/GoogleTagManager/etc/system.xml CHANGED
@@ -7,14 +7,14 @@
7
  * @package Yireo_GoogleTagManager
8
  * @author Yireo
9
  * @copyright Copyright (C) 2014 Yireo (http://www.yireo.com/)
10
- * @license Open Software License
11
  */
12
  -->
13
  <config>
14
  <sections>
15
  <googletagmanager translate="label" module="googletagmanager">
16
  <label>Google Tag Manager</label>
17
- <tab>service</tab>
18
  <frontend_type>text</frontend_type>
19
  <sort_order>342</sort_order>
20
  <show_in_default>1</show_in_default>
7
  * @package Yireo_GoogleTagManager
8
  * @author Yireo
9
  * @copyright Copyright (C) 2014 Yireo (http://www.yireo.com/)
10
+ * @license Open Source License (OSL v3)
11
  */
12
  -->
13
  <config>
14
  <sections>
15
  <googletagmanager translate="label" module="googletagmanager">
16
  <label>Google Tag Manager</label>
17
+ <tab>yireo</tab>
18
  <frontend_type>text</frontend_type>
19
  <sort_order>342</sort_order>
20
  <show_in_default>1</show_in_default>
app/design/frontend/base/default/layout/googletagmanager.xml CHANGED
@@ -5,14 +5,23 @@
5
  *
6
  * @package Yireo_GoogleTagManager
7
  * @author Yireo (http://www.yireo.com/)
8
- * @copyright Copyright (c) 2012 Yireo (http://www.yireo.com/)
9
  * @license Open Source License (OSL)
10
  */
11
  -->
12
  <layout>
13
  <default>
14
- <block type="googletagmanager/default" name="googletagmanager" template="googletagmanager/default.phtml" />
15
  <block type="googletagmanager/order" name="googletagmanager_order" template="googletagmanager/order.phtml" />
16
  <block type="googletagmanager/quote" name="googletagmanager_quote" template="googletagmanager/quote.phtml" />
 
 
 
 
 
 
 
 
 
 
17
  </default>
18
  </layout>
5
  *
6
  * @package Yireo_GoogleTagManager
7
  * @author Yireo (http://www.yireo.com/)
8
+ * @copyright Copyright (c) 2014 Yireo (http://www.yireo.com/)
9
  * @license Open Source License (OSL)
10
  */
11
  -->
12
  <layout>
13
  <default>
 
14
  <block type="googletagmanager/order" name="googletagmanager_order" template="googletagmanager/order.phtml" />
15
  <block type="googletagmanager/quote" name="googletagmanager_quote" template="googletagmanager/quote.phtml" />
16
+ <block type="googletagmanager/product" name="googletagmanager_product" template="googletagmanager/product.phtml" />
17
+ <block type="googletagmanager/category" name="googletagmanager_category" template="googletagmanager/category.phtml" />
18
+ <block type="googletagmanager/custom" name="googletagmanager_custom" template="googletagmanager/custom.phtml" />
19
+ <block type="googletagmanager/default" name="googletagmanager" template="googletagmanager/default.phtml" />
20
+
21
+ <!--
22
+ <reference name="after_body_start">
23
+ <block type="googletagmanager/script" name="googletagmanager" />
24
+ </reference>
25
+ -->
26
  </default>
27
  </layout>
app/design/frontend/base/default/template/googletagmanager/category.phtml ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * GoogleTagManager plugin for Magento
4
+ *
5
+ * @package Yireo_GoogleTagManager
6
+ * @author Yireo (http://www.yireo.com/)
7
+ * @copyright Copyright (c) 2014 Yireo (http://www.yireo.com/)
8
+ * @license Open Software License
9
+ */
10
+ ?>
11
+ <?php if($this->isEnabled()) : ?>
12
+ <?php $category = $this->getCategory(); ?>
13
+ <?php if(!empty($category) && $category->getId() > 0) : ?>
14
+ <?php $this->setAttribute('categoryId', $category->getId()); ?>
15
+ <?php $this->setAttribute('categoryName', $category->getName()); ?>
16
+ <?php endif; ?>
17
+ <?php endif; ?>
app/design/frontend/base/default/template/googletagmanager/custom.phtml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * GoogleTagManager plugin for Magento
4
+ *
5
+ * @package Yireo_GoogleTagManager
6
+ * @author Yireo (http://www.yireo.com/)
7
+ * @copyright Copyright (c) 2014 Yireo (http://www.yireo.com/)
8
+ * @license Open Software License
9
+ */
10
+ ?>
11
+ <?php if($this->isEnabled()) : ?>
12
+ <?php endif; ?>
app/design/frontend/base/default/template/googletagmanager/default.phtml CHANGED
@@ -9,5 +9,14 @@
9
  */
10
  ?>
11
  <?php if($this->isEnabled()) : ?>
 
 
 
 
 
 
 
 
 
12
  <noscript><iframe src="//www.googletagmanager.com/ns.html?id=<?php echo $this->getId(); ?>" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript><script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','<?php echo $this->getId(); ?>');</script>
13
  <?php endif; ?>
9
  */
10
  ?>
11
  <?php if($this->isEnabled()) : ?>
12
+ <?php $childScript = $this->getChildScript(); ?>
13
+ <?php if(!empty($childScript)) : ?>
14
+ <script>
15
+ <?php if($this->hasAttributes()) : ?>
16
+ dataLayer = [<?php echo $this->getAttributesAsJson(); ?>];
17
+ <?php endif; ?>
18
+ <?php echo $childScript; ?>
19
+ </script>
20
+ <?php endif; ?>
21
  <noscript><iframe src="//www.googletagmanager.com/ns.html?id=<?php echo $this->getId(); ?>" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript><script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','<?php echo $this->getId(); ?>');</script>
22
  <?php endif; ?>
app/design/frontend/base/default/template/googletagmanager/order.phtml CHANGED
@@ -9,17 +9,13 @@
9
  */
10
  ?>
11
  <?php if($this->isEnabled()) : ?>
12
- <script>
13
  <?php $order = $this->getOrder(); ?>
14
  <?php if(!empty($order) && $order->getId() > 0) : ?>
15
- dataLayer = [{
16
- 'transactionId': '<?php echo $order->getIncrementId(); ?>',
17
- 'transactionAffiliation': '<?php echo Mage::app()->getWebsite()->getName(); ?>',
18
- 'transactionTotal': <?php echo $order->getGrandTotal(); ?>,
19
- 'transactionTax': <?php echo $order->getGrandTotal() - $order->getSubtotal(); ?>,
20
- 'transactionShipping': <?php echo $order->getShippingAmount(); ?>,
21
- 'transactionProducts': <?php echo $this->getItemsAsJson(); ?>
22
- }];
23
  <?php endif; ?>
24
- </script>
25
  <?php endif; ?>
9
  */
10
  ?>
11
  <?php if($this->isEnabled()) : ?>
 
12
  <?php $order = $this->getOrder(); ?>
13
  <?php if(!empty($order) && $order->getId() > 0) : ?>
14
+ <?php $this->setAttribute('transactionId', $order->getIncrementId()); ?>
15
+ <?php $this->setAttribute('transactionAffiliation', Mage::app()->getWebsite()->getName()); ?>
16
+ <?php $this->setAttribute('transactionTotal', $order->getGrandTotal()); ?>
17
+ <?php $this->setAttribute('transactionTax', $order->getGrandTotal() - $order->getSubtotal()); ?>
18
+ <?php $this->setAttribute('transactionShipping', $order->getShippingAmount()); ?>
19
+ <?php $this->setAttribute('transactionProducts', $this->getItemsAsJson()); ?>
 
 
20
  <?php endif; ?>
 
21
  <?php endif; ?>
app/design/frontend/base/default/template/googletagmanager/product.phtml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * GoogleTagManager plugin for Magento
4
+ *
5
+ * @package Yireo_GoogleTagManager
6
+ * @author Yireo (http://www.yireo.com/)
7
+ * @copyright Copyright (c) 2014 Yireo (http://www.yireo.com/)
8
+ * @license Open Software License
9
+ */
10
+ ?>
11
+ <?php if($this->isEnabled()) : ?>
12
+ <?php $product = $this->getProduct(); ?>
13
+ <?php if(!empty($product) && $product->getId() > 0) : ?>
14
+ <?php $this->setAttribute('productId', $product->getId()); ?>
15
+ <?php $this->setAttribute('productName', $product->getName()); ?>
16
+ <?php $this->setAttribute('productSku', $product->getSku()); ?>
17
+ <?php endif; ?>
18
+ <?php endif; ?>
app/design/frontend/base/default/template/googletagmanager/quote.phtml CHANGED
@@ -9,16 +9,12 @@
9
  */
10
  ?>
11
  <?php if($this->isEnabled()) : ?>
12
- <script>
13
  <?php $quote = $this->getQuote(); ?>
14
  <?php if(!empty($quote) && $quote->getId() > 0) : ?>
15
- dataLayer = [{
16
- 'transactionId': '<?php echo $quote->getId(); ?>',
17
- 'transactionAffiliation': '<?php echo Mage::app()->getWebsite()->getName(); ?>',
18
- 'transactionTotal': <?php echo $quote->getGrandTotal(); ?>,
19
- 'transactionTax': <?php echo $quote->getGrandTotal() - $quote->getSubtotal(); ?>,
20
- 'transactionProducts': <?php echo $this->getItemsAsJson(); ?>
21
- }];
22
  <?php endif; ?>
23
- </script>
24
  <?php endif; ?>
9
  */
10
  ?>
11
  <?php if($this->isEnabled()) : ?>
 
12
  <?php $quote = $this->getQuote(); ?>
13
  <?php if(!empty($quote) && $quote->getId() > 0) : ?>
14
+ <?php $this->setAttribute('transactionId', $quote->getId()); ?>
15
+ <?php $this->setAttribute('transactionAffiliation', Mage::app()->getWebsite()->getName()); ?>
16
+ <?php $this->setAttribute('transactionTotal', $quote->getGrandTotal()); ?>
17
+ <?php $this->setAttribute('transactionTax', $quote->getGrandTotal() - $quote->getSubtotal()); ?>
18
+ <?php $this->setAttribute('transactionProducts', $this->getItemsAsJson()); ?>
 
 
19
  <?php endif; ?>
 
20
  <?php endif; ?>
package.xml CHANGED
@@ -1,2 +1,2 @@
1
  <?xml version="1.0"?>
2
- <package><name>yireo_googletagmanager</name><version>1.1.1</version><stability>stable</stability><license>Open Source License</license><channel>community</channel><extends></extends><summary>No summary</summary><description>No description</description><notes>No notes</notes><authors><author><name>Yireo</name><user>yireo</user><email>info@yireo.com</email></author></authors><date>2014-02-20</date><time>23:16:38</time><compatible></compatible><dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies><contents><target name="mage"><dir name="app"><dir name="etc"><dir name="modules"><file name="Yireo_GoogleTagManager.xml" hash="90f31b076dbc2f5c293c1b61147743ab"/></dir></dir><dir name="code"><dir name="community"><dir name="Yireo"><dir name="GoogleTagManager"><dir name="Block"><file name="Default.php" hash="e714367b7520c63c483f9f2a01ec54e6"/><file name="Order.php" hash="fe2b3e92572278c60b4123c05bd1ddb5"/><file name="Quote.php" hash="32d1071a8d3696a755cb9c2e6d20ed9e"/></dir><dir name="etc"><file name="config.xml" hash="eb98dd1a387e1e0d96a529b7c4dd4a7a"/><file name="system.xml" hash="fc7295c6a7f44f3e4e7336ac5b8ee446"/></dir><dir name="Helper"><file name="Data.php" hash="3f4f9548d7235daffb0d8fa2c7eff71b"/></dir><dir name="Model"><file name="Observer.php" hash="e382a808ed44288f41964145ee683ea1"/></dir></dir></dir></dir></dir><dir name="design"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="googletagmanager"><file name="default.phtml" hash="ae2ad18abddfd2537e6dcb812d29ce80"/><file name="order.phtml" hash="2abb3ccb8472991f921884b4ac3b8532"/><file name="quote.phtml" hash="acbb63704263f71b0a73cbef89cfa4d8"/></dir></dir><dir name="layout"><file name="googletagmanager.xml" hash="074c43895018fb372b6fda747066aa32"/></dir></dir></dir></dir></dir></dir></target></contents></package>
1
  <?xml version="1.0"?>
2
+ <package><name>yireo_googletagmanager</name><version>1.2.0</version><stability>stable</stability><license>Open Source License</license><channel>community</channel><extends></extends><summary>No summary</summary><description>No description</description><notes>No notes</notes><authors><author><name>Yireo</name><user>yireo</user><email>info@yireo.com</email></author></authors><date>2014-12-05</date><time>2:08:49</time><compatible></compatible><dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies><contents><target name="mage"><dir name="app"><dir name="etc"><dir name="modules"><file name="Yireo_GoogleTagManager.xml" hash="90f31b076dbc2f5c293c1b61147743ab"/></dir></dir><dir name="design"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="googletagmanager"><file name="category.phtml" hash="f7ee56063c1c9a55efbef399fd9eef14"/><file name="custom.phtml" hash="2b4ae99a074d314241a1ba7127661c04"/><file name="default.phtml" hash="471f6c6ccf72490adfde5aabe3ed72cc"/><file name="order.phtml" hash="7b2bb2e17cb2bfe969dfcaab617939eb"/><file name="product.phtml" hash="05d781df115908853880ff6b428db662"/><file name="quote.phtml" hash="22f4ddc024af5b9ca4cf6ce0f2078b16"/></dir></dir><dir name="layout"><file name="googletagmanager.xml" hash="39c33332f6dcb06f071404de47e92916"/></dir></dir></dir></dir></dir><dir name="code"><dir name="community"><dir name="Yireo"><dir name="GoogleTagManager"><dir name="etc"><file name="config.xml" hash="b5b498e57a14dd6202e2b834dae531a9"/><file name="system.xml" hash="4c5a88fbefbd5520002a89650b3a1b1c"/></dir><dir name="Model"><file name="Container.php" hash="7c32435338aeffedf502f9feeec625d3"/><file name="Observer.php" hash="62e60763d8d1c137065559cfb32bf4f8"/></dir><dir name="Helper"><file name="Data.php" hash="9dad07bf3707312866d173960fc2da9e"/></dir><dir name="Block"><file name="Category.php" hash="921b14604f8647c40847b01f14976ff0"/><file name="Custom.php" hash="20ac881a1e52a65c85bdfa31d15b1e35"/><file name="Default.php" hash="f94c1bc57e2f469b635c2d437b2e4281"/><file name="Order.php" hash="2f3911e31a9bd3bc2117efae13f821f5"/><file name="Product.php" hash="718f68a35ee7ae9126b6d271cf82edb7"/><file name="Quote.php" hash="eb71d7981c9403a468b0eba694e537b1"/><file name="Script.php" hash="70bf97540663c7b5c070159ad0659a2d"/></dir></dir></dir></dir></dir></dir></target></contents></package>