yireo_googletagmanager - Version 1.3.20

Version Notes

No notes

Download this release

Release Info

Developer Yireo
Extension yireo_googletagmanager
Version 1.3.20
Comparing to
See all releases


Code changes from version 1.3.19 to 1.3.20

app/code/community/Yireo/GoogleTagManager/Block/Category.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * GoogleTagManager plugin for Magento
4
  *
5
  * @package Yireo_GoogleTagManager
6
  * @author Yireo (https://www.yireo.com/)
@@ -42,7 +42,7 @@ class Yireo_GoogleTagManager_Block_Category extends Yireo_GoogleTagManager_Block
42
 
43
  // Fetch the current collection from the block and set pagination
44
  $collection = $productListBlock->getLoadedProductCollection();
45
-
46
  // Set Limit Except for 'all' products
47
  if ($this->getLimit() != 'all') {
48
  $collection->setCurPage($this->getCurrentPage())->setPageSize($this->getLimit());
@@ -58,26 +58,71 @@ class Yireo_GoogleTagManager_Block_Category extends Yireo_GoogleTagManager_Block
58
  */
59
  public function applySorting(Mage_Eav_Model_Entity_Collection_Abstract &$collection)
60
  {
61
- // Hebben we geen `order` in onze request, dan nemen we de standaard sortering.
62
- if (!$order = strtolower(trim($this->request->getParam('order')))) {
63
- $order = $this->catalogConfig->getProductListDefaultSortBy();
64
- }
65
 
66
  if ($order) {
67
- $dir = strtolower(trim($this->request->getParam('dir', 'asc')));
68
  $sortingData = $this->catalogConfig->getAttributesUsedForSortBy();
69
 
70
  if (isset($sortingData[$order]['attribute_code']) and $attributeCode = $sortingData[$order]['attribute_code']) {
71
  $collection->setOrder(
72
- $attributeCode,
73
- $dir == 'asc'
74
- ? Varien_Data_Collection_Db::SORT_ORDER_ASC
75
- : Varien_Data_Collection_Db::SORT_ORDER_DESC
76
  );
77
  }
78
  }
79
  }
80
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
81
  /**
82
  * @param Mage_Catalog_Model_Category $category
83
  */
@@ -110,7 +155,7 @@ class Yireo_GoogleTagManager_Block_Category extends Yireo_GoogleTagManager_Block
110
  */
111
  protected function getCurrentPage()
112
  {
113
- if ($page = (int) $this->getRequest()->getParam('p')) {
114
  return $page;
115
  }
116
 
1
  <?php
2
  /**
3
+ * GoogleTagManager plugin for Magento
4
  *
5
  * @package Yireo_GoogleTagManager
6
  * @author Yireo (https://www.yireo.com/)
42
 
43
  // Fetch the current collection from the block and set pagination
44
  $collection = $productListBlock->getLoadedProductCollection();
45
+
46
  // Set Limit Except for 'all' products
47
  if ($this->getLimit() != 'all') {
48
  $collection->setCurPage($this->getCurrentPage())->setPageSize($this->getLimit());
58
  */
59
  public function applySorting(Mage_Eav_Model_Entity_Collection_Abstract &$collection)
60
  {
61
+ $order = $this->getCurrentOrder();
62
+ $dir = $this->getCurrentPosition();
 
 
63
 
64
  if ($order) {
 
65
  $sortingData = $this->catalogConfig->getAttributesUsedForSortBy();
66
 
67
  if (isset($sortingData[$order]['attribute_code']) and $attributeCode = $sortingData[$order]['attribute_code']) {
68
  $collection->setOrder(
69
+ $attributeCode,
70
+ $dir == 'asc'
71
+ ? Varien_Data_Collection_Db::SORT_ORDER_ASC
72
+ : Varien_Data_Collection_Db::SORT_ORDER_DESC
73
  );
74
  }
75
  }
76
  }
77
 
78
+ /**
79
+ * @return string
80
+ */
81
+ public function getCurrentOrder()
82
+ {
83
+ $order = strtolower(trim($this->request->getParam('order')));
84
+
85
+ if (!empty($order))
86
+ {
87
+ return $order;
88
+ }
89
+
90
+ $order = strtolower(trim(Mage::getSingleton('catalog/session')->getSortOrder()));
91
+
92
+ if (!empty($order))
93
+ {
94
+ return $order;
95
+ }
96
+
97
+ $order = $this->catalogConfig->getProductListDefaultSortBy();
98
+
99
+ return $order;
100
+ }
101
+
102
+ /**
103
+ * @return string
104
+ */
105
+ public function getCurrentPosition()
106
+ {
107
+ $position = strtolower(trim($this->request->getParam('dir')));
108
+
109
+ if (!empty($position))
110
+ {
111
+ return $position;
112
+ }
113
+
114
+ $position = strtolower(trim(Mage::getSingleton('catalog/session')->getSortDirection()));
115
+
116
+ if (!empty($position))
117
+ {
118
+ return $position;
119
+ }
120
+
121
+ $position = 'asc';
122
+
123
+ return $position;
124
+ }
125
+
126
  /**
127
  * @param Mage_Catalog_Model_Category $category
128
  */
155
  */
156
  protected function getCurrentPage()
157
  {
158
+ if ($page = (int)$this->getRequest()->getParam('p')) {
159
  return $page;
160
  }
161
 
app/code/community/Yireo/GoogleTagManager/etc/config.xml CHANGED
@@ -12,7 +12,7 @@
12
  <config>
13
  <modules>
14
  <Yireo_GoogleTagManager>
15
- <version>1.3.19</version>
16
  </Yireo_GoogleTagManager>
17
  </modules>
18
 
12
  <config>
13
  <modules>
14
  <Yireo_GoogleTagManager>
15
+ <version>1.3.20</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.19</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>2016-06-20</date><time>0:22:10</time><compatible></compatible><dependencies><required><php><min>5.4.0</min><max>7.5.0</max></php></required></dependencies><contents><target name="mage"><dir name="app"><dir name="etc"><dir name="modules"><file name="Yireo_GoogleTagManager.xml" hash="c28dd4d6773115b840262bce9a0375c8"/></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="8ed9e3cadaa58ca7e41ad233736a112c"/><file name="custom.phtml" hash="b888cea900aba4a488968ca88a42813d"/><file name="customer.phtml" hash="3db76ba18473a1c7f664c1b50db622a4"/><file name="default.phtml" hash="ad392d0002b73bc5028c4d7704695dda"/><file name="ecommerce.phtml" hash="fcded48968e1b152f828c0b20766a948"/><file name="order.phtml" hash="5dadb37be8798f76651e9bbb55a9bf4a"/><file name="product.phtml" hash="e0b80aa2adf0c6c6c89d38e9ef7638aa"/><file name="product_addtocart.phtml" hash="ead689aa81c78ac9bb182b96a6edbe90"/><file name="product_click.phtml" hash="1946b2edbcd2295cc21031e72293f268"/><file name="product_removefromcart.phtml" hash="f743569a3c3e5aa3bf209b44fe4fcd51"/><file name="quote.phtml" hash="18c5352672c1b6ef704e60f8c3f035f2"/><file name="script.phtml" hash="5ad6b7dcbd3c8073b739e2fe4088dc58"/><file name="search.phtml" hash="ecacabcd592944211d68769dbd7d008d"/></dir></dir><dir name="layout"><file name="googletagmanager.xml" hash="d976e70f22432fe327cdb19a7b34eb21"/></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="6cb4bb0865251f19c664a82a2f4e491e"/><file name="system.xml" hash="41c9ad0454073fde42c763bb6aef9175"/></dir><dir name="Model"><file name="Container.php" hash="2a57c7d0e901274854df57d36d6fea99"/><file name="Observer.php" hash="38f5e11fecfbddd9db9322cc59e02e8f"/><dir name="Backend"><dir name="Source"><file name="Method.php" hash="fddd987814dc7f7f4a880f0accd75cdc"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="97fc97781c7ce667fcd6046f9e802e90"/></dir><dir name="Block"><file name="Category.php" hash="88b29d2d9b26a129c7917c00a4a0e1c0"/><file name="Custom.php" hash="d8fbfada41ae6b0de6722aac4d4eb51b"/><file name="Customer.php" hash="8acd34cb6de2cf52999cb03c61816fd1"/><file name="Default.php" hash="991a681890359d663e3f8eb03f706f82"/><file name="Ecommerce.php" hash="3095463b7d90cd74dfab059c8fd0bb12"/><file name="Order.php" hash="fcfad1050e3250605002d4a983931bed"/><file name="Product.php" hash="26eed61e01ec7c54b7f49fafa71835dd"/><file name="Quote.php" hash="d6b73970c2dcd0d719517feb518614e2"/><file name="Script.php" hash="0b6b405d492ac4fe553b5f5c2fb7d7cd"/><file name="Search.php" hash="0bdadf5b8e992513b3540dbb47ca5f13"/></dir></dir></dir></dir></dir></dir></target></contents></package>
1
  <?xml version="1.0"?>
2
+ <package><name>yireo_googletagmanager</name><version>1.3.20</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>2016-06-21</date><time>3:17:08</time><compatible></compatible><dependencies><required><php><min>5.4.0</min><max>7.5.0</max></php></required></dependencies><contents><target name="mage"><dir name="app"><dir name="etc"><dir name="modules"><file name="Yireo_GoogleTagManager.xml" hash="c28dd4d6773115b840262bce9a0375c8"/></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="8ed9e3cadaa58ca7e41ad233736a112c"/><file name="custom.phtml" hash="b888cea900aba4a488968ca88a42813d"/><file name="customer.phtml" hash="3db76ba18473a1c7f664c1b50db622a4"/><file name="default.phtml" hash="ad392d0002b73bc5028c4d7704695dda"/><file name="ecommerce.phtml" hash="fcded48968e1b152f828c0b20766a948"/><file name="order.phtml" hash="5dadb37be8798f76651e9bbb55a9bf4a"/><file name="product.phtml" hash="e0b80aa2adf0c6c6c89d38e9ef7638aa"/><file name="product_addtocart.phtml" hash="ead689aa81c78ac9bb182b96a6edbe90"/><file name="product_click.phtml" hash="1946b2edbcd2295cc21031e72293f268"/><file name="product_removefromcart.phtml" hash="f743569a3c3e5aa3bf209b44fe4fcd51"/><file name="quote.phtml" hash="18c5352672c1b6ef704e60f8c3f035f2"/><file name="script.phtml" hash="5ad6b7dcbd3c8073b739e2fe4088dc58"/><file name="search.phtml" hash="ecacabcd592944211d68769dbd7d008d"/></dir></dir><dir name="layout"><file name="googletagmanager.xml" hash="d976e70f22432fe327cdb19a7b34eb21"/></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="9cfb978d06098c028531b1333a279173"/><file name="system.xml" hash="41c9ad0454073fde42c763bb6aef9175"/></dir><dir name="Model"><file name="Container.php" hash="2a57c7d0e901274854df57d36d6fea99"/><file name="Observer.php" hash="38f5e11fecfbddd9db9322cc59e02e8f"/><dir name="Backend"><dir name="Source"><file name="Method.php" hash="fddd987814dc7f7f4a880f0accd75cdc"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="97fc97781c7ce667fcd6046f9e802e90"/></dir><dir name="Block"><file name="Category.php" hash="e74ab99cb6bc39d71716483c6bf27ed3"/><file name="Custom.php" hash="d8fbfada41ae6b0de6722aac4d4eb51b"/><file name="Customer.php" hash="8acd34cb6de2cf52999cb03c61816fd1"/><file name="Default.php" hash="991a681890359d663e3f8eb03f706f82"/><file name="Ecommerce.php" hash="3095463b7d90cd74dfab059c8fd0bb12"/><file name="Order.php" hash="fcfad1050e3250605002d4a983931bed"/><file name="Product.php" hash="26eed61e01ec7c54b7f49fafa71835dd"/><file name="Quote.php" hash="d6b73970c2dcd0d719517feb518614e2"/><file name="Script.php" hash="0b6b405d492ac4fe553b5f5c2fb7d7cd"/><file name="Search.php" hash="0bdadf5b8e992513b3540dbb47ca5f13"/></dir></dir></dir></dir></dir></dir></target></contents></package>