alsoviewed - Version 1.2.0

Version Notes

* Better third-party themes compatibility
* Added new perfomance setting: **chunk_size**. (It can be used when
mysql 'max_allowed_packet' size is too small and you need to decrease
query size, or it can be increased to decrease queries count during cronjob)

Download this release

Release Info

Developer Vova Yatsyuk
Extension alsoviewed
Version 1.2.0
Comparing to
See all releases


Code changes from version 1.1.0 to 1.2.0

app/code/community/Yavva/Alsoviewed/Model/Observer.php CHANGED
@@ -41,7 +41,11 @@ class Yavva_Alsoviewed_Model_Observer
41
  $data = $log->getGroupedRelations();
42
  if ($data) {
43
  try {
44
- Mage::getResourceModel('alsoviewed/relation')->updateRelations($data);
 
 
 
 
45
  $log->clean();
46
  } catch (Zend_Db_Exception $e) {
47
  Mage::logException($e);
41
  $data = $log->getGroupedRelations();
42
  if ($data) {
43
  try {
44
+ $size = Mage::getStoreConfig('alsoviewed/perfomance/chunk_size');
45
+ $model = Mage::getResourceModel('alsoviewed/relation');
46
+ foreach (array_chunk($data, $size) as $_data) {
47
+ $model->updateRelations($_data);
48
+ }
49
  $log->clean();
50
  } catch (Zend_Db_Exception $e) {
51
  Mage::logException($e);
app/code/community/Yavva/Alsoviewed/controllers/Adminhtml/Alsoviewed/LogController.php CHANGED
@@ -26,10 +26,14 @@ class Yavva_Alsoviewed_Adminhtml_Alsoviewed_LogController extends Mage_Adminhtml
26
  $data = $log->getGroupedRelations();
27
  if ($data) {
28
  try {
29
- $result = Mage::getResourceModel('alsoviewed/relation')->updateRelations($data);
 
 
 
 
30
  $log->clean();
31
  $this->_getSession()->addSuccess(
32
- Mage::helper('adminhtml')->__('Total of %d record(s) have been updated.', $result)
33
  );
34
  } catch (Exception $e) {
35
  $this->_getSession()->addError($e->getMessage());
26
  $data = $log->getGroupedRelations();
27
  if ($data) {
28
  try {
29
+ $size = Mage::getStoreConfig('alsoviewed/perfomance/chunk_size');
30
+ $model = Mage::getResourceModel('alsoviewed/relation');
31
+ foreach (array_chunk($data, $size) as $_data) {
32
+ $model->updateRelations($_data);
33
+ }
34
  $log->clean();
35
  $this->_getSession()->addSuccess(
36
+ Mage::helper('adminhtml')->__('Total of %d record(s) have been updated.', count($data))
37
  );
38
  } catch (Exception $e) {
39
  $this->_getSession()->addError($e->getMessage());
app/code/community/Yavva/Alsoviewed/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Yavva_Alsoviewed>
5
- <version>1.1.0</version>
6
  </Yavva_Alsoviewed>
7
  </modules>
8
 
@@ -145,6 +145,9 @@
145
  <image_width>170</image_width>
146
  <image_height>170</image_height>
147
  </right>
 
 
 
148
  </alsoviewed>
149
  </default>
150
  </config>
2
  <config>
3
  <modules>
4
  <Yavva_Alsoviewed>
5
+ <version>1.2.0</version>
6
  </Yavva_Alsoviewed>
7
  </modules>
8
 
145
  <image_width>170</image_width>
146
  <image_height>170</image_height>
147
  </right>
148
+ <perfomance>
149
+ <chunk_size>500</chunk_size>
150
+ </perfomance>
151
  </alsoviewed>
152
  </default>
153
  </config>
app/code/community/Yavva/Alsoviewed/etc/system.xml CHANGED
@@ -226,6 +226,24 @@
226
  </image_height>
227
  </fields>
228
  </right>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
229
  </groups>
230
  </alsoviewed>
231
  </sections>
226
  </image_height>
227
  </fields>
228
  </right>
229
+ <perfomance>
230
+ <label>Perfomance</label>
231
+ <sort_order>40</sort_order>
232
+ <show_in_default>1</show_in_default>
233
+ <show_in_website>0</show_in_website>
234
+ <show_in_store>0</show_in_store>
235
+ <fields>
236
+ <chunk_size translate="label comment">
237
+ <label>Relations count to process per one query</label>
238
+ <comment>You may need to decrease this value, if you found the "Got a packet bigger than 'max_allowed_packet' bytes" error in log</comment>
239
+ <frontend_type>text</frontend_type>
240
+ <sort_order>10</sort_order>
241
+ <show_in_default>1</show_in_default>
242
+ <show_in_website>1</show_in_website>
243
+ <show_in_store>1</show_in_store>
244
+ </chunk_size>
245
+ </fields>
246
+ </perfomance>
247
  </groups>
248
  </alsoviewed>
249
  </sections>
app/locale/en_US/Yavva_Alsoviewed.csv CHANGED
@@ -30,3 +30,6 @@
30
  "Also Viewed Recommendations","Also Viewed Recommendations"
31
  "Build Recommendations on","Build Recommendations on"
32
  "Current Product","Current Product"
 
 
 
30
  "Also Viewed Recommendations","Also Viewed Recommendations"
31
  "Build Recommendations on","Build Recommendations on"
32
  "Current Product","Current Product"
33
+ "Perfomance","Perfomance"
34
+ "Relations count to process per one query","Relations count to process per one query"
35
+ "You may need to decrease this value, if you found the ""Got a packet bigger than 'max_allowed_packet' bytes"" error in log","You may need to decrease this value, if you found the ""Got a packet bigger than 'max_allowed_packet' bytes"" error in log"
package.xml CHANGED
@@ -1,14 +1,12 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>alsoviewed</name>
4
- <version>1.1.0</version>
5
  <stability>stable</stability>
6
  <license>GPL</license>
7
  <channel>community</channel>
8
  <extends/>
9
- <summary>Magento module that displays products, viewed by visitors, who viewed this&#xD;
10
- product. It can also show recommendations based on viewed, compared and shopping&#xD;
11
- cart products.</summary>
12
  <description>Magento module that displays products, viewed by visitors, who viewed this&#xD;
13
  product. It can also show recommendations based on viewed, compared and shopping&#xD;
14
  cart products (see [widget](#widget) section).&#xD;
@@ -52,16 +50,14 @@ Widget provides ability to recommend products by additional activities:&#xD;
52
  &#xD;
53
  &gt; Module functionality relies on cron. Make sure you configure it properly.&#xD;
54
  </description>
55
- <notes>- **Added Widget with new ability to recommend products by additional activities:**&#xD;
56
- - Recently Viewed Products&#xD;
57
- - Recently Compared Products&#xD;
58
- - Shopping Cart products&#xD;
59
- - Added ability to change block title from widget/block configuration.&#xD;
60
- </notes>
61
  <authors><author><name>Vova Yatsyuk</name><user>VovaYatsyuk</user><email>vova.yatsyuk@gmail.com</email></author></authors>
62
- <date>2015-03-15</date>
63
- <time>19:43:49</time>
64
- <contents><target name="magecommunity"><dir name="Yavva"><dir name="Alsoviewed"><dir name="Block"><dir name="Adminhtml"><dir name="Log"><file name="Grid.php" hash="6661435fdb8e525775adf990a90d11c4"/></dir><file name="Log.php" hash="cb3cca5ff29b80044e7943d376dc5993"/><dir name="Relations"><dir name="Edit"><file name="Form.php" hash="0ad20532cb04c4c850fe1398598e6588"/></dir><file name="Edit.php" hash="1afce837cf4bd29beb1cc8f38d4065b6"/><file name="Grid.php" hash="e10da78030dbfb1ecbb32f6df82ddfa1"/></dir><file name="Relations.php" hash="6561a0acaacc1bc8e5046be59da888b6"/></dir><file name="Products.php" hash="68240b69f626dd3c6283d1144d18e214"/><dir name="Widget"><file name="Products.php" hash="4fad1d2e4c32ed756c3b5fc988edd5a2"/></dir></dir><dir name="Helper"><file name="Data.php" hash="d8057e1e4731c53a6b1e72a626ce9ac3"/></dir><dir name="Model"><file name="Basis.php" hash="ff0ba6ceadd3b99d5ac4825ae109a6b0"/><file name="Observer.php" hash="05ad4c1cbc6fe8cf8863836a34d97951"/><file name="Relation.php" hash="506d2fa53e2e342030bdfb976a2f0e00"/><dir name="Resource"><dir name="Collection"><file name="Abstract.php" hash="6d996d6b7643f1b3cc3c0db3d5440011"/></dir><dir name="Log"><file name="Collection.php" hash="790509f4a4e74cc007adae600c0d8a1b"/></dir><file name="Log.php" hash="d79d4a97ba3303dfa3e042ec34c2e0e3"/><dir name="Relation"><file name="Collection.php" hash="be05b1351c8703f1157b6f552612ffa8"/></dir><file name="Relation.php" hash="c154166a4318331e47b755749965a045"/></dir><file name="Session.php" hash="9ba3b43dec9458cc13cb6c6e7efbef05"/><dir name="System"><dir name="Config"><dir name="Source"><file name="ListMode.php" hash="d3480dc016dc0ff9e2e23ab210cf9756"/></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Alsoviewed"><file name="LogController.php" hash="99f28be50bbf022986c8da75a092d267"/><file name="RelationsController.php" hash="de5a35329a09477a79ec65c57a4280ca"/></dir></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="ff26af98f8e1eef8d902eca84da6d3aa"/><file name="config.xml" hash="ce8efb1cfadae1c700e0f6069a913c6a"/><file name="system.xml" hash="ddee983575f2922514fdbb45d8a31eb7"/><file name="widget.xml" hash="7d8c523d78cc46b203f440cc9be9a356"/></dir><dir name="sql"><dir name="yavva_alsoviewed_setup"><file name="install-1.0.0.php" hash="8ed81d46895731990b7c2066bfcc353d"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="base"><dir name="default"><dir name="layout"><dir name="yavva"><file name="alsoviewed.xml" hash="53473beb4db371b273400ae8fa223a32"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="yavva"><file name="alsoviewed.xml" hash="bbd75b6b9b5639c7a54a77216e3afeb5"/></dir></dir><dir name="template"><dir name="yavva"><dir name="alsoviewed"><file name="products.phtml" hash="d55af4e92a7fbe929c10b81a804ddffe"/><dir name="wrapper"><file name="block.phtml" hash="ec9cb02d52f4ea8756a24438d26def64"/><file name="collateral.phtml" hash="0354a4c8f3466edc2d3bb5fb0a0b75f7"/></dir></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Yavva_Alsoviewed.xml" hash="4eedb69f4c1fc39a1e4170694a19c3f8"/></dir></target><target name="magelocale"><dir><dir name="en_US"><file name="Yavva_Alsoviewed.csv" hash="e9c01655510a4083a97c27f06f18812d"/></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="yavva"><dir name="alsoviewed"><dir name="css"><file name="alsoviewed.css" hash="d31aebd6e1a30e3620669f1013519336"/></dir><file name=".DS_Store" hash="47b2bb12e2c4c4275ce2349d6b4570d0"/></dir></dir></dir></dir></dir></target></contents>
65
  <compatible/>
66
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
67
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>alsoviewed</name>
4
+ <version>1.2.0</version>
5
  <stability>stable</stability>
6
  <license>GPL</license>
7
  <channel>community</channel>
8
  <extends/>
9
+ <summary>Magento module that displays products, viewed by visitors, who viewed this product. It can also show recommendations based on viewed, compared and shopping cart products.</summary>
 
 
10
  <description>Magento module that displays products, viewed by visitors, who viewed this&#xD;
11
  product. It can also show recommendations based on viewed, compared and shopping&#xD;
12
  cart products (see [widget](#widget) section).&#xD;
50
  &#xD;
51
  &gt; Module functionality relies on cron. Make sure you configure it properly.&#xD;
52
  </description>
53
+ <notes>* Better third-party themes compatibility&#xD;
54
+ * Added new perfomance setting: **chunk_size**. (It can be used when &#xD;
55
+ mysql 'max_allowed_packet' size is too small and you need to decrease &#xD;
56
+ query size, or it can be increased to decrease queries count during cronjob)</notes>
 
 
57
  <authors><author><name>Vova Yatsyuk</name><user>VovaYatsyuk</user><email>vova.yatsyuk@gmail.com</email></author></authors>
58
+ <date>2015-04-08</date>
59
+ <time>18:36:26</time>
60
+ <contents><target name="magecommunity"><dir name="Yavva"><dir name="Alsoviewed"><dir name="Block"><dir name="Adminhtml"><dir name="Log"><file name="Grid.php" hash="6661435fdb8e525775adf990a90d11c4"/></dir><file name="Log.php" hash="cb3cca5ff29b80044e7943d376dc5993"/><dir name="Relations"><dir name="Edit"><file name="Form.php" hash="0ad20532cb04c4c850fe1398598e6588"/></dir><file name="Edit.php" hash="1afce837cf4bd29beb1cc8f38d4065b6"/><file name="Grid.php" hash="e10da78030dbfb1ecbb32f6df82ddfa1"/></dir><file name="Relations.php" hash="6561a0acaacc1bc8e5046be59da888b6"/></dir><file name="Products.php" hash="68240b69f626dd3c6283d1144d18e214"/><dir name="Widget"><file name="Products.php" hash="4fad1d2e4c32ed756c3b5fc988edd5a2"/></dir></dir><dir name="Helper"><file name="Data.php" hash="d8057e1e4731c53a6b1e72a626ce9ac3"/></dir><dir name="Model"><file name="Basis.php" hash="ff0ba6ceadd3b99d5ac4825ae109a6b0"/><file name="Observer.php" hash="c01e1caf0df63b73e59cb2035a0585a1"/><file name="Relation.php" hash="506d2fa53e2e342030bdfb976a2f0e00"/><dir name="Resource"><dir name="Collection"><file name="Abstract.php" hash="6d996d6b7643f1b3cc3c0db3d5440011"/></dir><dir name="Log"><file name="Collection.php" hash="790509f4a4e74cc007adae600c0d8a1b"/></dir><file name="Log.php" hash="d79d4a97ba3303dfa3e042ec34c2e0e3"/><dir name="Relation"><file name="Collection.php" hash="be05b1351c8703f1157b6f552612ffa8"/></dir><file name="Relation.php" hash="c154166a4318331e47b755749965a045"/></dir><file name="Session.php" hash="9ba3b43dec9458cc13cb6c6e7efbef05"/><dir name="System"><dir name="Config"><dir name="Source"><file name="ListMode.php" hash="d3480dc016dc0ff9e2e23ab210cf9756"/></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Alsoviewed"><file name="LogController.php" hash="2f585270cff1904618f8dea31133b6e0"/><file name="RelationsController.php" hash="de5a35329a09477a79ec65c57a4280ca"/></dir></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="ff26af98f8e1eef8d902eca84da6d3aa"/><file name="config.xml" hash="0ef35056d358da48ba5e62b16a714843"/><file name="system.xml" hash="9dc125f86fef4e939ccbc631f5285ccb"/><file name="widget.xml" hash="7d8c523d78cc46b203f440cc9be9a356"/></dir><dir name="sql"><dir name="yavva_alsoviewed_setup"><file name="install-1.0.0.php" hash="8ed81d46895731990b7c2066bfcc353d"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="base"><dir name="default"><dir name="layout"><dir name="yavva"><file name="alsoviewed.xml" hash="53473beb4db371b273400ae8fa223a32"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="yavva"><file name="alsoviewed.xml" hash="bbd75b6b9b5639c7a54a77216e3afeb5"/></dir></dir><dir name="template"><dir name="yavva"><dir name="alsoviewed"><file name="products.phtml" hash="d55af4e92a7fbe929c10b81a804ddffe"/><dir name="wrapper"><file name="block.phtml" hash="ec9cb02d52f4ea8756a24438d26def64"/><file name="collateral.phtml" hash="0354a4c8f3466edc2d3bb5fb0a0b75f7"/></dir></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Yavva_Alsoviewed.xml" hash="4eedb69f4c1fc39a1e4170694a19c3f8"/></dir></target><target name="magelocale"><dir><dir name="en_US"><file name="Yavva_Alsoviewed.csv" hash="59c50c66ff06abb0ef30ca182b7517fa"/></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="yavva"><dir name="alsoviewed"><dir name="css"><file name="alsoviewed.css" hash="2eea21636a6bf099f2387c4f992b4c31"/></dir><file name=".DS_Store" hash="47b2bb12e2c4c4275ce2349d6b4570d0"/></dir></dir></dir></dir></dir></target></contents>
61
  <compatible/>
62
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
63
  </package>
skin/frontend/base/default/yavva/alsoviewed/css/alsoviewed.css CHANGED
@@ -17,6 +17,7 @@
17
  margin: 0 1% 7px;
18
  clear: none;
19
  box-sizing: border-box;
 
20
  }
21
  .alsoviewed .products-grid.cols-1 li.item { width: 100%; }
22
  .alsoviewed .products-grid.cols-2 li.item { width: 48%; }
17
  margin: 0 1% 7px;
18
  clear: none;
19
  box-sizing: border-box;
20
+ float: left;
21
  }
22
  .alsoviewed .products-grid.cols-1 li.item { width: 100%; }
23
  .alsoviewed .products-grid.cols-2 li.item { width: 48%; }