alsoviewed - Version 1.1.0

Version Notes

- **Added Widget with new ability to recommend products by additional activities:**
- Recently Viewed Products
- Recently Compared Products
- Shopping Cart products
- Added ability to change block title from widget/block configuration.

Download this release

Release Info

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


Code changes from version 1.0.0 to 1.1.0

app/code/community/Yavva/Alsoviewed/Block/Products.php CHANGED
@@ -5,6 +5,7 @@ class Yavva_Alsoviewed_Block_Products extends Mage_Catalog_Block_Product_Abstrac
5
  const DEFAULT_PRODUCTS_COUNT = 4;
6
  const DEFAULT_IMAGE_WIDTH = 170;
7
  const DEFAULT_IMAGE_HEIGHT = 170;
 
8
 
9
  /**
10
  * @var Mage_Catalog_Model_Resource_Product_Collection $_productCollection
@@ -29,6 +30,7 @@ class Yavva_Alsoviewed_Block_Products extends Mage_Catalog_Block_Product_Abstrac
29
  ->setPageSize($this->getProductsCount())
30
  ->setCurPage(1);
31
 
 
32
  $collection
33
  ->joinTable(
34
  array('alsoviewed' => 'alsoviewed/relation'),
@@ -38,7 +40,7 @@ class Yavva_Alsoviewed_Block_Products extends Mage_Catalog_Block_Product_Abstrac
38
  'alsoviewed_position' => 'position',
39
  ),
40
  array(
41
- 'product_id' => $this->getProductId(),
42
  'status' => 1
43
  ),
44
  'inner'
@@ -46,6 +48,12 @@ class Yavva_Alsoviewed_Block_Products extends Mage_Catalog_Block_Product_Abstrac
46
  ->addAttributeToSort('alsoviewed_position', 'ASC')
47
  ->addAttributeToSort('alsoviewed_weight', 'DESC');
48
 
 
 
 
 
 
 
49
  $this->_productCollection = $collection;
50
  }
51
 
@@ -53,20 +61,45 @@ class Yavva_Alsoviewed_Block_Products extends Mage_Catalog_Block_Product_Abstrac
53
  }
54
 
55
  /**
56
- * Retrieve product id
57
  *
58
- * @return integer
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
59
  */
60
- public function getProductId()
61
  {
62
- $id = $this->_getData('product_id');
63
- if (null === $id) {
64
- $product = Mage::registry('current_product');
65
- if ($product) {
66
- $id = $product->getId();
 
67
  }
 
68
  }
69
- return $id;
 
 
 
 
 
 
 
70
  }
71
 
72
  /**
5
  const DEFAULT_PRODUCTS_COUNT = 4;
6
  const DEFAULT_IMAGE_WIDTH = 170;
7
  const DEFAULT_IMAGE_HEIGHT = 170;
8
+ const DEFAULT_BASIS_LIMIT = 10;
9
 
10
  /**
11
  * @var Mage_Catalog_Model_Resource_Product_Collection $_productCollection
30
  ->setPageSize($this->getProductsCount())
31
  ->setCurPage(1);
32
 
33
+ $productIds = $this->_getBasisProductIds();
34
  $collection
35
  ->joinTable(
36
  array('alsoviewed' => 'alsoviewed/relation'),
40
  'alsoviewed_position' => 'position',
41
  ),
42
  array(
43
+ 'product_id' => array('in' => $productIds),
44
  'status' => 1
45
  ),
46
  'inner'
48
  ->addAttributeToSort('alsoviewed_position', 'ASC')
49
  ->addAttributeToSort('alsoviewed_weight', 'DESC');
50
 
51
+ if (count($productIds) > 1) {
52
+ $collection->addAttributeToFilter('entity_id', array('nin' => $productIds));
53
+ // prevent "Item with the same id already exist" error
54
+ $collection->getSelect()->group('entity_id');
55
+ }
56
+
57
  $this->_productCollection = $collection;
58
  }
59
 
61
  }
62
 
63
  /**
64
+ * Retrieve basis product ids to suggest alternative products.
65
  *
66
+ * @return array
67
+ */
68
+ protected function _getBasisProductIds()
69
+ {
70
+ $ids = $this->_getData('product_id');
71
+ if (null === $ids) {
72
+ $ids = $this->_getBasisModel()->getProductIds();
73
+ } elseif (!is_array($ids)) {
74
+ $ids = explode(',', $ids);
75
+ }
76
+ return $ids;
77
+ }
78
+
79
+ /**
80
+ * Retrieve basis model to get product ids that the customer was interested in.
81
+ *
82
+ * @return Yavva_Alsoviewed_Model_Basis
83
  */
84
+ protected function _getBasisModel()
85
  {
86
+ $model = Mage::getSingleton('alsoviewed/basis');
87
+
88
+ $mode = $this->_getData('basis_mode');
89
+ if (null !== $mode) {
90
+ if (!is_array($mode)) {
91
+ $mode = explode(',', $mode);
92
  }
93
+ $model->setMode($mode);
94
  }
95
+
96
+ $limit = $this->_getData('basis_limit');
97
+ if (null === $limit) {
98
+ $limit = self::DEFAULT_BASIS_LIMIT;
99
+ }
100
+ $model->setLimit($limit);
101
+
102
+ return $model;
103
  }
104
 
105
  /**
app/code/community/Yavva/Alsoviewed/Block/Widget/Products.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Yavva_Alsoviewed_Block_Widget_Products extends Mage_Core_Block_Abstract
4
+ implements Mage_Widget_Block_Interface
5
+ {
6
+ protected function _beforeToHtml()
7
+ {
8
+ $list = $this->getLayout()->createBlock('alsoviewed/products')
9
+ ->setTemplate('yavva/alsoviewed/products.phtml');
10
+
11
+ if ($template = $this->_getData('template')) {
12
+ $list->setTemplate($template);
13
+ }
14
+
15
+ $data = $this->getData();
16
+ unset($data['type']);
17
+ unset($data['module_name']);
18
+ $list->addData($data);
19
+
20
+ if (!$this->getIsWrapperDisabled()) {
21
+ $this->mainBlock = $this->getLayout()->createBlock('core/template')
22
+ ->setTemplate('yavva/alsoviewed/wrapper/block.phtml');
23
+
24
+ if ($template = $this->_getData('wrapper_template')) {
25
+ $this->mainBlock->setTemplate($template);
26
+ }
27
+
28
+ $this->mainBlock->setChild('alsoviewed.list', $list);
29
+ } else {
30
+ $this->mainBlock = $list;
31
+ }
32
+ }
33
+
34
+ protected function _toHtml()
35
+ {
36
+ return $this->mainBlock->toHtml();
37
+ }
38
+ }
app/code/community/Yavva/Alsoviewed/Model/Basis.php ADDED
@@ -0,0 +1,135 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Yavva_Alsoviewed_Model_Basis extends Varien_Object
4
+ {
5
+ const MODE_CURRENT_PRODUCT = 'current';
6
+ const MODE_RECENTLY_VIEWED = 'viewed';
7
+ const MODE_RECENTLY_COMPARED = 'compared';
8
+ const MODE_SHOPPING_CART = 'cart';
9
+
10
+ /**
11
+ * Retreive mode to use to recieve product ids basis
12
+ *
13
+ * @return array
14
+ */
15
+ public function getMode()
16
+ {
17
+ $mode = $this->_getData('mode');
18
+ if (null === $mode || !is_array($mode)) {
19
+ return $mode ? array($mode) : array(self::MODE_CURRENT_PRODUCT);
20
+ }
21
+ return $mode;
22
+ }
23
+
24
+ /**
25
+ * Retrieve product ids that where recently viewed, compared, added to cart, etc.
26
+ *
27
+ * @return mixed array|null
28
+ */
29
+ public function getProductIds()
30
+ {
31
+ $ids = array();
32
+ foreach ($this->getMode() as $mode) {
33
+ $method = 'get' . ucfirst($mode) . 'Ids';
34
+ if (!method_exists($this, $method)) {
35
+ continue;
36
+ }
37
+ // @TODO make mode much more flexibe (create logic rules):
38
+ // current|compared|viewed,cart - use current|if none was found - use compared|and so on...
39
+ // compared:cart|cart|viewed - items from cart that where compared recently|cart (if none was found)| viewed (if none was found)
40
+ // compared,cart|viewed - items from cart and compared items|viewed if none was found
41
+
42
+ // @TODO collect ids by groups and then slice each group proportionally
43
+ $ids = array_merge($ids, $this->{$method}());
44
+ }
45
+ $ids = array_unique($ids);
46
+
47
+ if (!count($ids)) {
48
+ return null;
49
+ }
50
+
51
+ if (($limit = $this->getLimit()) && (count($ids) > $limit)) {
52
+ $ids = array_slice($ids, -$limit);
53
+ }
54
+ return $ids;
55
+ }
56
+
57
+ /**
58
+ * Retrieve currently viewed product id
59
+ *
60
+ * @return array
61
+ */
62
+ public function getCurrentIds()
63
+ {
64
+ $product = Mage::registry('current_product');
65
+ if ($product) {
66
+ return array($product->getId());
67
+ }
68
+
69
+ // FPC compatibility
70
+ $request = Mage::app()->getRequest();
71
+ $fullActionName = implode('_', array(
72
+ $request->getModuleName(),
73
+ $request->getControllerName(),
74
+ $request->getActionName()
75
+ ));
76
+ if ('catalog_product_view' === $fullActionName) {
77
+ return array($request->getParam('id'));
78
+ }
79
+
80
+ // third party modules
81
+ if ($id = $request->getParam('product_id')) {
82
+ return array($id);
83
+ }
84
+
85
+ return array();
86
+ }
87
+
88
+ /**
89
+ * Retrieve recently compared product ids
90
+ *
91
+ * @return array
92
+ */
93
+ public function getComparedIds()
94
+ {
95
+ $collection = Mage::getModel('reports/product_index_compared')->getCollection()
96
+ ->addPriceData()
97
+ ->addIndexFilter()
98
+ ->setAddedAtOrder()
99
+ ->setPageSize(5);
100
+
101
+ Mage::getSingleton('catalog/product_visibility')
102
+ ->addVisibleInSiteFilterToCollection($collection);
103
+
104
+ return $collection->getColumnValues('entity_id');
105
+ }
106
+
107
+ /**
108
+ * Retrieve recently viewed product ids
109
+ *
110
+ * @return array
111
+ */
112
+ public function getViewedIds()
113
+ {
114
+ $collection = Mage::getModel('reports/product_index_viewed')->getCollection()
115
+ ->addPriceData()
116
+ ->addIndexFilter()
117
+ ->setAddedAtOrder()
118
+ ->setPageSize(5);
119
+
120
+ Mage::getSingleton('catalog/product_visibility')
121
+ ->addVisibleInSiteFilterToCollection($collection);
122
+
123
+ return $collection->getColumnValues('entity_id');
124
+ }
125
+
126
+ /**
127
+ * Retrieve product ids from shopping cart
128
+ *
129
+ * @return array
130
+ */
131
+ public function getCartIds()
132
+ {
133
+ return Mage::getSingleton('checkout/cart')->getProductIds();
134
+ }
135
+ }
app/code/community/Yavva/Alsoviewed/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Yavva_Alsoviewed>
5
- <version>1.0.0</version>
6
  </Yavva_Alsoviewed>
7
  </modules>
8
 
@@ -120,6 +120,7 @@
120
  <alsoviewed>
121
  <content>
122
  <enabled>0</enabled>
 
123
  <mode>grid</mode>
124
  <products_count>4</products_count>
125
  <column_count>4</column_count>
@@ -128,6 +129,7 @@
128
  </content>
129
  <left>
130
  <enabled>0</enabled>
 
131
  <mode>list</mode>
132
  <products_count>4</products_count>
133
  <column_count>3</column_count>
@@ -136,6 +138,7 @@
136
  </left>
137
  <right>
138
  <enabled>0</enabled>
 
139
  <mode>list</mode>
140
  <products_count>4</products_count>
141
  <column_count>3</column_count>
2
  <config>
3
  <modules>
4
  <Yavva_Alsoviewed>
5
+ <version>1.1.0</version>
6
  </Yavva_Alsoviewed>
7
  </modules>
8
 
120
  <alsoviewed>
121
  <content>
122
  <enabled>0</enabled>
123
+ <title>People who viewed this product also viewed</title>
124
  <mode>grid</mode>
125
  <products_count>4</products_count>
126
  <column_count>4</column_count>
129
  </content>
130
  <left>
131
  <enabled>0</enabled>
132
+ <title>You may also like</title>
133
  <mode>list</mode>
134
  <products_count>4</products_count>
135
  <column_count>3</column_count>
138
  </left>
139
  <right>
140
  <enabled>0</enabled>
141
+ <title>You may also like</title>
142
  <mode>list</mode>
143
  <products_count>4</products_count>
144
  <column_count>3</column_count>
app/code/community/Yavva/Alsoviewed/etc/system.xml CHANGED
@@ -26,6 +26,14 @@
26
  <show_in_website>1</show_in_website>
27
  <show_in_store>1</show_in_store>
28
  </enabled>
 
 
 
 
 
 
 
 
29
  <mode translate="label" module="catalog">
30
  <label>List Mode</label>
31
  <frontend_type>select</frontend_type>
@@ -90,6 +98,14 @@
90
  <show_in_website>1</show_in_website>
91
  <show_in_store>1</show_in_store>
92
  </enabled>
 
 
 
 
 
 
 
 
93
  <mode translate="label" module="catalog">
94
  <label>List Mode</label>
95
  <frontend_type>select</frontend_type>
@@ -154,6 +170,14 @@
154
  <show_in_website>1</show_in_website>
155
  <show_in_store>1</show_in_store>
156
  </enabled>
 
 
 
 
 
 
 
 
157
  <mode translate="label" module="catalog">
158
  <label>List Mode</label>
159
  <frontend_type>select</frontend_type>
26
  <show_in_website>1</show_in_website>
27
  <show_in_store>1</show_in_store>
28
  </enabled>
29
+ <title translate="label" module="catalog">
30
+ <label>Title</label>
31
+ <frontend_type>text</frontend_type>
32
+ <sort_order>15</sort_order>
33
+ <show_in_default>1</show_in_default>
34
+ <show_in_website>1</show_in_website>
35
+ <show_in_store>1</show_in_store>
36
+ </title>
37
  <mode translate="label" module="catalog">
38
  <label>List Mode</label>
39
  <frontend_type>select</frontend_type>
98
  <show_in_website>1</show_in_website>
99
  <show_in_store>1</show_in_store>
100
  </enabled>
101
+ <title translate="label" module="catalog">
102
+ <label>Title</label>
103
+ <frontend_type>text</frontend_type>
104
+ <sort_order>15</sort_order>
105
+ <show_in_default>1</show_in_default>
106
+ <show_in_website>1</show_in_website>
107
+ <show_in_store>1</show_in_store>
108
+ </title>
109
  <mode translate="label" module="catalog">
110
  <label>List Mode</label>
111
  <frontend_type>select</frontend_type>
170
  <show_in_website>1</show_in_website>
171
  <show_in_store>1</show_in_store>
172
  </enabled>
173
+ <title translate="label" module="catalog">
174
+ <label>Title</label>
175
+ <frontend_type>text</frontend_type>
176
+ <sort_order>15</sort_order>
177
+ <show_in_default>1</show_in_default>
178
+ <show_in_website>1</show_in_website>
179
+ <show_in_store>1</show_in_store>
180
+ </title>
181
  <mode translate="label" module="catalog">
182
  <label>List Mode</label>
183
  <frontend_type>select</frontend_type>
app/code/community/Yavva/Alsoviewed/etc/widget.xml ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <widgets>
3
+ <yavva_alsoviewed type="alsoviewed/widget_products" translate="name" module="alsoviewed">
4
+ <name>Also Viewed Recommendations</name>
5
+ <parameters>
6
+ <title translate="label" module="catalog">
7
+ <visible>1</visible>
8
+ <label>Title</label>
9
+ <value>You may also like</value>
10
+ <type>text</type>
11
+ </title>
12
+ <basis_mode translate="label">
13
+ <label>Build Recommendations on</label>
14
+ <visible>1</visible>
15
+ <type>multiselect</type>
16
+ <value>viewed</value>
17
+ <values>
18
+ <current translate="label">
19
+ <value>current</value>
20
+ <label>Current Product</label>
21
+ </current>
22
+ <viewed translate="label" module="reports">
23
+ <value>viewed</value>
24
+ <label>Recently Viewed Products</label>
25
+ </viewed>
26
+ <compared translate="label" module="reports">
27
+ <value>compared</value>
28
+ <label>Recently Compared Products</label>
29
+ </compared>
30
+ <cart translate="label" module="checkout">
31
+ <value>cart</value>
32
+ <label>Shopping Cart</label>
33
+ </cart>
34
+ </values>
35
+ </basis_mode>
36
+ <mode translate="label" module="catalog">
37
+ <required>1</required>
38
+ <visible>1</visible>
39
+ <label>List Mode</label>
40
+ <type>select</type>
41
+ <value>grid</value>
42
+ <values>
43
+ <grid translate="label">
44
+ <value>grid</value>
45
+ <label>Grid</label>
46
+ </grid>
47
+ <list translate="label">
48
+ <value>list</value>
49
+ <label>List</label>
50
+ </list>
51
+ </values>
52
+ </mode>
53
+ <products_count translate="label" module="catalog">
54
+ <visible>1</visible>
55
+ <label>Display Product Count</label>
56
+ <type>text</type>
57
+ <value>6</value>
58
+ </products_count>
59
+ <column_count translate="label" module="catalog">
60
+ <visible>1</visible>
61
+ <label>Columns count</label>
62
+ <type>text</type>
63
+ <value>3</value>
64
+ <depends>
65
+ <mode>
66
+ <value>grid</value>
67
+ </mode>
68
+ </depends>
69
+ </column_count>
70
+ <image_width translate="label" module="catalog">
71
+ <visible>1</visible>
72
+ <label>Image width</label>
73
+ <type>text</type>
74
+ <value>170</value>
75
+ </image_width>
76
+ <image_height translate="label" module="catalog">
77
+ <visible>1</visible>
78
+ <label>Image height</label>
79
+ <type>text</type>
80
+ <value>170</value>
81
+ </image_height>
82
+ </parameters>
83
+ </yavva_alsoviewed>
84
+ </widgets>
app/design/frontend/base/default/layout/yavva/alsoviewed.xml CHANGED
@@ -8,9 +8,9 @@
8
 
9
  <catalog_product_view>
10
  <reference name="product.info.additional">
11
- <block type="core/template" name="alsoviewed.content.wrapper" before="-">
12
  <action method="setTemplate" ifconfig="alsoviewed/content/enabled">
13
- <template>yavva/alsoviewed/wrapper/content.phtml</template>
14
  </action>
15
  <block type="alsoviewed/products" name="alsoviewed.list" template="yavva/alsoviewed/products.phtml">
16
  <action method="addDataFromConfig"><path>alsoviewed/content</path></action>
@@ -20,7 +20,7 @@
20
  <reference name="left">
21
  <block type="core/template" name="alsoviewed.left.wrapper" before="-">
22
  <action method="setTemplate" ifconfig="alsoviewed/left/enabled">
23
- <template>yavva/alsoviewed/wrapper/sidebar.phtml</template>
24
  </action>
25
  <block type="alsoviewed/products" name="alsoviewed.list" template="yavva/alsoviewed/products.phtml">
26
  <action method="addDataFromConfig"><path>alsoviewed/left</path></action>
@@ -30,7 +30,7 @@
30
  <reference name="right">
31
  <block type="core/template" name="alsoviewed.right.wrapper" before="-">
32
  <action method="setTemplate" ifconfig="alsoviewed/right/enabled">
33
- <template>yavva/alsoviewed/wrapper/sidebar.phtml</template>
34
  </action>
35
  <block type="alsoviewed/products" name="alsoviewed.list" template="yavva/alsoviewed/products.phtml">
36
  <action method="addDataFromConfig"><path>alsoviewed/right</path></action>
8
 
9
  <catalog_product_view>
10
  <reference name="product.info.additional">
11
+ <block type="core/template" name="alsoviewed.collateral.wrapper" before="-">
12
  <action method="setTemplate" ifconfig="alsoviewed/content/enabled">
13
+ <template>yavva/alsoviewed/wrapper/collateral.phtml</template>
14
  </action>
15
  <block type="alsoviewed/products" name="alsoviewed.list" template="yavva/alsoviewed/products.phtml">
16
  <action method="addDataFromConfig"><path>alsoviewed/content</path></action>
20
  <reference name="left">
21
  <block type="core/template" name="alsoviewed.left.wrapper" before="-">
22
  <action method="setTemplate" ifconfig="alsoviewed/left/enabled">
23
+ <template>yavva/alsoviewed/wrapper/block.phtml</template>
24
  </action>
25
  <block type="alsoviewed/products" name="alsoviewed.list" template="yavva/alsoviewed/products.phtml">
26
  <action method="addDataFromConfig"><path>alsoviewed/left</path></action>
30
  <reference name="right">
31
  <block type="core/template" name="alsoviewed.right.wrapper" before="-">
32
  <action method="setTemplate" ifconfig="alsoviewed/right/enabled">
33
+ <template>yavva/alsoviewed/wrapper/block.phtml</template>
34
  </action>
35
  <block type="alsoviewed/products" name="alsoviewed.list" template="yavva/alsoviewed/products.phtml">
36
  <action method="addDataFromConfig"><path>alsoviewed/right</path></action>
app/design/frontend/base/default/template/yavva/alsoviewed/wrapper/{sidebar.phtml → block.phtml} RENAMED
@@ -8,10 +8,15 @@
8
  if (!$_productCollection->getSize()) :
9
  return;
10
  endif;
 
 
 
 
 
11
  ?>
12
 
13
  <div class="block alsoviewed">
14
- <div class="block-title"><strong><span><?php echo $this->__("You may also like"); ?></span></strong></div>
15
  <div class="block-content">
16
  <?php echo $this->getChildHtml('alsoviewed.list') ?>
17
  </div>
8
  if (!$_productCollection->getSize()) :
9
  return;
10
  endif;
11
+
12
+ $_title = $_list->getTitle();
13
+ if (null === $_title) :
14
+ $_title = $this->getTitle();
15
+ endif;
16
  ?>
17
 
18
  <div class="block alsoviewed">
19
+ <div class="block-title"><strong><span><?php echo $this->__($_title); ?></span></strong></div>
20
  <div class="block-content">
21
  <?php echo $this->getChildHtml('alsoviewed.list') ?>
22
  </div>
app/design/frontend/base/default/template/yavva/alsoviewed/wrapper/{content.phtml → collateral.phtml} RENAMED
@@ -8,9 +8,14 @@
8
  if (!$_productCollection->getSize()) :
9
  return;
10
  endif;
 
 
 
 
 
11
  ?>
12
 
13
  <div class="box-collateral alsoviewed">
14
- <h2><?php echo $this->__("People who viewed this product also viewed"); ?></h2>
15
  <?php echo $this->getChildHtml('alsoviewed.list') ?>
16
  </div>
8
  if (!$_productCollection->getSize()) :
9
  return;
10
  endif;
11
+
12
+ $_title = $_list->getTitle();
13
+ if (null === $_title) :
14
+ $_title = $this->getTitle();
15
+ endif;
16
  ?>
17
 
18
  <div class="box-collateral alsoviewed">
19
+ <h2><?php echo $this->__($_title); ?></h2>
20
  <?php echo $this->getChildHtml('alsoviewed.list') ?>
21
  </div>
app/locale/en_US/Yavva_Alsoviewed.csv CHANGED
@@ -27,3 +27,6 @@
27
  "Relation was successfully saved","Relation was successfully saved"
28
  "Relation was successfully deleted","Relation was successfully deleted"
29
  "Unable to find a relation to delete","Unable to find a relation to delete"
 
 
 
27
  "Relation was successfully saved","Relation was successfully saved"
28
  "Relation was successfully deleted","Relation was successfully deleted"
29
  "Unable to find a relation to delete","Unable to find a relation to delete"
30
+ "Also Viewed Recommendations","Also Viewed Recommendations"
31
+ "Build Recommendations on","Build Recommendations on"
32
+ "Current Product","Current Product"
package.xml CHANGED
@@ -1,25 +1,67 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>alsoviewed</name>
4
- <version>1.0.0</version>
5
  <stability>stable</stability>
6
  <license>GPL</license>
7
  <channel>community</channel>
8
  <extends/>
9
- <summary>Free magento module, that shows products viewed by customers who viewed this product.</summary>
10
- <description>Module uses automatically collected anonymous browsing history to predict the product alternatives.&#xD;
11
- &#xD;
12
- Module key features are:&#xD;
13
- * 100% Free and open source&#xD;
14
- * High Perfomance&#xD;
15
- * Simple and clean design&#xD;
16
- * Responsive out of the box&#xD;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  </description>
18
- <notes>Initial release</notes>
 
 
 
 
 
19
  <authors><author><name>Vova Yatsyuk</name><user>VovaYatsyuk</user><email>vova.yatsyuk@gmail.com</email></author></authors>
20
- <date>2015-01-04</date>
21
- <time>20:22:24</time>
22
- <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="f68a609061f807a4cb7bc6715e009dba"/></dir><dir name="Helper"><file name="Data.php" hash="d8057e1e4731c53a6b1e72a626ce9ac3"/></dir><dir name="Model"><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="dea6bedc82185fa083b16859047fdb2f"/><file name="system.xml" hash="c0eed7ac29a29ff2a9da28ecd8254c12"/></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="a4e876bb9b161f0e8d9e99606c3b7e3c"/></dir></dir><dir name="template"><dir name="yavva"><dir name="alsoviewed"><file name="products.phtml" hash="d55af4e92a7fbe929c10b81a804ddffe"/><dir name="wrapper"><file name="content.phtml" hash="8be64ccce70e0d00b2f0ef7cc4e6b61e"/><file name="sidebar.phtml" hash="476a0bc03c19e400fcdd0837545646be"/></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="7045cf15cb0ee5505ff5e914de938b1e"/></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>
23
  <compatible/>
24
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
25
  </package>
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;
15
+ &#xD;
16
+ #### How it works?&#xD;
17
+ Every time the client is looking at some product, module update relations between&#xD;
18
+ this and other viewed products. Day after day relations count are grows and they&#xD;
19
+ become more accurate.&#xD;
20
+ &#xD;
21
+ #### Can I control the relations?&#xD;
22
+ Yes, store administrator can manually change the relation sort order or even&#xD;
23
+ disable the relation to hide it from the frontend.&#xD;
24
+ &#xD;
25
+ #### Configuration&#xD;
26
+ You can easely place the suggested products block to the one of the following&#xD;
27
+ places on product page:&#xD;
28
+ &#xD;
29
+ - Product additional information&#xD;
30
+ - Left column&#xD;
31
+ - Right column&#xD;
32
+ &#xD;
33
+ &gt; Configuration blocks - are the blocks that shows recommendations based on&#xD;
34
+ &gt; currently viewed product only.&#xD;
35
+ &#xD;
36
+ &gt; If you wish to show recommendations based on customer history (viewed, compared),&#xD;
37
+ &gt; use the [widget](#widget) instead.&#xD;
38
+ &#xD;
39
+ #### Widget&#xD;
40
+ Since 1.1.0 you can use Alsoviewed Recommendations widget on any page.&#xD;
41
+ Widget provides ability to recommend products by additional activities:&#xD;
42
+ &#xD;
43
+ - Recently Viewed Products&#xD;
44
+ - Recently Compared Products&#xD;
45
+ - Shopping Cart products&#xD;
46
+ &#xD;
47
+ #### The main features&#xD;
48
+ - 100% free and open source&#xD;
49
+ - High perfomance&#xD;
50
+ - Simple and clean design&#xD;
51
+ - Responsive css&#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>