Version Notes
No notes
Download this release
Release Info
Developer | Yireo |
Extension | yireo_googletagmanager |
Version | 1.3.7 |
Comparing to | |
See all releases |
Code changes from version 1.3.6 to 1.3.7
- app/code/community/Yireo/GoogleTagManager/Block/Category.php +43 -1
- app/code/community/Yireo/GoogleTagManager/Block/Custom.php +3 -0
- app/code/community/Yireo/GoogleTagManager/Block/Customer.php +3 -0
- app/code/community/Yireo/GoogleTagManager/Block/Default.php +45 -6
- app/code/community/Yireo/GoogleTagManager/Block/Order.php +21 -1
- app/code/community/Yireo/GoogleTagManager/Block/Product.php +3 -0
- app/code/community/Yireo/GoogleTagManager/Block/Quote.php +30 -4
- app/code/community/Yireo/GoogleTagManager/Block/Script.php +8 -0
- app/code/community/Yireo/GoogleTagManager/Helper/Data.php +42 -3
- app/code/community/Yireo/GoogleTagManager/Model/Backend/Source/Method.php +3 -0
- app/code/community/Yireo/GoogleTagManager/Model/Container.php +3 -0
- app/code/community/Yireo/GoogleTagManager/Model/Observer.php +3 -1
- app/code/community/Yireo/GoogleTagManager/etc/config.xml +1 -1
- package.xml +1 -1
app/code/community/Yireo/GoogleTagManager/Block/Category.php
CHANGED
@@ -8,16 +8,58 @@
|
|
8 |
* @license Open Source License (OSL v3)
|
9 |
*/
|
10 |
|
|
|
|
|
|
|
11 |
class Yireo_GoogleTagManager_Block_Category extends Yireo_GoogleTagManager_Block_Default
|
12 |
{
|
|
|
|
|
|
|
13 |
public function getLoadedProductCollection()
|
14 |
{
|
|
|
15 |
$productListBlock = Mage::app()->getLayout()->getBlock('product_list');
|
16 |
|
17 |
if (empty($productListBlock)) {
|
18 |
return null;
|
19 |
}
|
20 |
|
21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
}
|
23 |
}
|
8 |
* @license Open Source License (OSL v3)
|
9 |
*/
|
10 |
|
11 |
+
/**
|
12 |
+
* Class Yireo_GoogleTagManager_Block_Category
|
13 |
+
*/
|
14 |
class Yireo_GoogleTagManager_Block_Category extends Yireo_GoogleTagManager_Block_Default
|
15 |
{
|
16 |
+
/**
|
17 |
+
* @return Mage_Eav_Model_Entity_Collection_Abstract|null
|
18 |
+
*/
|
19 |
public function getLoadedProductCollection()
|
20 |
{
|
21 |
+
/** @var Mage_Catalog_Block_Product_List $productListBlock */
|
22 |
$productListBlock = Mage::app()->getLayout()->getBlock('product_list');
|
23 |
|
24 |
if (empty($productListBlock)) {
|
25 |
return null;
|
26 |
}
|
27 |
|
28 |
+
// Fetch the current collection from the block and set pagination
|
29 |
+
$collection = $productListBlock->getLoadedProductCollection();
|
30 |
+
$collection->setCurPage($this->getCurrentPage())->setPageSize($this->getLimit());
|
31 |
+
|
32 |
+
return $collection;
|
33 |
+
}
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Return the current page limit, as set by the toolbar block
|
37 |
+
*
|
38 |
+
* @return int
|
39 |
+
*/
|
40 |
+
protected function getLimit()
|
41 |
+
{
|
42 |
+
/** @var Mage_Catalog_Block_Product_List_Toolbar $productListBlockToolbar */
|
43 |
+
$productListBlockToolbar = Mage::app()->getLayout()->getBlock('product_list_toolbar');
|
44 |
+
if (empty($productListBlockToolbar)) {
|
45 |
+
return 9;
|
46 |
+
}
|
47 |
+
|
48 |
+
return $productListBlockToolbar->getLimit();
|
49 |
+
}
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Return the current page as set in the URL
|
53 |
+
*
|
54 |
+
* @return int
|
55 |
+
* @throws Exception
|
56 |
+
*/
|
57 |
+
protected function getCurrentPage()
|
58 |
+
{
|
59 |
+
if ($page = (int) $this->getRequest()->getParam('p')) {
|
60 |
+
return $page;
|
61 |
+
}
|
62 |
+
|
63 |
+
return 1;
|
64 |
}
|
65 |
}
|
app/code/community/Yireo/GoogleTagManager/Block/Custom.php
CHANGED
@@ -8,6 +8,9 @@
|
|
8 |
* @license Open Source License (OSL v3)
|
9 |
*/
|
10 |
|
|
|
|
|
|
|
11 |
class Yireo_GoogleTagManager_Block_Custom extends Yireo_GoogleTagManager_Block_Default
|
12 |
{
|
13 |
}
|
8 |
* @license Open Source License (OSL v3)
|
9 |
*/
|
10 |
|
11 |
+
/**
|
12 |
+
* Class Yireo_GoogleTagManager_Block_Custom
|
13 |
+
*/
|
14 |
class Yireo_GoogleTagManager_Block_Custom extends Yireo_GoogleTagManager_Block_Default
|
15 |
{
|
16 |
}
|
app/code/community/Yireo/GoogleTagManager/Block/Customer.php
CHANGED
@@ -8,6 +8,9 @@
|
|
8 |
* @license Open Source License (OSL v3)
|
9 |
*/
|
10 |
|
|
|
|
|
|
|
11 |
class Yireo_GoogleTagManager_Block_Customer extends Yireo_GoogleTagManager_Block_Default
|
12 |
{
|
13 |
}
|
8 |
* @license Open Source License (OSL v3)
|
9 |
*/
|
10 |
|
11 |
+
/**
|
12 |
+
* Class Yireo_GoogleTagManager_Block_Customer
|
13 |
+
*/
|
14 |
class Yireo_GoogleTagManager_Block_Customer extends Yireo_GoogleTagManager_Block_Default
|
15 |
{
|
16 |
}
|
app/code/community/Yireo/GoogleTagManager/Block/Default.php
CHANGED
@@ -8,33 +8,44 @@
|
|
8 |
* @license Open Source License (OSL v3)
|
9 |
*/
|
10 |
|
|
|
|
|
|
|
11 |
class Yireo_GoogleTagManager_Block_Default extends Mage_Core_Block_Template
|
12 |
{
|
13 |
/**
|
|
|
|
|
14 |
* @return bool
|
15 |
*/
|
16 |
public function isEnabled()
|
17 |
{
|
18 |
-
return
|
19 |
}
|
20 |
|
21 |
/**
|
|
|
|
|
22 |
* @return bool
|
23 |
*/
|
24 |
public function isDebug()
|
25 |
{
|
26 |
-
return
|
27 |
}
|
28 |
|
29 |
/**
|
|
|
|
|
30 |
* @return mixed
|
31 |
*/
|
32 |
public function getId()
|
33 |
{
|
34 |
-
return $this->
|
35 |
}
|
36 |
|
37 |
/**
|
|
|
|
|
38 |
* @param null $key
|
39 |
* @param null $default_value
|
40 |
*
|
@@ -42,10 +53,32 @@ class Yireo_GoogleTagManager_Block_Default extends Mage_Core_Block_Template
|
|
42 |
*/
|
43 |
public function getConfig($key = null, $default_value = null)
|
44 |
{
|
45 |
-
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
}
|
47 |
|
48 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
* @return bool
|
50 |
*/
|
51 |
public function hasAttributes()
|
@@ -58,6 +91,8 @@ class Yireo_GoogleTagManager_Block_Default extends Mage_Core_Block_Template
|
|
58 |
}
|
59 |
|
60 |
/**
|
|
|
|
|
61 |
* @return string
|
62 |
*/
|
63 |
public function getAttributesAsJson()
|
@@ -67,6 +102,8 @@ class Yireo_GoogleTagManager_Block_Default extends Mage_Core_Block_Template
|
|
67 |
}
|
68 |
|
69 |
/**
|
|
|
|
|
70 |
* @param $name
|
71 |
* @param $value
|
72 |
*
|
@@ -74,14 +111,16 @@ class Yireo_GoogleTagManager_Block_Default extends Mage_Core_Block_Template
|
|
74 |
*/
|
75 |
public function addAttribute($name, $value)
|
76 |
{
|
77 |
-
return
|
78 |
}
|
79 |
|
80 |
/**
|
|
|
|
|
81 |
* @return mixed
|
82 |
*/
|
83 |
public function getAttributes()
|
84 |
{
|
85 |
-
return
|
86 |
}
|
87 |
}
|
8 |
* @license Open Source License (OSL v3)
|
9 |
*/
|
10 |
|
11 |
+
/**
|
12 |
+
* Class Yireo_GoogleTagManager_Block_Default
|
13 |
+
*/
|
14 |
class Yireo_GoogleTagManager_Block_Default extends Mage_Core_Block_Template
|
15 |
{
|
16 |
/**
|
17 |
+
* Return whether this module is enabled or not
|
18 |
+
*
|
19 |
* @return bool
|
20 |
*/
|
21 |
public function isEnabled()
|
22 |
{
|
23 |
+
return $this->getHelper()->isEnabled();
|
24 |
}
|
25 |
|
26 |
/**
|
27 |
+
* Check whether this module is in debugging mode
|
28 |
+
*
|
29 |
* @return bool
|
30 |
*/
|
31 |
public function isDebug()
|
32 |
{
|
33 |
+
return $this->getHelper()->isDebug();
|
34 |
}
|
35 |
|
36 |
/**
|
37 |
+
* Get the GA ID
|
38 |
+
*
|
39 |
* @return mixed
|
40 |
*/
|
41 |
public function getId()
|
42 |
{
|
43 |
+
return $this->getHelper()->getId();
|
44 |
}
|
45 |
|
46 |
/**
|
47 |
+
* Return a configuration value
|
48 |
+
*
|
49 |
* @param null $key
|
50 |
* @param null $default_value
|
51 |
*
|
53 |
*/
|
54 |
public function getConfig($key = null, $default_value = null)
|
55 |
{
|
56 |
+
return $this->getHelper()->getConfigValue($key, $default_value);
|
57 |
+
}
|
58 |
+
|
59 |
+
/**
|
60 |
+
* Get the GA helper
|
61 |
+
*
|
62 |
+
* @return Yireo_GoogleTagManager_Helper_Data
|
63 |
+
*/
|
64 |
+
public function getHelper()
|
65 |
+
{
|
66 |
+
return Mage::helper('googletagmanager');
|
67 |
}
|
68 |
|
69 |
/**
|
70 |
+
* Get the GA container
|
71 |
+
*
|
72 |
+
* @return Yireo_GoogleTagManager_Model_Container
|
73 |
+
*/
|
74 |
+
public function getContainer()
|
75 |
+
{
|
76 |
+
return Mage::getSingleton('googletagmanager/container');
|
77 |
+
}
|
78 |
+
|
79 |
+
/**
|
80 |
+
* Determine whether this GA configuration has any attributes
|
81 |
+
*
|
82 |
* @return bool
|
83 |
*/
|
84 |
public function hasAttributes()
|
91 |
}
|
92 |
|
93 |
/**
|
94 |
+
* Return all attributes as JSON
|
95 |
+
*
|
96 |
* @return string
|
97 |
*/
|
98 |
public function getAttributesAsJson()
|
102 |
}
|
103 |
|
104 |
/**
|
105 |
+
* Add a new attribute to the GA container
|
106 |
+
*
|
107 |
* @param $name
|
108 |
* @param $value
|
109 |
*
|
111 |
*/
|
112 |
public function addAttribute($name, $value)
|
113 |
{
|
114 |
+
return $this->getContainer()->setData($name, $value);
|
115 |
}
|
116 |
|
117 |
/**
|
118 |
+
* Get the configured attributes for a GA container
|
119 |
+
*
|
120 |
* @return mixed
|
121 |
*/
|
122 |
public function getAttributes()
|
123 |
{
|
124 |
+
return $this->getContainer()->getData();
|
125 |
}
|
126 |
}
|
app/code/community/Yireo/GoogleTagManager/Block/Order.php
CHANGED
@@ -8,21 +8,36 @@
|
|
8 |
* @license Open Source License (OSL v3)
|
9 |
*/
|
10 |
|
|
|
|
|
|
|
11 |
class Yireo_GoogleTagManager_Block_Order extends Yireo_GoogleTagManager_Block_Default
|
12 |
{
|
13 |
/**
|
|
|
|
|
14 |
* @return array
|
15 |
*/
|
16 |
public function getItems()
|
17 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
$data = array();
|
19 |
|
20 |
-
foreach($
|
|
|
|
|
|
|
21 |
// Only add composed types once
|
22 |
if( $item->getParentItemId() ) {
|
23 |
continue;
|
24 |
}
|
25 |
|
|
|
26 |
$product = $item->getProduct();
|
27 |
$data[] = array(
|
28 |
'sku' => $item->getSku(),
|
@@ -36,6 +51,11 @@ class Yireo_GoogleTagManager_Block_Order extends Yireo_GoogleTagManager_Block_De
|
|
36 |
return $data;
|
37 |
}
|
38 |
|
|
|
|
|
|
|
|
|
|
|
39 |
public function getItemsAsJson()
|
40 |
{
|
41 |
$data = $this->getItems();
|
8 |
* @license Open Source License (OSL v3)
|
9 |
*/
|
10 |
|
11 |
+
/**
|
12 |
+
* Class Yireo_GoogleTagManager_Block_Order
|
13 |
+
*/
|
14 |
class Yireo_GoogleTagManager_Block_Order extends Yireo_GoogleTagManager_Block_Default
|
15 |
{
|
16 |
/**
|
17 |
+
* Return all items as array
|
18 |
+
*
|
19 |
* @return array
|
20 |
*/
|
21 |
public function getItems()
|
22 |
{
|
23 |
+
/** @var Mage_Sales_Model_Order $order */
|
24 |
+
$order = $this->getOrder();
|
25 |
+
if (empty($order)) {
|
26 |
+
return array();
|
27 |
+
}
|
28 |
+
|
29 |
$data = array();
|
30 |
|
31 |
+
foreach($order->getAllItems() as $item) {
|
32 |
+
|
33 |
+
/** @var Mage_Sales_Model_Order_Item $item */
|
34 |
+
|
35 |
// Only add composed types once
|
36 |
if( $item->getParentItemId() ) {
|
37 |
continue;
|
38 |
}
|
39 |
|
40 |
+
/** @var Mage_Catalog_Model_Product $product */
|
41 |
$product = $item->getProduct();
|
42 |
$data[] = array(
|
43 |
'sku' => $item->getSku(),
|
51 |
return $data;
|
52 |
}
|
53 |
|
54 |
+
/**
|
55 |
+
* Return all items as JSON
|
56 |
+
*
|
57 |
+
* @return string
|
58 |
+
*/
|
59 |
public function getItemsAsJson()
|
60 |
{
|
61 |
$data = $this->getItems();
|
app/code/community/Yireo/GoogleTagManager/Block/Product.php
CHANGED
@@ -8,6 +8,9 @@
|
|
8 |
* @license Open Source License (OSL v3)
|
9 |
*/
|
10 |
|
|
|
|
|
|
|
11 |
class Yireo_GoogleTagManager_Block_Product extends Yireo_GoogleTagManager_Block_Default
|
12 |
{
|
13 |
}
|
8 |
* @license Open Source License (OSL v3)
|
9 |
*/
|
10 |
|
11 |
+
/**
|
12 |
+
* Class Yireo_GoogleTagManager_Block_Product
|
13 |
+
*/
|
14 |
class Yireo_GoogleTagManager_Block_Product extends Yireo_GoogleTagManager_Block_Default
|
15 |
{
|
16 |
}
|
app/code/community/Yireo/GoogleTagManager/Block/Quote.php
CHANGED
@@ -8,12 +8,27 @@
|
|
8 |
* @license Open Source License (OSL v3)
|
9 |
*/
|
10 |
|
|
|
|
|
|
|
11 |
class Yireo_GoogleTagManager_Block_Quote extends Yireo_GoogleTagManager_Block_Default
|
12 |
{
|
13 |
-
|
14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
$data = array();
|
16 |
-
foreach($
|
|
|
17 |
$data[] = array(
|
18 |
'sku' => $item->getProduct()->getSku(),
|
19 |
'name' => $item->getProduct()->getName(),
|
@@ -21,6 +36,17 @@ class Yireo_GoogleTagManager_Block_Quote extends Yireo_GoogleTagManager_Block_De
|
|
21 |
'quantity' => $item->getQty(),
|
22 |
);
|
23 |
}
|
24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
}
|
26 |
}
|
8 |
* @license Open Source License (OSL v3)
|
9 |
*/
|
10 |
|
11 |
+
/**
|
12 |
+
* Class Yireo_GoogleTagManager_Block_Quote
|
13 |
+
*/
|
14 |
class Yireo_GoogleTagManager_Block_Quote extends Yireo_GoogleTagManager_Block_Default
|
15 |
{
|
16 |
+
/**
|
17 |
+
* Return all quote items as array
|
18 |
+
*
|
19 |
+
* @return string
|
20 |
+
*/
|
21 |
+
public function getItemsAsArray()
|
22 |
+
{
|
23 |
+
/** @var Mage_Sales_Model_Quote $quote */
|
24 |
+
$quote = $this->getQuote();
|
25 |
+
if (empty($quote)) {
|
26 |
+
return array();
|
27 |
+
}
|
28 |
+
|
29 |
$data = array();
|
30 |
+
foreach($quote->getAllItems() as $item) {
|
31 |
+
/** @var Mage_Sales_Model_Quote_Item $item */
|
32 |
$data[] = array(
|
33 |
'sku' => $item->getProduct()->getSku(),
|
34 |
'name' => $item->getProduct()->getName(),
|
36 |
'quantity' => $item->getQty(),
|
37 |
);
|
38 |
}
|
39 |
+
|
40 |
+
return $data;
|
41 |
+
}
|
42 |
+
|
43 |
+
/**
|
44 |
+
* Return all quote items as JSON
|
45 |
+
*
|
46 |
+
* @return string
|
47 |
+
*/
|
48 |
+
public function getItemsAsJson()
|
49 |
+
{
|
50 |
+
return json_encode($this->getItemsAsArray());
|
51 |
}
|
52 |
}
|
app/code/community/Yireo/GoogleTagManager/Block/Script.php
CHANGED
@@ -8,8 +8,16 @@
|
|
8 |
* @license Open Source License (OSL v3)
|
9 |
*/
|
10 |
|
|
|
|
|
|
|
11 |
class Yireo_GoogleTagManager_Block_Script extends Yireo_GoogleTagManager_Block_Default
|
12 |
{
|
|
|
|
|
|
|
|
|
|
|
13 |
public function getScript()
|
14 |
{
|
15 |
return Mage::helper('googletagmanager')->getHeaderScript();
|
8 |
* @license Open Source License (OSL v3)
|
9 |
*/
|
10 |
|
11 |
+
/**
|
12 |
+
* Class Yireo_GoogleTagManager_Block_Script
|
13 |
+
*/
|
14 |
class Yireo_GoogleTagManager_Block_Script extends Yireo_GoogleTagManager_Block_Default
|
15 |
{
|
16 |
+
/**
|
17 |
+
* Return the JavaScript for insertion in the HTML header
|
18 |
+
*
|
19 |
+
* @return string
|
20 |
+
*/
|
21 |
public function getScript()
|
22 |
{
|
23 |
return Mage::helper('googletagmanager')->getHeaderScript();
|
app/code/community/Yireo/GoogleTagManager/Helper/Data.php
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
/**
|
4 |
* GoogleTagManager plugin for Magento
|
5 |
*
|
@@ -8,9 +7,25 @@
|
|
8 |
* @copyright Copyright 2015 Yireo (http://www.yireo.com/)
|
9 |
* @license Open Source License (OSL v3)
|
10 |
*/
|
|
|
|
|
|
|
|
|
11 |
class Yireo_GoogleTagManager_Helper_Data extends Mage_Core_Helper_Abstract
|
12 |
{
|
13 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
* @return bool
|
15 |
*/
|
16 |
public function isEnabled()
|
@@ -23,6 +38,8 @@ class Yireo_GoogleTagManager_Helper_Data extends Mage_Core_Helper_Abstract
|
|
23 |
}
|
24 |
|
25 |
/**
|
|
|
|
|
26 |
* @return bool
|
27 |
*/
|
28 |
public function isDebug()
|
@@ -31,22 +48,38 @@ class Yireo_GoogleTagManager_Helper_Data extends Mage_Core_Helper_Abstract
|
|
31 |
}
|
32 |
|
33 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
* @return bool
|
35 |
*/
|
36 |
public function isMethodObserver()
|
37 |
{
|
38 |
-
return ($this->getConfigValue('method') ==
|
39 |
}
|
40 |
|
41 |
/**
|
|
|
|
|
42 |
* @return bool
|
43 |
*/
|
44 |
public function isMethodLayout()
|
45 |
{
|
46 |
-
return ($this->getConfigValue('method') ==
|
47 |
}
|
48 |
|
49 |
/**
|
|
|
|
|
50 |
* @param $string
|
51 |
* @param null $variable
|
52 |
*
|
@@ -68,6 +101,8 @@ class Yireo_GoogleTagManager_Helper_Data extends Mage_Core_Helper_Abstract
|
|
68 |
}
|
69 |
|
70 |
/**
|
|
|
|
|
71 |
* @param null $key
|
72 |
* @param null $default_value
|
73 |
*
|
@@ -84,6 +119,8 @@ class Yireo_GoogleTagManager_Helper_Data extends Mage_Core_Helper_Abstract
|
|
84 |
}
|
85 |
|
86 |
/**
|
|
|
|
|
87 |
* @param $name
|
88 |
* @param $type
|
89 |
* @param $template
|
@@ -111,7 +148,9 @@ class Yireo_GoogleTagManager_Helper_Data extends Mage_Core_Helper_Abstract
|
|
111 |
}
|
112 |
|
113 |
/**
|
|
|
114 |
*
|
|
|
115 |
*/
|
116 |
public function getHeaderScript()
|
117 |
{
|
1 |
<?php
|
|
|
2 |
/**
|
3 |
* GoogleTagManager plugin for Magento
|
4 |
*
|
7 |
* @copyright Copyright 2015 Yireo (http://www.yireo.com/)
|
8 |
* @license Open Source License (OSL v3)
|
9 |
*/
|
10 |
+
|
11 |
+
/**
|
12 |
+
* Class Yireo_GoogleTagManager_Helper_Data
|
13 |
+
*/
|
14 |
class Yireo_GoogleTagManager_Helper_Data extends Mage_Core_Helper_Abstract
|
15 |
{
|
16 |
/**
|
17 |
+
* Constant for the observer method
|
18 |
+
*/
|
19 |
+
const METHOD_OBSERVER = 0;
|
20 |
+
|
21 |
+
/**
|
22 |
+
* Constant for the layout method
|
23 |
+
*/
|
24 |
+
const METHOD_LAYOUT = 1;
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Check whether the module is enabled
|
28 |
+
*
|
29 |
* @return bool
|
30 |
*/
|
31 |
public function isEnabled()
|
38 |
}
|
39 |
|
40 |
/**
|
41 |
+
* Check whether the module is in debugging mode
|
42 |
+
*
|
43 |
* @return bool
|
44 |
*/
|
45 |
public function isDebug()
|
48 |
}
|
49 |
|
50 |
/**
|
51 |
+
* Return the GA ID
|
52 |
+
*
|
53 |
+
* @return string
|
54 |
+
*/
|
55 |
+
public function getId()
|
56 |
+
{
|
57 |
+
return $this->getConfigValue('id');
|
58 |
+
}
|
59 |
+
|
60 |
+
/**
|
61 |
+
* Check whether the insertion method is the observer method
|
62 |
+
*
|
63 |
* @return bool
|
64 |
*/
|
65 |
public function isMethodObserver()
|
66 |
{
|
67 |
+
return ($this->getConfigValue('method') == self::METHOD_OBSERVER);
|
68 |
}
|
69 |
|
70 |
/**
|
71 |
+
* Check whether the insertion method is the layout method
|
72 |
+
*
|
73 |
* @return bool
|
74 |
*/
|
75 |
public function isMethodLayout()
|
76 |
{
|
77 |
+
return ($this->getConfigValue('method') == self::METHOD_LAYOUT);
|
78 |
}
|
79 |
|
80 |
/**
|
81 |
+
* Debugging method
|
82 |
+
*
|
83 |
* @param $string
|
84 |
* @param null $variable
|
85 |
*
|
101 |
}
|
102 |
|
103 |
/**
|
104 |
+
* Return a configuration value
|
105 |
+
*
|
106 |
* @param null $key
|
107 |
* @param null $default_value
|
108 |
*
|
119 |
}
|
120 |
|
121 |
/**
|
122 |
+
* Fetch a specific block
|
123 |
+
*
|
124 |
* @param $name
|
125 |
* @param $type
|
126 |
* @param $template
|
148 |
}
|
149 |
|
150 |
/**
|
151 |
+
* Return this header script
|
152 |
*
|
153 |
+
* @return string
|
154 |
*/
|
155 |
public function getHeaderScript()
|
156 |
{
|
app/code/community/Yireo/GoogleTagManager/Model/Backend/Source/Method.php
CHANGED
@@ -8,6 +8,9 @@
|
|
8 |
* @license Open Source License (OSL v3)
|
9 |
*/
|
10 |
|
|
|
|
|
|
|
11 |
class Yireo_GoogleTagManager_Model_Backend_Source_Method
|
12 |
{
|
13 |
/**
|
8 |
* @license Open Source License (OSL v3)
|
9 |
*/
|
10 |
|
11 |
+
/**
|
12 |
+
* Class Yireo_GoogleTagManager_Model_Backend_Source_Method
|
13 |
+
*/
|
14 |
class Yireo_GoogleTagManager_Model_Backend_Source_Method
|
15 |
{
|
16 |
/**
|
app/code/community/Yireo/GoogleTagManager/Model/Container.php
CHANGED
@@ -8,6 +8,9 @@
|
|
8 |
* @license Open Source License (OSL v3)
|
9 |
*/
|
10 |
|
|
|
|
|
|
|
11 |
class Yireo_GoogleTagManager_Model_Container extends Mage_Core_Model_Abstract
|
12 |
{
|
13 |
}
|
8 |
* @license Open Source License (OSL v3)
|
9 |
*/
|
10 |
|
11 |
+
/**
|
12 |
+
* Class Yireo_GoogleTagManager_Model_Container
|
13 |
+
*/
|
14 |
class Yireo_GoogleTagManager_Model_Container extends Mage_Core_Model_Abstract
|
15 |
{
|
16 |
}
|
app/code/community/Yireo/GoogleTagManager/Model/Observer.php
CHANGED
@@ -49,7 +49,9 @@ class Yireo_GoogleTagManager_Model_Observer
|
|
49 |
}
|
50 |
|
51 |
/**
|
52 |
-
*
|
|
|
|
|
53 |
*/
|
54 |
protected function getHelper()
|
55 |
{
|
49 |
}
|
50 |
|
51 |
/**
|
52 |
+
* Return the helper class
|
53 |
+
*
|
54 |
+
* @return Yireo_GoogleTagManager_Helper_Data
|
55 |
*/
|
56 |
protected function getHelper()
|
57 |
{
|
app/code/community/Yireo/GoogleTagManager/etc/config.xml
CHANGED
@@ -12,7 +12,7 @@
|
|
12 |
<config>
|
13 |
<modules>
|
14 |
<Yireo_GoogleTagManager>
|
15 |
-
<version>1.3.
|
16 |
</Yireo_GoogleTagManager>
|
17 |
</modules>
|
18 |
|
12 |
<config>
|
13 |
<modules>
|
14 |
<Yireo_GoogleTagManager>
|
15 |
+
<version>1.3.7</version>
|
16 |
</Yireo_GoogleTagManager>
|
17 |
</modules>
|
18 |
|
package.xml
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
-
<package><name>yireo_googletagmanager</name><version>1.3.
|
1 |
<?xml version="1.0"?>
|
2 |
+
<package><name>yireo_googletagmanager</name><version>1.3.7</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>2015-12-04</date><time>6:45:48</time><compatible></compatible><dependencies><required><php><min>5.4.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="420bde8207c2ed151e50ef4b7df1c28f"/></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="727edb90a546c7f22bd216bdd92b6335"/><file name="custom.phtml" hash="2b4ae99a074d314241a1ba7127661c04"/><file name="customer.phtml" hash="a26d3c30a2a909ef7bd8bffe32f65fb2"/><file name="default.phtml" hash="28f3a12df2e7e745bb7b648c946d58c7"/><file name="order.phtml" hash="9d30380ebcb9f815ccea300d811de7d8"/><file name="product.phtml" hash="e0af99cd595af21de5a97911d2d41fa1"/><file name="quote.phtml" hash="3303deca9e3012c8dcfda1e972e36ace"/><file name="script.phtml" hash="18e2d45895b95061ccf04c5af74e25a9"/></dir></dir><dir name="layout"><file name="googletagmanager.xml" hash="4b2e83f2e964891da358c9a64647a043"/></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="9885225ea260248d6993490bd44568da"/><file name="system.xml" hash="1a0483ed2cd30bd1ec806797a8624225"/></dir><dir name="Model"><file name="Container.php" hash="70873159e8eb2254b8f701bc7ccf313e"/><file name="Observer.php" hash="e9055a00cd61dfaea748e42d0ed7457f"/><dir name="Backend"><dir name="Source"><file name="Method.php" hash="8af7a0459aaa78c93bf8c2d11a1bd46c"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="83da9056d4769592d976753c17e39416"/></dir><dir name="Block"><file name="Category.php" hash="77ccce8e9d11b22da3de6a67408e06e8"/><file name="Custom.php" hash="e208f2669b99b54001d90730b1fa5e2f"/><file name="Customer.php" hash="b8c90683ce9860d530c1dfb16e15ecda"/><file name="Default.php" hash="24a1e5c85930ee6e1723307289f22dac"/><file name="Order.php" hash="eaaa92e54a6f98c8c39ee484dff1a7bb"/><file name="Product.php" hash="7427e6ff8ef6efa9acaac933a3e76b4a"/><file name="Quote.php" hash="d4ada2d05f420e396849780ad547c1dd"/><file name="Script.php" hash="efe492a317563bfe87772f678a338088"/></dir></dir></dir></dir></dir></dir></target></contents></package>
|