yireo_googletagmanager - Version 1.3.6

Version Notes

No notes

Download this release

Release Info

Developer Yireo
Extension yireo_googletagmanager
Version 1.3.6
Comparing to
See all releases


Code changes from version 1.3.4 to 1.3.6

app/code/community/Yireo/GoogleTagManager/Helper/Data.php CHANGED
@@ -19,7 +19,7 @@ class Yireo_GoogleTagManager_Helper_Data extends Mage_Core_Helper_Abstract
19
  return false;
20
  }
21
 
22
- return (bool)$this->getConfigValue('enabled');
23
  }
24
 
25
  /**
@@ -76,7 +76,10 @@ class Yireo_GoogleTagManager_Helper_Data extends Mage_Core_Helper_Abstract
76
  public function getConfigValue($key = null, $default_value = null)
77
  {
78
  $value = Mage::getStoreConfig('googletagmanager/settings/' . $key);
79
- if (empty($value)) $value = $default_value;
 
 
 
80
  return $value;
81
  }
82
 
19
  return false;
20
  }
21
 
22
+ return (bool)$this->getConfigValue('active', false);
23
  }
24
 
25
  /**
76
  public function getConfigValue($key = null, $default_value = null)
77
  {
78
  $value = Mage::getStoreConfig('googletagmanager/settings/' . $key);
79
+ if (empty($value)) {
80
+ $value = $default_value;
81
+ }
82
+
83
  return $value;
84
  }
85
 
app/code/community/Yireo/GoogleTagManager/etc/config.xml CHANGED
@@ -12,7 +12,7 @@
12
  <config>
13
  <modules>
14
  <Yireo_GoogleTagManager>
15
- <version>1.3.4</version>
16
  </Yireo_GoogleTagManager>
17
  </modules>
18
 
@@ -77,4 +77,14 @@
77
  </resources>
78
  </acl>
79
  </adminhtml>
 
 
 
 
 
 
 
 
 
 
80
  </config>
12
  <config>
13
  <modules>
14
  <Yireo_GoogleTagManager>
15
+ <version>1.3.6</version>
16
  </Yireo_GoogleTagManager>
17
  </modules>
18
 
77
  </resources>
78
  </acl>
79
  </adminhtml>
80
+
81
+ <default>
82
+ <googletagmanager>
83
+ <settings>
84
+ <active>1</active>
85
+ <method>1</method>
86
+ <category_products>3</category_products>
87
+ </settings>
88
+ </googletagmanager>
89
+ </default>
90
  </config>
app/code/community/Yireo/GoogleTagManager/etc/system.xml CHANGED
@@ -71,6 +71,15 @@
71
  <show_in_website>1</show_in_website>
72
  <show_in_store>1</show_in_store>
73
  </debug>
 
 
 
 
 
 
 
 
 
74
  </fields>
75
  </settings>
76
  </groups>
71
  <show_in_website>1</show_in_website>
72
  <show_in_store>1</show_in_store>
73
  </debug>
74
+ <category_products translate="label">
75
+ <label>Load Products in Category</label>
76
+ <comment><![CDATA[Number of products to load in a specific category overview. 0 to disable]]></comment>
77
+ <frontend_type>text</frontend_type>
78
+ <sort_order>21</sort_order>
79
+ <show_in_default>1</show_in_default>
80
+ <show_in_website>1</show_in_website>
81
+ <show_in_store>1</show_in_store>
82
+ </category_products>
83
  </fields>
84
  </settings>
85
  </groups>
app/design/frontend/base/default/template/googletagmanager/category.phtml CHANGED
@@ -4,11 +4,14 @@
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
- $productCollection = $this->getLoadedProductCollection();
 
 
 
12
  ?>
13
  <?php if($this->isEnabled()) : ?>
14
  <?php $category = $this->getCategory(); ?>
@@ -21,7 +24,7 @@ $productCollection = $this->getLoadedProductCollection();
21
  <?php $categoryProducts = array(); ?>
22
  <?php $i = 0; ?>
23
  <?php foreach($productCollection as $product) : ?>
24
- <?php if ($i > 3) continue; ?>
25
  <?php $categoryProduct = array(); ?>
26
  <?php $categoryProduct['id'] = $product->getId(); ?>
27
  <?php $categoryProduct['name'] = $product->getName(); ?>
@@ -32,4 +35,4 @@ $productCollection = $this->getLoadedProductCollection();
32
  <?php endforeach; ?>
33
  <?php $this->addAttribute('categoryProducts', $categoryProducts); ?>
34
  <?php endif; ?>
35
- <?php endif; ?>
4
  *
5
  * @package Yireo_GoogleTagManager
6
  * @author Yireo (http://www.yireo.com/)
7
+ * @copyright Copyright (c) 2015 Yireo (http://www.yireo.com/)
8
  * @license Open Software License
9
  */
10
 
11
+ $loadProducts = (int) Mage::helper('googletagmanager')->getConfigValue('category_products');
12
+ if ($loadProducts > 0) {
13
+ $productCollection = $this->getLoadedProductCollection();
14
+ }
15
  ?>
16
  <?php if($this->isEnabled()) : ?>
17
  <?php $category = $this->getCategory(); ?>
24
  <?php $categoryProducts = array(); ?>
25
  <?php $i = 0; ?>
26
  <?php foreach($productCollection as $product) : ?>
27
+ <?php if ($i > $loadProducts) break; ?>
28
  <?php $categoryProduct = array(); ?>
29
  <?php $categoryProduct['id'] = $product->getId(); ?>
30
  <?php $categoryProduct['name'] = $product->getName(); ?>
35
  <?php endforeach; ?>
36
  <?php $this->addAttribute('categoryProducts', $categoryProducts); ?>
37
  <?php endif; ?>
38
+ <?php endif; ?>
package.xml CHANGED
@@ -1,2 +1,2 @@
1
  <?xml version="1.0"?>
2
- <package><name>yireo_googletagmanager</name><version>1.3.4</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-11-17</date><time>8:26:33</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="e02dc5d555dd7a5195031d80e5308fc1"/><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="b69a256856a96b80c2eefbf7c4e6db55"/><file name="system.xml" hash="c6d755d52247656fd8e6931503a5840a"/></dir><dir name="Model"><file name="Container.php" hash="782c5f85ca92dc39dff034768d9d7177"/><file name="Observer.php" hash="a1817fb438a919f00589070b8b746d69"/><dir name="Backend"><dir name="Source"><file name="Method.php" hash="d5e60a00a1f85fa658c02e9f895539d3"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="39e6bde767a341f2f9c68e00f3e0fb4e"/></dir><dir name="Block"><file name="Category.php" hash="e1da36db1401d657a19e2c6291d70c38"/><file name="Custom.php" hash="fd1c528409d0186f9ec7de8391d2509c"/><file name="Customer.php" hash="a6f461d0210b141d3d3e0e4cfd80cc3a"/><file name="Default.php" hash="2c078f7152ac294a3d712193624c9fd4"/><file name="Order.php" hash="fe345f9b15b694158a494b055619361c"/><file name="Product.php" hash="02f816ccdb1a0b7a74f001dee0d0018d"/><file name="Quote.php" hash="17580bf20487ceb803421c0ca0575741"/><file name="Script.php" hash="3ddfa74f22197a17f6158b6b40c20abf"/></dir></dir></dir></dir></dir></dir></target></contents></package>
1
  <?xml version="1.0"?>
2
+ <package><name>yireo_googletagmanager</name><version>1.3.6</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-02</date><time>0:01:52</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="95a72456359214457ddfb97d65967cf1"/><file name="system.xml" hash="1a0483ed2cd30bd1ec806797a8624225"/></dir><dir name="Model"><file name="Container.php" hash="782c5f85ca92dc39dff034768d9d7177"/><file name="Observer.php" hash="a1817fb438a919f00589070b8b746d69"/><dir name="Backend"><dir name="Source"><file name="Method.php" hash="d5e60a00a1f85fa658c02e9f895539d3"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="a406b14ed3eea3d057a5d2712e706834"/></dir><dir name="Block"><file name="Category.php" hash="e1da36db1401d657a19e2c6291d70c38"/><file name="Custom.php" hash="fd1c528409d0186f9ec7de8391d2509c"/><file name="Customer.php" hash="a6f461d0210b141d3d3e0e4cfd80cc3a"/><file name="Default.php" hash="2c078f7152ac294a3d712193624c9fd4"/><file name="Order.php" hash="fe345f9b15b694158a494b055619361c"/><file name="Product.php" hash="02f816ccdb1a0b7a74f001dee0d0018d"/><file name="Quote.php" hash="17580bf20487ceb803421c0ca0575741"/><file name="Script.php" hash="3ddfa74f22197a17f6158b6b40c20abf"/></dir></dir></dir></dir></dir></dir></target></contents></package>