Version Notes
Blueknow Magento extension v1.2.0 compatible with Magento v1.3.x or higher.
Download this release
Release Info
Developer | Santiago Ameller |
Extension | BlueknowRecommender |
Version | 1.2.0 |
Comparing to | |
See all releases |
Code changes from version 1.1.1 to 1.2.0
- app/code/community/Blueknow/Recommender/Block/Base.php +4 -0
- app/code/community/Blueknow/Recommender/Block/Cart/Recommender.php +4 -0
- app/code/community/Blueknow/Recommender/Block/Checkout/Tracker.php +3 -0
- app/code/community/Blueknow/Recommender/Block/Customer/Tracker.php +4 -0
- app/code/community/Blueknow/Recommender/Block/Home/Recommender.php +33 -0
- app/code/community/Blueknow/Recommender/Block/Product/Base.php +3 -0
- app/code/community/Blueknow/Recommender/Block/Product/NotFound/Tracker.php +46 -0
- app/code/community/Blueknow/Recommender/Block/Product/Recommender.php +4 -0
- app/code/community/Blueknow/Recommender/Helper/Category.php +54 -3
- app/code/community/Blueknow/Recommender/Helper/Currency.php +1 -1
- app/code/community/Blueknow/Recommender/Helper/Data.php +1 -1
- app/code/community/Blueknow/Recommender/Helper/Price.php +1 -1
- app/code/community/Blueknow/Recommender/Helper/Product.php +87 -0
- app/code/community/Blueknow/Recommender/Model/Cart.php +82 -2
- app/code/community/Blueknow/Recommender/Model/Checkout.php +56 -33
- app/code/community/Blueknow/Recommender/Model/Checkout/Order.php +1 -1
- app/code/community/Blueknow/Recommender/Model/Checkout/Product.php +1 -1
- app/code/community/Blueknow/Recommender/Model/Configuration.php +40 -2
- app/code/community/Blueknow/Recommender/Model/Currency.php +1 -1
- app/code/community/Blueknow/Recommender/Model/Customer.php +1 -1
- app/code/community/Blueknow/Recommender/Model/Observer.php +62 -1
- app/code/community/Blueknow/Recommender/Model/PlatformApiService.php +53 -0
- app/code/community/Blueknow/Recommender/Model/Product.php +8 -5
- app/code/community/Blueknow/Recommender/Model/Session.php +1 -1
- app/code/community/Blueknow/Recommender/Model/Source/Numberofrecommendations.php +1 -1
- app/code/community/Blueknow/Recommender/documentation/Blueknow_Recommender_1.1.1_Gui/314/201a_de_Instalacio/314/201n.pdf +0 -0
- app/code/community/Blueknow/Recommender/documentation/Blueknow_Recommender_1.1.1_Installation_Guide.pdf +0 -0
- app/code/community/Blueknow/Recommender/documentation/Blueknow_Recommender_1.2.0_Guia_de_Instalacion.pdf +0 -0
- app/code/community/Blueknow/Recommender/documentation/Blueknow_Recommender_1.2.0_Guide_Installation.pdf +0 -0
- app/code/community/Blueknow/Recommender/documentation/Blueknow_Recommender_1.2.0_Installation_Guide.pdf +0 -0
- app/code/community/Blueknow/Recommender/documentation/README.txt +20 -6
- app/code/community/Blueknow/Recommender/etc/config.xml +49 -16
- app/code/community/Blueknow/Recommender/etc/system.xml +32 -1
- app/code/community/Blueknow/Recommender/sql/recommender_setup/uninstall.sql +1 -1
- app/design/adminhtml/default/default/layout/blueknow_recommender.xml +1 -1
- app/design/frontend/default/default/layout/blueknow_recommender.xml +42 -11
- app/design/frontend/default/default/template/blueknow/cart/recommender.phtml +2 -2
- app/design/frontend/default/default/template/blueknow/cart/recommender_widget.phtml +8 -40
- app/design/frontend/default/default/template/blueknow/checkout/tracker.phtml +1 -1
- app/design/frontend/default/default/template/blueknow/common/recommender_renderer.phtml +0 -55
- app/design/frontend/default/default/template/blueknow/common/recommender_widget_footer.phtml +1 -1
- app/design/frontend/default/default/template/blueknow/customer/tracker.phtml +2 -1
- app/design/frontend/default/default/template/blueknow/home/recommender.phtml +34 -0
- app/design/frontend/default/default/template/blueknow/home/recommender_widget.phtml +44 -0
- app/design/frontend/default/default/template/blueknow/product/notFound/tracker.phtml +32 -0
- app/design/frontend/default/default/template/blueknow/product/recommender.phtml +2 -2
- app/design/frontend/default/default/template/blueknow/product/recommender_widget.phtml +8 -29
- app/design/frontend/default/default/template/blueknow/product/tracker.phtml +2 -1
- app/etc/modules/Blueknow_Recommender.xml +1 -1
- app/locale/de_DE/Blueknow_recommender.csv +7 -3
- app/locale/en_US/Blueknow_recommender.csv +2 -1
- app/locale/es_ES/Blueknow_recommender.csv +5 -1
- app/locale/fr_FR/Blueknow_recommender.csv +5 -1
- app/locale/pt_PT/Blueknow_recommender.csv +5 -1
- package.xml +8 -8
- skin/frontend/base/default/css/blueknow_recommender/blueknow_widget.css +68 -0
- skin/frontend/base/default/js/blueknow_recommender/blueknow_recommender.min.js +17 -0
app/code/community/Blueknow/Recommender/Block/Base.php
CHANGED
@@ -29,6 +29,10 @@ class Blueknow_Recommender_Block_Base extends Mage_Core_Block_Template {
|
|
29 |
$this->_configuration = Mage::getModel('blueknow_recommender/Configuration');
|
30 |
}
|
31 |
|
|
|
|
|
|
|
|
|
32 |
public function _toHtml() {
|
33 |
//the block is rendered only if module is enabled
|
34 |
if ($this->_configuration->isEnabled()) {
|
29 |
$this->_configuration = Mage::getModel('blueknow_recommender/Configuration');
|
30 |
}
|
31 |
|
32 |
+
/**
|
33 |
+
* Render block.
|
34 |
+
* @see Mage_Core_Block_Template::_toHtml()
|
35 |
+
*/
|
36 |
public function _toHtml() {
|
37 |
//the block is rendered only if module is enabled
|
38 |
if ($this->_configuration->isEnabled()) {
|
app/code/community/Blueknow/Recommender/Block/Cart/Recommender.php
CHANGED
@@ -29,6 +29,10 @@ class Blueknow_Recommender_Block_Cart_Recommender extends Blueknow_Recommender_B
|
|
29 |
$this->_cart = Mage::getModel('blueknow_recommender/Cart');
|
30 |
}
|
31 |
|
|
|
|
|
|
|
|
|
32 |
public function _toHtml() {
|
33 |
//the block is rendered only if up-sell is enabled and there are one or more products inside shopping cart
|
34 |
if ($this->_configuration->isUpSellEnabled() && count($this->_cart->getProducts()) > 0) {
|
29 |
$this->_cart = Mage::getModel('blueknow_recommender/Cart');
|
30 |
}
|
31 |
|
32 |
+
/**
|
33 |
+
* Render block.
|
34 |
+
* @see Blueknow_Recommender_Block_Base::_toHtml()
|
35 |
+
*/
|
36 |
public function _toHtml() {
|
37 |
//the block is rendered only if up-sell is enabled and there are one or more products inside shopping cart
|
38 |
if ($this->_configuration->isUpSellEnabled() && count($this->_cart->getProducts()) > 0) {
|
app/code/community/Blueknow/Recommender/Block/Checkout/Tracker.php
CHANGED
@@ -29,6 +29,9 @@ class Blueknow_Recommender_Block_Checkout_Tracker extends Blueknow_Recommender_B
|
|
29 |
$this->_checkout = Mage::getModel('blueknow_recommender/Checkout');
|
30 |
}
|
31 |
|
|
|
|
|
|
|
32 |
public function _toHtml() {
|
33 |
$orders = $this->_checkout->getOrders();
|
34 |
//the block is rendered only if there are one or more orders
|
29 |
$this->_checkout = Mage::getModel('blueknow_recommender/Checkout');
|
30 |
}
|
31 |
|
32 |
+
/**
|
33 |
+
* Render block.
|
34 |
+
*/
|
35 |
public function _toHtml() {
|
36 |
$orders = $this->_checkout->getOrders();
|
37 |
//the block is rendered only if there are one or more orders
|
app/code/community/Blueknow/Recommender/Block/Customer/Tracker.php
CHANGED
@@ -29,6 +29,10 @@ class Blueknow_Recommender_Block_Customer_Tracker extends Blueknow_Recommender_B
|
|
29 |
$this->_customer = Mage::getModel('blueknow_recommender/Customer');
|
30 |
}
|
31 |
|
|
|
|
|
|
|
|
|
32 |
public function _toHtml() {
|
33 |
//the block is rendered only on first customer login (once per session)
|
34 |
if ($this->_getSession()->isNewLogin()) {
|
29 |
$this->_customer = Mage::getModel('blueknow_recommender/Customer');
|
30 |
}
|
31 |
|
32 |
+
/**
|
33 |
+
* Render block.
|
34 |
+
* @see Blueknow_Recommender_Block_Base::_toHtml()
|
35 |
+
*/
|
36 |
public function _toHtml() {
|
37 |
//the block is rendered only on first customer login (once per session)
|
38 |
if ($this->_getSession()->isNewLogin()) {
|
app/code/community/Blueknow/Recommender/Block/Home/Recommender.php
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Home recommender block.
|
4 |
+
*
|
5 |
+
* DISCLAIMER
|
6 |
+
*
|
7 |
+
* Do not edit or add to this file if you wish to upgrade Blueknow Recommender
|
8 |
+
* extension to newer versions in the future. If you wish to customize it for
|
9 |
+
* your needs please save your changes before upgrading.
|
10 |
+
*
|
11 |
+
* @category Blueknow
|
12 |
+
* @package Blueknow_Recommender
|
13 |
+
* @copyright Copyright (c) 2012 Blueknow, S.L. (http://www.blueknow.com)
|
14 |
+
* @license GNU General Public License
|
15 |
+
* @author <a href="mailto:santi.ameller@blueknow.com">Santiago Ameller</a>
|
16 |
+
* @author <a href="mailto:josep.ventura@blueknow.com">Josep M Ventura</a>
|
17 |
+
* @since 1.2.0
|
18 |
+
*
|
19 |
+
*/
|
20 |
+
class Blueknow_Recommender_Block_Home_Recommender extends Blueknow_Recommender_Block_Base {
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Render block.
|
24 |
+
*/
|
25 |
+
//[21-12-2012] MAGPLUGIN-12. Add home page recommendations.
|
26 |
+
public function _toHtml() {
|
27 |
+
//the block is rendered only if home recommendations enabled
|
28 |
+
if ($this->_configuration->isHomeEnabled()) {
|
29 |
+
return parent::_toHtml();
|
30 |
+
}
|
31 |
+
return '';
|
32 |
+
}
|
33 |
+
}
|
app/code/community/Blueknow/Recommender/Block/Product/Base.php
CHANGED
@@ -24,6 +24,9 @@ class Blueknow_Recommender_Block_Product_Base extends Blueknow_Recommender_Block
|
|
24 |
*/
|
25 |
protected $_product;
|
26 |
|
|
|
|
|
|
|
27 |
public function _beforeToHtml() {
|
28 |
parent::_beforeToHtml();
|
29 |
$this->_product = Mage::getModel('blueknow_recommender/Product');
|
24 |
*/
|
25 |
protected $_product;
|
26 |
|
27 |
+
/**
|
28 |
+
* Prepare product before render it.
|
29 |
+
*/
|
30 |
public function _beforeToHtml() {
|
31 |
parent::_beforeToHtml();
|
32 |
$this->_product = Mage::getModel('blueknow_recommender/Product');
|
app/code/community/Blueknow/Recommender/Block/Product/NotFound/Tracker.php
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Product not found tracker block.
|
4 |
+
*
|
5 |
+
* DISCLAIMER
|
6 |
+
*
|
7 |
+
* Do not edit or add to this file if you wish to upgrade Blueknow Recommender
|
8 |
+
* extension to newer versions in the future. If you wish to customize it for
|
9 |
+
* your needs please save your changes before upgrading.
|
10 |
+
*
|
11 |
+
* @category Blueknow
|
12 |
+
* @package Blueknow_Recommender
|
13 |
+
* @copyright Copyright (c) 2010 Blueknow, S.L. (http://www.blueknow.com)
|
14 |
+
* @license GNU General Public License
|
15 |
+
* @author <a href="mailto:santi.ameller@blueknow.com">Santiago Ameller</a>
|
16 |
+
* @author <a href="mailto:josep.ventura@blueknow.com">Josep M Ventura</a>
|
17 |
+
* @since 1.2.0
|
18 |
+
*/
|
19 |
+
//[18-12-2012] Product not found page tracker.
|
20 |
+
class Blueknow_Recommender_Block_Product_NotFound_Tracker extends Blueknow_Recommender_Block_Base {
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Product identifier.
|
24 |
+
*/
|
25 |
+
private $_id;
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Render block.
|
29 |
+
* @see Blueknow_Recommender_Block_Base::_toHtml()
|
30 |
+
*/
|
31 |
+
public function _toHtml() {
|
32 |
+
//Retrieve id from helper
|
33 |
+
$this->_id = Mage::helper('blueknow_recommender/product')->getCurrentProductId();
|
34 |
+
if (isset($this->_id)) {
|
35 |
+
return parent::_toHtml();
|
36 |
+
}
|
37 |
+
return '';
|
38 |
+
}
|
39 |
+
|
40 |
+
/**
|
41 |
+
* Get current product id.
|
42 |
+
*/
|
43 |
+
public function getCurrentProductId() {
|
44 |
+
return $this->_id;
|
45 |
+
}
|
46 |
+
}
|
app/code/community/Blueknow/Recommender/Block/Product/Recommender.php
CHANGED
@@ -18,6 +18,10 @@
|
|
18 |
*/
|
19 |
class Blueknow_Recommender_Block_Product_Recommender extends Blueknow_Recommender_Block_Product_Base {
|
20 |
|
|
|
|
|
|
|
|
|
21 |
public function _toHtml() {
|
22 |
//the block is rendered only if cross-sell is enabled (recommendations in product detail page)
|
23 |
if ($this->_configuration->isCrossSellEnabled()) {
|
18 |
*/
|
19 |
class Blueknow_Recommender_Block_Product_Recommender extends Blueknow_Recommender_Block_Product_Base {
|
20 |
|
21 |
+
/**
|
22 |
+
* Render block.
|
23 |
+
* @see Blueknow_Recommender_Block_Base::_toHtml()
|
24 |
+
*/
|
25 |
public function _toHtml() {
|
26 |
//the block is rendered only if cross-sell is enabled (recommendations in product detail page)
|
27 |
if ($this->_configuration->isCrossSellEnabled()) {
|
app/code/community/Blueknow/Recommender/Helper/Category.php
CHANGED
@@ -10,9 +10,10 @@
|
|
10 |
*
|
11 |
* @category Blueknow
|
12 |
* @package Blueknow_Recommender
|
13 |
-
* @copyright Copyright (c)
|
14 |
* @license GNU General Public License
|
15 |
* @author <a href="mailto:santi.ameller@blueknow.com">Santiago Ameller</a>
|
|
|
16 |
* @since 1.0.0
|
17 |
*
|
18 |
*/
|
@@ -21,6 +22,7 @@ class Blueknow_Recommender_Helper_Category extends Mage_Core_Helper_Abstract {
|
|
21 |
/**
|
22 |
* Return current category path or get it from current category and creating array of categories paths.
|
23 |
* @return array Items defined as ('id', 'name') pair.
|
|
|
24 |
*/
|
25 |
public function getCategoryPath() {
|
26 |
$path = array();
|
@@ -30,7 +32,7 @@ class Blueknow_Recommender_Helper_Category extends Mage_Core_Helper_Abstract {
|
|
30 |
$categories = $category->getParentCategories();
|
31 |
//add category path
|
32 |
foreach ($pathIds as $categoryId) {
|
33 |
-
//
|
34 |
if (isset($categories[$categoryId]) && $categories[$categoryId]->getName()) {
|
35 |
$path['category' . $categoryId] = array(
|
36 |
'id' => $categoryId);
|
@@ -42,4 +44,53 @@ class Blueknow_Recommender_Helper_Category extends Mage_Core_Helper_Abstract {
|
|
42 |
}
|
43 |
return $path;
|
44 |
}
|
45 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
*
|
11 |
* @category Blueknow
|
12 |
* @package Blueknow_Recommender
|
13 |
+
* @copyright Copyright (c) 2013 Blueknow, S.L. (http://www.blueknow.com)
|
14 |
* @license GNU General Public License
|
15 |
* @author <a href="mailto:santi.ameller@blueknow.com">Santiago Ameller</a>
|
16 |
+
* @author <a href="mailto:josep.ventura@blueknow.com">Josep M Ventura</a>
|
17 |
* @since 1.0.0
|
18 |
*
|
19 |
*/
|
22 |
/**
|
23 |
* Return current category path or get it from current category and creating array of categories paths.
|
24 |
* @return array Items defined as ('id', 'name') pair.
|
25 |
+
* @deprecated 1.2.0.GA (see issue MAGPLUGIN-13); use #getPath() instead.
|
26 |
*/
|
27 |
public function getCategoryPath() {
|
28 |
$path = array();
|
32 |
$categories = $category->getParentCategories();
|
33 |
//add category path
|
34 |
foreach ($pathIds as $categoryId) {
|
35 |
+
//this condition can be improved!(Not used deprecated method)
|
36 |
if (isset($categories[$categoryId]) && $categories[$categoryId]->getName()) {
|
37 |
$path['category' . $categoryId] = array(
|
38 |
'id' => $categoryId);
|
44 |
}
|
45 |
return $path;
|
46 |
}
|
47 |
+
|
48 |
+
/**
|
49 |
+
* Return current category path using catalog. It works independently of page used.
|
50 |
+
*
|
51 |
+
* @return associative array with ids.
|
52 |
+
* @since 1.2.0.GA.
|
53 |
+
*/
|
54 |
+
//[2012-11-13] Issue MAGPLUGIN-13. Track correctly categories from Home and Product page.
|
55 |
+
public function getPath($productId) {
|
56 |
+
$path = array();
|
57 |
+
//Get lowest level category
|
58 |
+
if ($category = $this->getLastChild($productId)) {
|
59 |
+
//Retrieve ids from path with correct category id order.
|
60 |
+
$pathInStore = $category->getPathInStore();
|
61 |
+
$pathIds = array_reverse(explode(',', $pathInStore));
|
62 |
+
//Get parents
|
63 |
+
$parents = $category->getParentCategories();
|
64 |
+
//add ids to an associative array
|
65 |
+
foreach ($pathIds as $catId) {
|
66 |
+
if (isset($parents[$catId])) {
|
67 |
+
$path['category' . $catId] = array('id' => $catId);
|
68 |
+
}
|
69 |
+
}
|
70 |
+
}
|
71 |
+
return $path;
|
72 |
+
}
|
73 |
+
|
74 |
+
/**
|
75 |
+
* Return lowest level Category
|
76 |
+
* @param number $productId
|
77 |
+
* @return Category model object
|
78 |
+
* @since 1.2.0.GA.
|
79 |
+
*/
|
80 |
+
//[23-01-2013] MAGPLUGIN-13. Retrieve lowest level category following 2 different strategies.
|
81 |
+
public function getLastChild($productId) {
|
82 |
+
//Retrieve from registry (Product page case)
|
83 |
+
$category = Mage::registry('current_category');
|
84 |
+
//Go to model to find it.
|
85 |
+
if(!isset($category)) {
|
86 |
+
//Retrieve product from catalog with all properties (avoid Mage::registry in Home page or others)
|
87 |
+
$prod = Mage::getModel('catalog/product')->load($productId);
|
88 |
+
//Get the last category id from category Ids
|
89 |
+
$categoryIds = $prod->getCategoryIds();
|
90 |
+
$last = end($categoryIds);
|
91 |
+
//Retrieve current category from catalog
|
92 |
+
$category = Mage::getModel('catalog/category')->load($last);
|
93 |
+
}
|
94 |
+
return $category;
|
95 |
+
}
|
96 |
+
}
|
app/code/community/Blueknow/Recommender/Helper/Currency.php
CHANGED
@@ -10,7 +10,7 @@
|
|
10 |
*
|
11 |
* @category Blueknow
|
12 |
* @package Blueknow_Recommender
|
13 |
-
* @copyright Copyright (c)
|
14 |
* @license GNU General Public License
|
15 |
* @author <a href="mailto:santi.ameller@blueknow.com">Santiago Ameller</a>
|
16 |
* @since 1.0.0
|
10 |
*
|
11 |
* @category Blueknow
|
12 |
* @package Blueknow_Recommender
|
13 |
+
* @copyright Copyright (c) 2013 Blueknow, S.L. (http://www.blueknow.com)
|
14 |
* @license GNU General Public License
|
15 |
* @author <a href="mailto:santi.ameller@blueknow.com">Santiago Ameller</a>
|
16 |
* @since 1.0.0
|
app/code/community/Blueknow/Recommender/Helper/Data.php
CHANGED
@@ -10,7 +10,7 @@
|
|
10 |
*
|
11 |
* @category Blueknow
|
12 |
* @package Blueknow_Recommender
|
13 |
-
* @copyright Copyright (c)
|
14 |
* @license GNU General Public License
|
15 |
* @author <a href="mailto:santi.ameller@blueknow.com">Santiago Ameller</a>
|
16 |
* @since 1.0.0
|
10 |
*
|
11 |
* @category Blueknow
|
12 |
* @package Blueknow_Recommender
|
13 |
+
* @copyright Copyright (c) 2013 Blueknow, S.L. (http://www.blueknow.com)
|
14 |
* @license GNU General Public License
|
15 |
* @author <a href="mailto:santi.ameller@blueknow.com">Santiago Ameller</a>
|
16 |
* @since 1.0.0
|
app/code/community/Blueknow/Recommender/Helper/Price.php
CHANGED
@@ -10,7 +10,7 @@
|
|
10 |
*
|
11 |
* @category Blueknow
|
12 |
* @package Blueknow_Recommender
|
13 |
-
* @copyright Copyright (c)
|
14 |
* @license GNU General Public License
|
15 |
* @author <a href="mailto:santi.ameller@blueknow.com">Santiago Ameller</a>
|
16 |
* @since 1.0.0
|
10 |
*
|
11 |
* @category Blueknow
|
12 |
* @package Blueknow_Recommender
|
13 |
+
* @copyright Copyright (c) 2013 Blueknow, S.L. (http://www.blueknow.com)
|
14 |
* @license GNU General Public License
|
15 |
* @author <a href="mailto:santi.ameller@blueknow.com">Santiago Ameller</a>
|
16 |
* @since 1.0.0
|
app/code/community/Blueknow/Recommender/Helper/Product.php
ADDED
@@ -0,0 +1,87 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Product helper.
|
4 |
+
*
|
5 |
+
* DISCLAIMER
|
6 |
+
*
|
7 |
+
* Do not edit or add to this file if you wish to upgrade Blueknow Recommender
|
8 |
+
* extension to newer versions in the future. If you wish to customize it for
|
9 |
+
* your needs please save your changes before upgrading.
|
10 |
+
*
|
11 |
+
* @category Blueknow
|
12 |
+
* @package Blueknow_Recommender
|
13 |
+
* @copyright Copyright (c) 2013 Blueknow, S.L. (http://www.blueknow.com)
|
14 |
+
* @license GNU General Public License
|
15 |
+
* @author <a href="mailto:santi.ameller@blueknow.com">Santiago Ameller</a>
|
16 |
+
* @author <a href="mailto:josep.ventura@blueknow.com">Josep M Ventura</a>
|
17 |
+
* @since 1.2.0
|
18 |
+
*
|
19 |
+
*/
|
20 |
+
//[2012-12-20] This helper has been created due to issue MAGPLUGIN-17.
|
21 |
+
class Blueknow_Recommender_Helper_Product extends Mage_Core_Helper_Abstract {
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Get current product identifier following 3 different strategies: from cookie, from model and finally from URL.
|
25 |
+
*
|
26 |
+
* @return string Current product identifier, if any; null otherwise.
|
27 |
+
*/
|
28 |
+
public function getCurrentProductId() {
|
29 |
+
//first strategy: from cookie
|
30 |
+
$productId = $this->getCurrentProductIdFromCookie();
|
31 |
+
if (!isset($productId)) {
|
32 |
+
//second strategy: from model
|
33 |
+
$productId = $this->getCurrentProductIdFromModel();
|
34 |
+
}
|
35 |
+
if (!isset($productId)) {
|
36 |
+
//third strategy: from URL
|
37 |
+
$productId = $this->getCurrentProductIdFromUrl();
|
38 |
+
}
|
39 |
+
return isset($productId) ? $productId : null;
|
40 |
+
}
|
41 |
+
|
42 |
+
/**
|
43 |
+
* Get current product identifier from model.
|
44 |
+
*
|
45 |
+
* @return string Current product identifier, if any; null otherwise.
|
46 |
+
*/
|
47 |
+
public function getCurrentProductIdFromModel() {
|
48 |
+
//Retrieve from current product
|
49 |
+
$product = Mage::helper('catalog')->getProduct();
|
50 |
+
return isset($product) ? $product->getId() : null;
|
51 |
+
}
|
52 |
+
|
53 |
+
/**
|
54 |
+
* Get current product identifier from Blueknow's clicked cookie.
|
55 |
+
* Cookie format: {product_id}@{source}@{location} (example: 1234@item2item@product).
|
56 |
+
*
|
57 |
+
* @return string Current product identifier, if cookie exists; null otherwise.
|
58 |
+
*/
|
59 |
+
public function getCurrentProductIdFromCookie() {
|
60 |
+
$productId = null;
|
61 |
+
//Check if cookie exists
|
62 |
+
if (isset($_COOKIE["_bkclk"])) {
|
63 |
+
//Parse cookie
|
64 |
+
$cookieValue = explode("@", $_COOKIE["_bkclk"]);
|
65 |
+
//Return identifier
|
66 |
+
$productId = $cookieValue[0];
|
67 |
+
}
|
68 |
+
//Check product Id not empty (example: @item2item@product)
|
69 |
+
return empty($productId) ? null : $productId;
|
70 |
+
}
|
71 |
+
|
72 |
+
/**
|
73 |
+
* Get current product identifier from URL.
|
74 |
+
*
|
75 |
+
* @return string Current product identifier, if any; null otherwise.
|
76 |
+
*/
|
77 |
+
public function getCurrentProductIdFromUrl() {
|
78 |
+
//Retrieve product using product name from url
|
79 |
+
$currentUrl = Mage::helper('core/url')->getCurrentUrl();
|
80 |
+
$productName = basename($currentUrl);
|
81 |
+
//Try to load product and retrieve Id
|
82 |
+
$product = Mage::getModel('core/url_rewrite')
|
83 |
+
->setStoreId(Mage::app()->getStore()->getId())
|
84 |
+
->loadByRequestPath($productName);
|
85 |
+
return isset($product) ? $product->getProductId() : null;
|
86 |
+
}
|
87 |
+
}
|
app/code/community/Blueknow/Recommender/Model/Cart.php
CHANGED
@@ -10,9 +10,10 @@
|
|
10 |
*
|
11 |
* @category Blueknow
|
12 |
* @package Blueknow_Recommender
|
13 |
-
* @copyright Copyright (c)
|
14 |
* @license GNU General Public License
|
15 |
* @author <a href="mailto:santi.ameller@blueknow.com">Santiago Ameller</a>
|
|
|
16 |
* @since 1.0.0
|
17 |
*
|
18 |
*/
|
@@ -31,8 +32,87 @@ class Blueknow_Recommender_Model_Cart extends Varien_Object {
|
|
31 |
public function getProducts() {
|
32 |
if (!$this->_products) { //empty cart is directly returned
|
33 |
$cart = Mage::helper('checkout/cart')->getCart();
|
34 |
-
$
|
|
|
35 |
}
|
36 |
return $this->_products;
|
37 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
}
|
10 |
*
|
11 |
* @category Blueknow
|
12 |
* @package Blueknow_Recommender
|
13 |
+
* @copyright Copyright (c) 2013 Blueknow, S.L. (http://www.blueknow.com)
|
14 |
* @license GNU General Public License
|
15 |
* @author <a href="mailto:santi.ameller@blueknow.com">Santiago Ameller</a>
|
16 |
+
* @author <a href="mailto:josep.ventura@blueknow.com">Josep M Ventura</a>
|
17 |
* @since 1.0.0
|
18 |
*
|
19 |
*/
|
32 |
public function getProducts() {
|
33 |
if (!$this->_products) { //empty cart is directly returned
|
34 |
$cart = Mage::helper('checkout/cart')->getCart();
|
35 |
+
$ids = $cart->getProductIds();
|
36 |
+
$this->filterProductIds($ids);
|
37 |
}
|
38 |
return $this->_products;
|
39 |
}
|
40 |
+
|
41 |
+
/**
|
42 |
+
* Retrieve product ids after success checkout in order to track sold products.
|
43 |
+
*
|
44 |
+
* @since 1.2.0.GA.
|
45 |
+
*/
|
46 |
+
//[04-01-2013] MAGPLUGIN-21. Track product IDs on checkout for every kind of product.
|
47 |
+
protected function filterProductIds($items) {
|
48 |
+
//Check if we have a bundle
|
49 |
+
$flagBundle = false;
|
50 |
+
//Initialize tracker ids
|
51 |
+
$trackerIds = array();
|
52 |
+
//Loopt through all ids
|
53 |
+
foreach ($items as $productId) {
|
54 |
+
//Retrieve original product in order to get TypeId
|
55 |
+
$product = Mage::getModel('catalog/product')->load($productId);
|
56 |
+
if (isset($product)) {
|
57 |
+
//Check product types
|
58 |
+
switch ($product->getTypeId()) {
|
59 |
+
// Bundle product
|
60 |
+
case Mage_Catalog_Model_Product_Type::TYPE_BUNDLE:
|
61 |
+
//Activate the bundle flag
|
62 |
+
$flagBundle = true;
|
63 |
+
//Add id
|
64 |
+
array_push($trackerIds, $productId);
|
65 |
+
break;
|
66 |
+
// Configurable product
|
67 |
+
case Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE:
|
68 |
+
//Add id
|
69 |
+
array_push($trackerIds, $productId);
|
70 |
+
break;
|
71 |
+
// Default case
|
72 |
+
default:
|
73 |
+
//Check for configurable parent
|
74 |
+
$parentIds = Mage::getModel('catalog/product_type_configurable')->getParentIdsByChild($productId);
|
75 |
+
//Check for bundle parent
|
76 |
+
if((!$parentIds) && ($flagBundle)) {
|
77 |
+
$parentIds = Mage::getModel('bundle/product_type')->getParentIdsByChild($productId);
|
78 |
+
}
|
79 |
+
//Retrieve parent and store
|
80 |
+
if($parentIds) {
|
81 |
+
//Check appropiate parent in our product id array
|
82 |
+
$index = $this->getParentIndex($parentIds, $trackerIds);
|
83 |
+
//Add the correct parent for id, otherwise skip
|
84 |
+
if(isset($index)){
|
85 |
+
array_push($trackerIds, $parentIds[$index]);
|
86 |
+
}
|
87 |
+
} else {
|
88 |
+
//Just default product
|
89 |
+
array_push($trackerIds, $productId);
|
90 |
+
}
|
91 |
+
break;
|
92 |
+
}
|
93 |
+
}
|
94 |
+
}
|
95 |
+
//Remove duplicates and store
|
96 |
+
$this->_products = array_unique($trackerIds);
|
97 |
+
}
|
98 |
+
|
99 |
+
/**
|
100 |
+
* Get the appropiate parent index
|
101 |
+
*
|
102 |
+
* @param array $parentIds
|
103 |
+
* @param array $trackerIds
|
104 |
+
* @return number
|
105 |
+
* @since 1.2.0.GA.
|
106 |
+
*/
|
107 |
+
private function getParentIndex($parentIds, $trackerIds) {
|
108 |
+
//Checking all parent ids
|
109 |
+
for ($i=0; $i < count($parentIds); $i++) {
|
110 |
+
//Find the key
|
111 |
+
$parentFound = array_search($parentIds[$i], $trackerIds, $strict = TRUE);
|
112 |
+
//If it's integer we get the correct one
|
113 |
+
if (is_int($parentFound)) {
|
114 |
+
return $i;
|
115 |
+
}
|
116 |
+
}
|
117 |
+
}
|
118 |
}
|
app/code/community/Blueknow/Recommender/Model/Checkout.php
CHANGED
@@ -10,9 +10,10 @@
|
|
10 |
*
|
11 |
* @category Blueknow
|
12 |
* @package Blueknow_Recommender
|
13 |
-
* @copyright Copyright (c)
|
14 |
* @license GNU General Public License
|
15 |
* @author <a href="mailto:santi.ameller@blueknow.com">Santiago Ameller</a>
|
|
|
16 |
* @since 1.0.0
|
17 |
*
|
18 |
*/
|
@@ -28,6 +29,7 @@ class Blueknow_Recommender_Model_Checkout extends Varien_Object {
|
|
28 |
* Get last successfull orders from current session.
|
29 |
* @return array of Blueknow_Recommender_Model_Checkout_Order
|
30 |
*/
|
|
|
31 |
public function getOrders() {
|
32 |
if (empty($this->_orders)) {
|
33 |
//get last quote identifier
|
@@ -38,40 +40,61 @@ class Blueknow_Recommender_Model_Checkout extends Varien_Object {
|
|
38 |
$ordersId = array();
|
39 |
//get quote
|
40 |
$quote = Mage::getModel('sales/quote')->load($quoteId);
|
41 |
-
//
|
42 |
-
$
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
//get saleable information
|
66 |
-
$bProduct->setSaleable(Mage::getModel('catalog/product')->load($item->getProductId())->isSaleable());
|
67 |
-
//add product
|
68 |
-
$bOrder->addProduct($bProduct);
|
69 |
-
}
|
70 |
-
//add order
|
71 |
-
$this->_orders[] = $bOrder;
|
72 |
-
}
|
73 |
}
|
74 |
}
|
75 |
return $this->_orders;
|
76 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
}
|
10 |
*
|
11 |
* @category Blueknow
|
12 |
* @package Blueknow_Recommender
|
13 |
+
* @copyright Copyright (c) 2013 Blueknow, S.L. (http://www.blueknow.com)
|
14 |
* @license GNU General Public License
|
15 |
* @author <a href="mailto:santi.ameller@blueknow.com">Santiago Ameller</a>
|
16 |
+
* @author <a href="mailto:josep.ventura@blueknow.com">Josep M Ventura</a>
|
17 |
* @since 1.0.0
|
18 |
*
|
19 |
*/
|
29 |
* Get last successfull orders from current session.
|
30 |
* @return array of Blueknow_Recommender_Model_Checkout_Order
|
31 |
*/
|
32 |
+
//[14-12-2012] Updated due to MAGPLUGIN-14, check single or multi shipping
|
33 |
public function getOrders() {
|
34 |
if (empty($this->_orders)) {
|
35 |
//get last quote identifier
|
40 |
$ordersId = array();
|
41 |
//get quote
|
42 |
$quote = Mage::getModel('sales/quote')->load($quoteId);
|
43 |
+
//check if multishipping
|
44 |
+
$multi = $quote->getIsMultiShipping();
|
45 |
+
//Check if multishiping
|
46 |
+
if (!$multi) {
|
47 |
+
//Single shippment case (reserved quoteId = orderId) used by Mage convert utilties.
|
48 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($quote->getReservedOrderId());
|
49 |
+
//Create custom BK order
|
50 |
+
$this->_orders[] = $this->_createOrder($order, $store);
|
51 |
+
} else {
|
52 |
+
//Multishipping case load orders
|
53 |
+
$orders = Mage::getResourceModel('sales/order_collection')->addAttributeToFilter('quote_id', $quoteId)->load();
|
54 |
+
//orders iteration
|
55 |
+
foreach ($orders as $order) {
|
56 |
+
$orderId = $order->getIncrementId();
|
57 |
+
if (in_array($orderId, $ordersId)) {
|
58 |
+
continue; //order already processed
|
59 |
+
}
|
60 |
+
//register order
|
61 |
+
$ordersId[] = $orderId;
|
62 |
+
//create our own order and add to our list.
|
63 |
+
$this->_orders[] = $this->_createOrder($order, $store);
|
64 |
+
}
|
65 |
+
|
66 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
}
|
68 |
}
|
69 |
return $this->_orders;
|
70 |
}
|
71 |
+
|
72 |
+
/**
|
73 |
+
* Create Blueknow order object containing all products.
|
74 |
+
* @return $bOrder
|
75 |
+
* @since 1.2.0.GA.
|
76 |
+
*/
|
77 |
+
protected function _createOrder($order, $store) {
|
78 |
+
//create our own order
|
79 |
+
$bOrder = Mage::getModel('blueknow_recommender/Checkout_Order');
|
80 |
+
//Assign ID and other properties
|
81 |
+
$bOrder->setId($order->getIncrementId());
|
82 |
+
$bOrder->setTotal($store->roundPrice($order->getBaseGrandTotal()));
|
83 |
+
$bOrder->setTax($store->roundPrice($order->getBaseTaxAmount()));
|
84 |
+
$bOrder->setShipping($store->roundPrice($order->getBaseShippingAmount()));
|
85 |
+
foreach ($order->getAllItems() as $item) {
|
86 |
+
if ($item->getParentItemId()) {
|
87 |
+
continue;
|
88 |
+
}
|
89 |
+
$bProduct = Mage::getModel('blueknow_recommender/Checkout_Product');
|
90 |
+
$bProduct->setId($item->getProductId());
|
91 |
+
$bProduct->setPrice($store->roundPrice($item->getBasePrice()));
|
92 |
+
$bProduct->setQuantity(intval($item->getQtyOrdered()));
|
93 |
+
//get saleable information
|
94 |
+
$bProduct->setSaleable(Mage::getModel('catalog/product')->load($item->getProductId())->isSaleable());
|
95 |
+
//add product
|
96 |
+
$bOrder->addProduct($bProduct);
|
97 |
+
}
|
98 |
+
return $bOrder;
|
99 |
+
}
|
100 |
}
|
app/code/community/Blueknow/Recommender/Model/Checkout/Order.php
CHANGED
@@ -10,7 +10,7 @@
|
|
10 |
*
|
11 |
* @category Blueknow
|
12 |
* @package Blueknow_Recommender
|
13 |
-
* @copyright Copyright (c)
|
14 |
* @license GNU General Public License
|
15 |
* @author <a href="mailto:santi.ameller@blueknow.com">Santiago Ameller</a>
|
16 |
* @since 1.0.0
|
10 |
*
|
11 |
* @category Blueknow
|
12 |
* @package Blueknow_Recommender
|
13 |
+
* @copyright Copyright (c) 2013 Blueknow, S.L. (http://www.blueknow.com)
|
14 |
* @license GNU General Public License
|
15 |
* @author <a href="mailto:santi.ameller@blueknow.com">Santiago Ameller</a>
|
16 |
* @since 1.0.0
|
app/code/community/Blueknow/Recommender/Model/Checkout/Product.php
CHANGED
@@ -10,7 +10,7 @@
|
|
10 |
*
|
11 |
* @category Blueknow
|
12 |
* @package Blueknow_Recommender
|
13 |
-
* @copyright Copyright (c)
|
14 |
* @license GNU General Public License
|
15 |
* @author <a href="mailto:santi.ameller@blueknow.com">Santiago Ameller</a>
|
16 |
* @since 1.0.0
|
10 |
*
|
11 |
* @category Blueknow
|
12 |
* @package Blueknow_Recommender
|
13 |
+
* @copyright Copyright (c) 2013 Blueknow, S.L. (http://www.blueknow.com)
|
14 |
* @license GNU General Public License
|
15 |
* @author <a href="mailto:santi.ameller@blueknow.com">Santiago Ameller</a>
|
16 |
* @since 1.0.0
|
app/code/community/Blueknow/Recommender/Model/Configuration.php
CHANGED
@@ -10,22 +10,24 @@
|
|
10 |
*
|
11 |
* @category Blueknow
|
12 |
* @package Blueknow_Recommender
|
13 |
-
* @copyright Copyright (c)
|
14 |
* @license GNU General Public License
|
15 |
* @author <a href="mailto:santi.ameller@blueknow.com">Santiago Ameller</a>
|
|
|
16 |
* @since 1.0.0
|
17 |
*
|
18 |
*/
|
19 |
class Blueknow_Recommender_Model_Configuration extends Varien_Object {
|
20 |
|
21 |
/*Configuration XML paths*/
|
22 |
-
|
23 |
const XML_PATH_BLUEKNOW_ENABLED = 'blueknow/recommender/enabled';
|
24 |
const XML_PATH_BLUEKNOW_BK_NUMBER = 'blueknow/recommender/bk_number';
|
25 |
const XML_PATH_BLUEKNOW_CROSS_SELL_ENABLED = 'blueknow/item_to_item/enabled';
|
26 |
const XML_PATH_BLUEKNOW_CROSS_SELL_NOR = 'blueknow/item_to_item/nor';
|
27 |
const XML_PATH_BLUEKNOW_UP_SELL_ENABLED = 'blueknow/item_to_basket/enabled';
|
28 |
const XML_PATH_BLUEKNOW_UP_SELL_NOR = 'blueknow/item_to_basket/nor';
|
|
|
|
|
29 |
|
30 |
/**
|
31 |
* Blueknow Recommender extension descriptor/identifier.
|
@@ -69,6 +71,18 @@ class Blueknow_Recommender_Model_Configuration extends Varien_Object {
|
|
69 |
*/
|
70 |
private $_upSellNOR;
|
71 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
/**
|
73 |
* Base URL where resource are loaded from (JavaScript APIs, logos, and so on).
|
74 |
* @var string
|
@@ -160,6 +174,28 @@ class Blueknow_Recommender_Model_Configuration extends Varien_Object {
|
|
160 |
return $this->_upSellNOR;
|
161 |
}
|
162 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
163 |
/**
|
164 |
* Get base URL where resources are loaded from.
|
165 |
* @return string
|
@@ -211,7 +247,9 @@ class Blueknow_Recommender_Model_Configuration extends Varien_Object {
|
|
211 |
/**
|
212 |
* Get module descriptor.
|
213 |
* @return string
|
|
|
214 |
*/
|
|
|
215 |
public function getDescriptor() {
|
216 |
if (empty($this->_descriptor)) {
|
217 |
$descriptor = Mage::getConfig()->getModuleConfig('Blueknow_Recommender')->version;
|
10 |
*
|
11 |
* @category Blueknow
|
12 |
* @package Blueknow_Recommender
|
13 |
+
* @copyright Copyright (c) 2013 Blueknow, S.L. (http://www.blueknow.com)
|
14 |
* @license GNU General Public License
|
15 |
* @author <a href="mailto:santi.ameller@blueknow.com">Santiago Ameller</a>
|
16 |
+
* @author <a href="mailto:josep.ventura@blueknow.com">Josep M Ventura</a>
|
17 |
* @since 1.0.0
|
18 |
*
|
19 |
*/
|
20 |
class Blueknow_Recommender_Model_Configuration extends Varien_Object {
|
21 |
|
22 |
/*Configuration XML paths*/
|
|
|
23 |
const XML_PATH_BLUEKNOW_ENABLED = 'blueknow/recommender/enabled';
|
24 |
const XML_PATH_BLUEKNOW_BK_NUMBER = 'blueknow/recommender/bk_number';
|
25 |
const XML_PATH_BLUEKNOW_CROSS_SELL_ENABLED = 'blueknow/item_to_item/enabled';
|
26 |
const XML_PATH_BLUEKNOW_CROSS_SELL_NOR = 'blueknow/item_to_item/nor';
|
27 |
const XML_PATH_BLUEKNOW_UP_SELL_ENABLED = 'blueknow/item_to_basket/enabled';
|
28 |
const XML_PATH_BLUEKNOW_UP_SELL_NOR = 'blueknow/item_to_basket/nor';
|
29 |
+
const XML_PATH_BLUEKNOW_HOME_ENABLED = 'blueknow/item_to_user/enabled';
|
30 |
+
const XML_PATH_BLUEKNOW_HOME_NOR = 'blueknow/item_to_user/nor';
|
31 |
|
32 |
/**
|
33 |
* Blueknow Recommender extension descriptor/identifier.
|
71 |
*/
|
72 |
private $_upSellNOR;
|
73 |
|
74 |
+
/**
|
75 |
+
* Home-recommendations-is-enabled flag.
|
76 |
+
* @var bool
|
77 |
+
*/
|
78 |
+
private $_homeEnabled;
|
79 |
+
|
80 |
+
/**
|
81 |
+
* Number of home recommendations to request.
|
82 |
+
* @var number
|
83 |
+
*/
|
84 |
+
private $_homeNOR;
|
85 |
+
|
86 |
/**
|
87 |
* Base URL where resource are loaded from (JavaScript APIs, logos, and so on).
|
88 |
* @var string
|
174 |
return $this->_upSellNOR;
|
175 |
}
|
176 |
|
177 |
+
/**
|
178 |
+
* Get home-is-enabled flag from configuration.
|
179 |
+
* @return bool
|
180 |
+
*/
|
181 |
+
public function isHomeEnabled() {
|
182 |
+
if (empty($this->_homeEnabled)) {
|
183 |
+
$this->_homeEnabled = Mage::getStoreConfigFlag(self::XML_PATH_BLUEKNOW_HOME_ENABLED);
|
184 |
+
}
|
185 |
+
return $this->_homeEnabled;
|
186 |
+
}
|
187 |
+
|
188 |
+
/**
|
189 |
+
* Get number of home recommendations from configuration.
|
190 |
+
* @return number
|
191 |
+
*/
|
192 |
+
public function getHomeNOR() {
|
193 |
+
if (empty($this->_homeNOR)) {
|
194 |
+
$this->_homeNOR = Mage::getStoreConfig(self::XML_PATH_BLUEKNOW_HOME_NOR);
|
195 |
+
}
|
196 |
+
return $this->_homeNOR;
|
197 |
+
}
|
198 |
+
|
199 |
/**
|
200 |
* Get base URL where resources are loaded from.
|
201 |
* @return string
|
247 |
/**
|
248 |
* Get module descriptor.
|
249 |
* @return string
|
250 |
+
* @deprecated
|
251 |
*/
|
252 |
+
//[22-01-2013] MAGPLUGIN-22. Deprecated due not use, using jut location on page.
|
253 |
public function getDescriptor() {
|
254 |
if (empty($this->_descriptor)) {
|
255 |
$descriptor = Mage::getConfig()->getModuleConfig('Blueknow_Recommender')->version;
|
app/code/community/Blueknow/Recommender/Model/Currency.php
CHANGED
@@ -10,7 +10,7 @@
|
|
10 |
*
|
11 |
* @category Blueknow
|
12 |
* @package Blueknow_Recommender
|
13 |
-
* @copyright Copyright (c)
|
14 |
* @license GNU General Public License
|
15 |
* @author <a href="mailto:santi.ameller@blueknow.com">Santiago Ameller</a>
|
16 |
* @since 1.0.0
|
10 |
*
|
11 |
* @category Blueknow
|
12 |
* @package Blueknow_Recommender
|
13 |
+
* @copyright Copyright (c) 2013 Blueknow, S.L. (http://www.blueknow.com)
|
14 |
* @license GNU General Public License
|
15 |
* @author <a href="mailto:santi.ameller@blueknow.com">Santiago Ameller</a>
|
16 |
* @since 1.0.0
|
app/code/community/Blueknow/Recommender/Model/Customer.php
CHANGED
@@ -10,7 +10,7 @@
|
|
10 |
*
|
11 |
* @category Blueknow
|
12 |
* @package Blueknow_Recommender
|
13 |
-
* @copyright Copyright (c)
|
14 |
* @license GNU General Public License
|
15 |
* @author <a href="mailto:santi.ameller@blueknow.com">Santiago Ameller</a>
|
16 |
* @since 1.0.0
|
10 |
*
|
11 |
* @category Blueknow
|
12 |
* @package Blueknow_Recommender
|
13 |
+
* @copyright Copyright (c) 2013 Blueknow, S.L. (http://www.blueknow.com)
|
14 |
* @license GNU General Public License
|
15 |
* @author <a href="mailto:santi.ameller@blueknow.com">Santiago Ameller</a>
|
16 |
* @since 1.0.0
|
app/code/community/Blueknow/Recommender/Model/Observer.php
CHANGED
@@ -10,9 +10,10 @@
|
|
10 |
*
|
11 |
* @category Blueknow
|
12 |
* @package Blueknow_Recommender
|
13 |
-
* @copyright Copyright (c)
|
14 |
* @license GNU General Public License
|
15 |
* @author <a href="mailto:santi.ameller@blueknow.com">Santiago Ameller</a>
|
|
|
16 |
* @since 1.0.0
|
17 |
*
|
18 |
*/
|
@@ -34,6 +35,53 @@ class Blueknow_Recommender_Model_Observer {
|
|
34 |
$this->_getSession()->unsetNewLogin();
|
35 |
}
|
36 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
/**
|
38 |
* Retrieve Blueknow Recommender session object.
|
39 |
* @return Mage_Core_Model_Session_Abstract
|
@@ -41,4 +89,17 @@ class Blueknow_Recommender_Model_Observer {
|
|
41 |
protected function _getSession() {
|
42 |
return Mage::getSingleton('blueknow_recommender/session');
|
43 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
}
|
10 |
*
|
11 |
* @category Blueknow
|
12 |
* @package Blueknow_Recommender
|
13 |
+
* @copyright Copyright (c) 2013 Blueknow, S.L. (http://www.blueknow.com)
|
14 |
* @license GNU General Public License
|
15 |
* @author <a href="mailto:santi.ameller@blueknow.com">Santiago Ameller</a>
|
16 |
+
* @author <a href="mailto:josep.ventura@blueknow.com">Josep M Ventura</a>
|
17 |
* @since 1.0.0
|
18 |
*
|
19 |
*/
|
35 |
$this->_getSession()->unsetNewLogin();
|
36 |
}
|
37 |
|
38 |
+
/**
|
39 |
+
* Discontinue out of stock products
|
40 |
+
*/
|
41 |
+
//[04-01-2013] MAGPLUGIN-19. Discontinue products using platform API on some events.
|
42 |
+
public function discontinueProduct(Varien_Event_Observer $observer) {
|
43 |
+
//Get the order
|
44 |
+
$order= $observer->getEvent()->getOrder();
|
45 |
+
//Retrieve api
|
46 |
+
$api = Mage::getSingleton('blueknow_recommender/platformApiService');
|
47 |
+
foreach ($order->getItemsCollection() as $item) {
|
48 |
+
//Get the remaining stock quantity
|
49 |
+
$stockQuantity = (int)Mage::getModel('cataloginventory/stock_item')->loadByProduct($item->getProductId())->getQty();
|
50 |
+
if ($stockQuantity < 1) {
|
51 |
+
//Discontinue product
|
52 |
+
$api->discontinueProduct($item->getProductId());
|
53 |
+
}
|
54 |
+
}
|
55 |
+
}
|
56 |
+
|
57 |
+
/**
|
58 |
+
* Discontinue deleted product.
|
59 |
+
*/
|
60 |
+
//[04-01-2013] MAGPLUGIN-19. Discontinue products using platform API on some events.
|
61 |
+
public function discontinueDeletedProduct(Varien_Event_Observer $observer) {
|
62 |
+
//Retrieve products from event
|
63 |
+
$productId = $observer->getEvent()->getProduct()->getId();
|
64 |
+
//Discontinue
|
65 |
+
$this->_discontinue($productId);
|
66 |
+
}
|
67 |
+
|
68 |
+
/**
|
69 |
+
* Discontinue disabled product.
|
70 |
+
*/
|
71 |
+
//[04-01-2013] MAGPLUGIN-19. Discontinue products using platform API on some events.
|
72 |
+
public function discontinueDisabledProduct(Varien_Event_Observer $observer) {
|
73 |
+
//Retrieve event
|
74 |
+
$event = $observer->getEvent();
|
75 |
+
//Retrieve the product status
|
76 |
+
$status = $event->getStatus();
|
77 |
+
//Check if it's disabled
|
78 |
+
if ($status == Mage_Catalog_Model_Product_Status::STATUS_DISABLED) {
|
79 |
+
$productId = $event->getProduct()->getId();
|
80 |
+
//Discontinue
|
81 |
+
$this->_discontinue($productId);
|
82 |
+
}
|
83 |
+
}
|
84 |
+
|
85 |
/**
|
86 |
* Retrieve Blueknow Recommender session object.
|
87 |
* @return Mage_Core_Model_Session_Abstract
|
89 |
protected function _getSession() {
|
90 |
return Mage::getSingleton('blueknow_recommender/session');
|
91 |
}
|
92 |
+
|
93 |
+
/**
|
94 |
+
* Retrieve API instance and discontinue product
|
95 |
+
*
|
96 |
+
*/
|
97 |
+
protected function _discontinue($productId) {
|
98 |
+
//Check that we correctly retrieved productId.
|
99 |
+
if (isset($productId)) {
|
100 |
+
//Retrieve api and discontinue
|
101 |
+
$api = Mage::getSingleton('blueknow_recommender/platformApiService');
|
102 |
+
$api->discontinueProduct($productId);
|
103 |
+
}
|
104 |
+
}
|
105 |
}
|
app/code/community/Blueknow/Recommender/Model/PlatformApiService.php
ADDED
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Blueknow Platform Api Service.
|
4 |
+
*
|
5 |
+
* DISCLAIMER
|
6 |
+
*
|
7 |
+
* Do not edit or add to this file if you wish to upgrade Blueknow Recommender
|
8 |
+
* extension to newer versions in the future. If you wish to customize it for
|
9 |
+
* your needs please save your changes before upgrading.
|
10 |
+
*
|
11 |
+
* @category Blueknow
|
12 |
+
* @package Blueknow_Recommender
|
13 |
+
* @copyright Copyright (c) 2013 Blueknow, S.L. (http://www.blueknow.com)
|
14 |
+
* @license GNU General Public License
|
15 |
+
* @author <a href="mailto:josep.ventura@blueknow.com">Josep Maria Ventura</a>
|
16 |
+
* @since 1.2.0
|
17 |
+
*/
|
18 |
+
//[04-01-2013] MAGPLUGIN-19. Discontinue products using platform API.
|
19 |
+
class Blueknow_Recommender_Model_PlatformApiService extends Zend_Rest_Client {
|
20 |
+
|
21 |
+
/**
|
22 |
+
* Define constants and private properties.
|
23 |
+
*/
|
24 |
+
// Basic uri
|
25 |
+
const API_URI = 'https://platformapi.blueknow.com';
|
26 |
+
// Discontinued paths
|
27 |
+
const DISCONTINUED_PATH = '/catalog/discontinue';
|
28 |
+
//Customer stored BK
|
29 |
+
private $_bkNumber;
|
30 |
+
|
31 |
+
/**
|
32 |
+
* Default singleton constructor
|
33 |
+
*/
|
34 |
+
function __construct() {
|
35 |
+
//Create rest client if not done
|
36 |
+
$this->setUri(self::API_URI);
|
37 |
+
//Retrieve BK-Number
|
38 |
+
if (empty($this->_bkNumber)) {
|
39 |
+
$config = Mage::getModel('blueknow_recommender/Configuration');
|
40 |
+
$this->_bkNumber = $config->getBKNumber();
|
41 |
+
}
|
42 |
+
}
|
43 |
+
|
44 |
+
/**
|
45 |
+
* Discontinue product using Platform Api.
|
46 |
+
* @param number $productId
|
47 |
+
*/
|
48 |
+
public function discontinueProduct($productId) {
|
49 |
+
//Create path: GET https://platformapi.blueknow.com/catalog/discontinue/{bknumber}/{productId}
|
50 |
+
$path = self::DISCONTINUED_PATH . "/". $this->_bkNumber . "/" . $productId;
|
51 |
+
$response = $this->restGet($path);
|
52 |
+
}
|
53 |
+
}
|
app/code/community/Blueknow/Recommender/Model/Product.php
CHANGED
@@ -10,9 +10,10 @@
|
|
10 |
*
|
11 |
* @category Blueknow
|
12 |
* @package Blueknow_Recommender
|
13 |
-
* @copyright Copyright (c)
|
14 |
* @license GNU General Public License
|
15 |
* @author <a href="mailto:santi.ameller@blueknow.com">Santiago Ameller</a>
|
|
|
16 |
* @since 1.0.0
|
17 |
*
|
18 |
*/
|
@@ -138,8 +139,8 @@ class Blueknow_Recommender_Model_Product extends Varien_Object {
|
|
138 |
if (empty($this->_imageUrl) && $this->_hasProduct) {
|
139 |
//[2011-03-14] Issue MAGPLUGIN-1: Track cached images to improve loading time of the widget.
|
140 |
//$this->_imageUrl = Mage::helper('catalog/product')->getSmallImageUrl($this->_getProduct()); //it internally deals with no-image products
|
141 |
-
//[2012-
|
142 |
-
$this->_imageUrl = Mage::helper('catalog/image')->init($this->_getProduct(), 'small_image')->resize(
|
143 |
}
|
144 |
return $this->_imageUrl;
|
145 |
}
|
@@ -171,8 +172,10 @@ class Blueknow_Recommender_Model_Product extends Varien_Object {
|
|
171 |
* @return array
|
172 |
*/
|
173 |
public function getCategories() {
|
174 |
-
if (empty($this->_categories)) {
|
175 |
-
|
|
|
|
|
176 |
}
|
177 |
return $this->_categories;
|
178 |
}
|
10 |
*
|
11 |
* @category Blueknow
|
12 |
* @package Blueknow_Recommender
|
13 |
+
* @copyright Copyright (c) 2013 Blueknow, S.L. (http://www.blueknow.com)
|
14 |
* @license GNU General Public License
|
15 |
* @author <a href="mailto:santi.ameller@blueknow.com">Santiago Ameller</a>
|
16 |
+
* @author <a href="mailto:josep.ventura@blueknow.com">Josep M Ventura</a>
|
17 |
* @since 1.0.0
|
18 |
*
|
19 |
*/
|
139 |
if (empty($this->_imageUrl) && $this->_hasProduct) {
|
140 |
//[2011-03-14] Issue MAGPLUGIN-1: Track cached images to improve loading time of the widget.
|
141 |
//$this->_imageUrl = Mage::helper('catalog/product')->getSmallImageUrl($this->_getProduct()); //it internally deals with no-image products
|
142 |
+
//[2012-12-18] Issue MAGPLUGIN-18: Won't fix.
|
143 |
+
$this->_imageUrl = Mage::helper('catalog/image')->init($this->_getProduct(), 'small_image')->resize(135);
|
144 |
}
|
145 |
return $this->_imageUrl;
|
146 |
}
|
172 |
* @return array
|
173 |
*/
|
174 |
public function getCategories() {
|
175 |
+
if (empty($this->_categories) && $this->_hasProduct) {
|
176 |
+
//[13-12-2012] Using new category helper method due to MAGPLUGIN-13.
|
177 |
+
//$this->_categories = Mage::helper('blueknow_recommender/category')->getCategoryPath(); //old implementation
|
178 |
+
$this->_categories = Mage::helper('blueknow_recommender/category')->getPath($this->getIdentifier());
|
179 |
}
|
180 |
return $this->_categories;
|
181 |
}
|
app/code/community/Blueknow/Recommender/Model/Session.php
CHANGED
@@ -10,7 +10,7 @@
|
|
10 |
*
|
11 |
* @category Blueknow
|
12 |
* @package Blueknow_Recommender
|
13 |
-
* @copyright Copyright (c)
|
14 |
* @license GNU General Public License
|
15 |
* @author <a href="mailto:santi.ameller@blueknow.com">Santiago Ameller</a>
|
16 |
* @since 1.0.0
|
10 |
*
|
11 |
* @category Blueknow
|
12 |
* @package Blueknow_Recommender
|
13 |
+
* @copyright Copyright (c) 2013 Blueknow, S.L. (http://www.blueknow.com)
|
14 |
* @license GNU General Public License
|
15 |
* @author <a href="mailto:santi.ameller@blueknow.com">Santiago Ameller</a>
|
16 |
* @since 1.0.0
|
app/code/community/Blueknow/Recommender/Model/Source/Numberofrecommendations.php
CHANGED
@@ -10,7 +10,7 @@
|
|
10 |
*
|
11 |
* @category Blueknow
|
12 |
* @package Blueknow_Recommender
|
13 |
-
* @copyright Copyright (c)
|
14 |
* @license GNU General Public License
|
15 |
* @author <a href="mailto:santi.ameller@blueknow.com">Santiago Ameller</a>
|
16 |
* @since 1.0.0
|
10 |
*
|
11 |
* @category Blueknow
|
12 |
* @package Blueknow_Recommender
|
13 |
+
* @copyright Copyright (c) 2013 Blueknow, S.L. (http://www.blueknow.com)
|
14 |
* @license GNU General Public License
|
15 |
* @author <a href="mailto:santi.ameller@blueknow.com">Santiago Ameller</a>
|
16 |
* @since 1.0.0
|
app/code/community/Blueknow/Recommender/documentation/Blueknow_Recommender_1.1.1_Gui/314/201a_de_Instalacio/314/201n.pdf
DELETED
Binary file
|
app/code/community/Blueknow/Recommender/documentation/Blueknow_Recommender_1.1.1_Installation_Guide.pdf
DELETED
Binary file
|
app/code/community/Blueknow/Recommender/documentation/Blueknow_Recommender_1.2.0_Guia_de_Instalacion.pdf
ADDED
Binary file
|
app/code/community/Blueknow/Recommender/documentation/Blueknow_Recommender_1.2.0_Guide_Installation.pdf
ADDED
Binary file
|
app/code/community/Blueknow/Recommender/documentation/Blueknow_Recommender_1.2.0_Installation_Guide.pdf
ADDED
Binary file
|
app/code/community/Blueknow/Recommender/documentation/README.txt
CHANGED
@@ -12,7 +12,7 @@ About the module
|
|
12 |
|
13 |
* Name: Blueknow Recommender for Magento eCommerce platform (v1.3.x or higher).
|
14 |
* Description: Personalized product recommendations for your eCommerce: cross-sell and up-sell.
|
15 |
-
* Version: 1.
|
16 |
|
17 |
NOTE: this module has been successfully tested on Magento 1.3.x or higher. If your eCommerce runs under an older version, please contact with us at support@blueknow.com.
|
18 |
|
@@ -35,17 +35,14 @@ How to install
|
|
35 |
> Magento 1.4.x (or lower): magento-community/BlueknowRecommender (Magento Connect 1.0).
|
36 |
> Magento 1.5.x (or higher): http://connect20.magentocommerce.com/community/BlueknowRecommender (Magento Connect 2.0).
|
37 |
|
38 |
-
Modify the shopping cart template of your Magento installation:
|
39 |
-
|
40 |
-
1. Affected file: app/design/frontend/default/defaul/template/checkout/cart.phtml.
|
41 |
-
2. Code to be added (feel free with its location): <?php echo $this->getChildHtml('blueknow.cart.recommender.widget') ?>
|
42 |
-
|
43 |
After installing the extension, you will need to configure it from your Magento's Admin Panel: System > Configuration > Services > Blueknow Recommender.
|
44 |
|
45 |
Optionally, you can review the default recommendations widget template provided for changing it according your needs:
|
46 |
|
47 |
1. Template for product detail cross-sell recommendations widget .... %MAGENTO_HOME%/app/design/frontend/default/default/template/blueknow/product/recommender_widget.phtml.
|
48 |
2. Template for shopping cart up-sell recommendations widget ........ %MAGENTO_HOME%/app/design/frontend/default/default/template/blueknow/cart/recommender_widget.phtml.
|
|
|
|
|
49 |
|
50 |
Once configuration is complete, Blueknow Tracker will start tracking behavioral events (visits, purchases...) and 24 hours later your clients
|
51 |
will be receiving personalized recommendations.
|
@@ -56,6 +53,23 @@ How to install
|
|
56 |
Change log
|
57 |
==========
|
58 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
Version 1.1.1
|
60 |
-------------
|
61 |
|
12 |
|
13 |
* Name: Blueknow Recommender for Magento eCommerce platform (v1.3.x or higher).
|
14 |
* Description: Personalized product recommendations for your eCommerce: cross-sell and up-sell.
|
15 |
+
* Version: 1.2.0.
|
16 |
|
17 |
NOTE: this module has been successfully tested on Magento 1.3.x or higher. If your eCommerce runs under an older version, please contact with us at support@blueknow.com.
|
18 |
|
35 |
> Magento 1.4.x (or lower): magento-community/BlueknowRecommender (Magento Connect 1.0).
|
36 |
> Magento 1.5.x (or higher): http://connect20.magentocommerce.com/community/BlueknowRecommender (Magento Connect 2.0).
|
37 |
|
|
|
|
|
|
|
|
|
|
|
38 |
After installing the extension, you will need to configure it from your Magento's Admin Panel: System > Configuration > Services > Blueknow Recommender.
|
39 |
|
40 |
Optionally, you can review the default recommendations widget template provided for changing it according your needs:
|
41 |
|
42 |
1. Template for product detail cross-sell recommendations widget .... %MAGENTO_HOME%/app/design/frontend/default/default/template/blueknow/product/recommender_widget.phtml.
|
43 |
2. Template for shopping cart up-sell recommendations widget ........ %MAGENTO_HOME%/app/design/frontend/default/default/template/blueknow/cart/recommender_widget.phtml.
|
44 |
+
3. Template for home page personalized recommendations widget ....... %MAGENTO_HOME%/app/design/frontend/default/default/template/blueknow/home/recommender_widget.phtml.
|
45 |
+
4. Blueknow widgets styles sheet .................................... %MAGENTO_HOME%/skin/frontend/base/default/css/blueknow_widget.css.
|
46 |
|
47 |
Once configuration is complete, Blueknow Tracker will start tracking behavioral events (visits, purchases...) and 24 hours later your clients
|
48 |
will be receiving personalized recommendations.
|
53 |
Change log
|
54 |
==========
|
55 |
|
56 |
+
Version 1.2.0
|
57 |
+
-------------
|
58 |
+
|
59 |
+
Stable version including new functionalities and some bugs fixed.
|
60 |
+
|
61 |
+
+ [MAGPLUGIN-12] - Add item-to-user recommendations in the homepage
|
62 |
+
+ [MAGPLUGIN-13] - Retrieve the correct category path when a product is accessed from the homepage.
|
63 |
+
+ [MAGPLUGIN-14] - Track event purchased according to the shipping method selected, single or multi.
|
64 |
+
+ [MAGPLUGIN-15] - Set cross-sell template without manually add into Magento Core cart template.
|
65 |
+
+ [MAGPLUGIN-16] - Externalize JavaScript/CSS code as static extension resources.
|
66 |
+
+ [MAGPLUGIN-17] - Track event discontinued from product-not-found page.
|
67 |
+
+ [MAGPLUGIN-18] - Add a configurable property for product thumbnail size in extension configuration form (won't fix).
|
68 |
+
+ [MAGPLUGIN-19] - Discontinue products using the Blueknow Platform API.
|
69 |
+
+ [MAGPLUGIN-20] - Format product price in widget display.
|
70 |
+
+ [MAGPLUGIN-21] - Item-to-basket recommendations and configurable products: parent and child products are included.
|
71 |
+
+ [MAGPLUGIN-22] - Apply new clicked event strategy.
|
72 |
+
|
73 |
Version 1.1.1
|
74 |
-------------
|
75 |
|
app/code/community/Blueknow/Recommender/etc/config.xml
CHANGED
@@ -10,9 +10,10 @@
|
|
10 |
* your needs please save your changes before upgrading.
|
11 |
*
|
12 |
* @category Blueknow
|
13 |
-
* @copyright Copyright (c)
|
14 |
* @license GNU General Public License
|
15 |
* @author <a href="mailto:santi.ameller@blueknow.com">Santiago Ameller</a>
|
|
|
16 |
* @since 1.0.0
|
17 |
*
|
18 |
*/
|
@@ -20,7 +21,7 @@
|
|
20 |
<config>
|
21 |
<modules>
|
22 |
<Blueknow_Recommender>
|
23 |
-
<version>1.
|
24 |
</Blueknow_Recommender>
|
25 |
</modules>
|
26 |
<global>
|
@@ -42,20 +43,30 @@
|
|
42 |
</global>
|
43 |
<default>
|
44 |
<blueknow>
|
45 |
-
<recommender>
|
46 |
-
<enabled>1</enabled>
|
47 |
-
</recommender>
|
48 |
<item_to_item>
|
49 |
<enabled>1</enabled>
|
50 |
<nor>4</nor>
|
51 |
</item_to_item>
|
52 |
<item_to_basket>
|
53 |
<enabled>1</enabled>
|
54 |
-
<nor>
|
55 |
</item_to_basket>
|
|
|
|
|
|
|
|
|
56 |
</blueknow>
|
57 |
</default>
|
58 |
<frontend>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
<layout>
|
60 |
<updates>
|
61 |
<blueknow_recommender>
|
@@ -63,15 +74,6 @@
|
|
63 |
</blueknow_recommender>
|
64 |
</updates>
|
65 |
</layout>
|
66 |
-
<translate>
|
67 |
-
<modules>
|
68 |
-
<blueknow_recommender>
|
69 |
-
<files>
|
70 |
-
<default>Blueknow_Recommender.csv</default>
|
71 |
-
</files>
|
72 |
-
</blueknow_recommender>
|
73 |
-
</modules>
|
74 |
-
</translate>
|
75 |
<events>
|
76 |
<customer_login>
|
77 |
<observers>
|
@@ -85,15 +87,46 @@
|
|
85 |
<customer_login_tracked>
|
86 |
<observers>
|
87 |
<blueknow_recommender_customer_login_tracker>
|
88 |
-
<type>
|
89 |
<class>Blueknow_Recommender_Model_Observer</class>
|
90 |
<method>unsetNewLoginAfterTracking</method>
|
91 |
</blueknow_recommender_customer_login_tracker>
|
92 |
</observers>
|
93 |
</customer_login_tracked>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
94 |
</events>
|
95 |
</frontend>
|
96 |
<adminhtml>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
97 |
<acl>
|
98 |
<resources>
|
99 |
<admin>
|
10 |
* your needs please save your changes before upgrading.
|
11 |
*
|
12 |
* @category Blueknow
|
13 |
+
* @copyright Copyright (c) 2013 Blueknow, S.L. (http://www.blueknow.com)
|
14 |
* @license GNU General Public License
|
15 |
* @author <a href="mailto:santi.ameller@blueknow.com">Santiago Ameller</a>
|
16 |
+
* @author <a href="mailto:josep.ventura@blueknow.com">Josep M Ventura</a>
|
17 |
* @since 1.0.0
|
18 |
*
|
19 |
*/
|
21 |
<config>
|
22 |
<modules>
|
23 |
<Blueknow_Recommender>
|
24 |
+
<version>1.2.0</version>
|
25 |
</Blueknow_Recommender>
|
26 |
</modules>
|
27 |
<global>
|
43 |
</global>
|
44 |
<default>
|
45 |
<blueknow>
|
|
|
|
|
|
|
46 |
<item_to_item>
|
47 |
<enabled>1</enabled>
|
48 |
<nor>4</nor>
|
49 |
</item_to_item>
|
50 |
<item_to_basket>
|
51 |
<enabled>1</enabled>
|
52 |
+
<nor>6</nor>
|
53 |
</item_to_basket>
|
54 |
+
<item_to_user>
|
55 |
+
<enabled>1</enabled>
|
56 |
+
<nor>6</nor>
|
57 |
+
</item_to_user>
|
58 |
</blueknow>
|
59 |
</default>
|
60 |
<frontend>
|
61 |
+
<translate>
|
62 |
+
<modules>
|
63 |
+
<blueknow_recommender>
|
64 |
+
<files>
|
65 |
+
<default>Blueknow_Recommender.csv</default>
|
66 |
+
</files>
|
67 |
+
</blueknow_recommender>
|
68 |
+
</modules>
|
69 |
+
</translate>
|
70 |
<layout>
|
71 |
<updates>
|
72 |
<blueknow_recommender>
|
74 |
</blueknow_recommender>
|
75 |
</updates>
|
76 |
</layout>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
<events>
|
78 |
<customer_login>
|
79 |
<observers>
|
87 |
<customer_login_tracked>
|
88 |
<observers>
|
89 |
<blueknow_recommender_customer_login_tracker>
|
90 |
+
<type>singleton</type>
|
91 |
<class>Blueknow_Recommender_Model_Observer</class>
|
92 |
<method>unsetNewLoginAfterTracking</method>
|
93 |
</blueknow_recommender_customer_login_tracker>
|
94 |
</observers>
|
95 |
</customer_login_tracked>
|
96 |
+
<sales_order_save_after>
|
97 |
+
<observers>
|
98 |
+
<blueknow_recommender_discontinued>
|
99 |
+
<type>singleton</type>
|
100 |
+
<class>Blueknow_Recommender_Model_Observer</class>
|
101 |
+
<method>discontinueProduct</method>
|
102 |
+
</blueknow_recommender_discontinued>
|
103 |
+
</observers>
|
104 |
+
</sales_order_save_after>
|
105 |
</events>
|
106 |
</frontend>
|
107 |
<adminhtml>
|
108 |
+
<events>
|
109 |
+
<!--
|
110 |
+
<catalog_product_status_update>
|
111 |
+
<observers>
|
112 |
+
<blueknow_recommender_disable_discontinue>
|
113 |
+
<type>singleton</type>
|
114 |
+
<class>Blueknow_Recommender_Model_Observer</class>
|
115 |
+
<method>discontinueDisabledProduct</method>
|
116 |
+
</blueknow_recommender_disable_discontinue>
|
117 |
+
</observers>
|
118 |
+
</catalog_product_status_update>
|
119 |
+
-->
|
120 |
+
<catalog_product_delete_before>
|
121 |
+
<observers>
|
122 |
+
<blueknow_recommender_delete_discontinue>
|
123 |
+
<type>singleton</type>
|
124 |
+
<class>Blueknow_Recommender_Model_Observer</class>
|
125 |
+
<method>discontinueDeletedProduct</method>
|
126 |
+
</blueknow_recommender_delete_discontinue>
|
127 |
+
</observers>
|
128 |
+
</catalog_product_delete_before>
|
129 |
+
</events>
|
130 |
<acl>
|
131 |
<resources>
|
132 |
<admin>
|
app/code/community/Blueknow/Recommender/etc/system.xml
CHANGED
@@ -10,9 +10,10 @@
|
|
10 |
* your needs please save your changes before upgrading.
|
11 |
*
|
12 |
* @category Blueknow
|
13 |
-
* @copyright Copyright (c)
|
14 |
* @license GNU General Public License
|
15 |
* @author <a href="mailto:santi.ameller@blueknow.com">Santiago Ameller</a>
|
|
|
16 |
* @since 1.0.0
|
17 |
*
|
18 |
*/
|
@@ -128,6 +129,36 @@
|
|
128 |
</nor>
|
129 |
</fields>
|
130 |
</item_to_basket>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
131 |
</groups>
|
132 |
</blueknow>
|
133 |
</sections>
|
10 |
* your needs please save your changes before upgrading.
|
11 |
*
|
12 |
* @category Blueknow
|
13 |
+
* @copyright Copyright (c) 2013 Blueknow, S.L. (http://www.blueknow.com)
|
14 |
* @license GNU General Public License
|
15 |
* @author <a href="mailto:santi.ameller@blueknow.com">Santiago Ameller</a>
|
16 |
+
* @author <a href="mailto:josep.ventura@blueknow.com">Josep M Ventura</a>
|
17 |
* @since 1.0.0
|
18 |
*
|
19 |
*/
|
129 |
</nor>
|
130 |
</fields>
|
131 |
</item_to_basket>
|
132 |
+
<item_to_user translate="label">
|
133 |
+
<label>Home recommendations</label>
|
134 |
+
<frontend_type>text</frontend_type>
|
135 |
+
<sort_order>40</sort_order>
|
136 |
+
<show_in_default>1</show_in_default>
|
137 |
+
<show_in_website>1</show_in_website>
|
138 |
+
<show_in_store>1</show_in_store>
|
139 |
+
<fields>
|
140 |
+
<enabled translate="label,comment">
|
141 |
+
<label>Enable</label>
|
142 |
+
<comment><![CDATA[Activate/Deactivate recommendations in home page.]]></comment>
|
143 |
+
<frontend_type>select</frontend_type>
|
144 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
145 |
+
<sort_order>10</sort_order>
|
146 |
+
<show_in_default>1</show_in_default>
|
147 |
+
<show_in_website>1</show_in_website>
|
148 |
+
<show_in_store>1</show_in_store>
|
149 |
+
</enabled>
|
150 |
+
<nor translate="label,comment">
|
151 |
+
<label>Recommendations</label>
|
152 |
+
<comment><![CDATA[Number of recommendations to show in home page.]]></comment>
|
153 |
+
<frontend_type>select</frontend_type>
|
154 |
+
<source_model>blueknow_recommender/source_numberofrecommendations</source_model>
|
155 |
+
<sort_order>20</sort_order>
|
156 |
+
<show_in_default>1</show_in_default>
|
157 |
+
<show_in_website>1</show_in_website>
|
158 |
+
<show_in_store>1</show_in_store>
|
159 |
+
</nor>
|
160 |
+
</fields>
|
161 |
+
</item_to_user>
|
162 |
</groups>
|
163 |
</blueknow>
|
164 |
</sections>
|
app/code/community/Blueknow/Recommender/sql/recommender_setup/uninstall.sql
CHANGED
@@ -8,7 +8,7 @@
|
|
8 |
* your needs please save your changes before upgrading.
|
9 |
*
|
10 |
* @category Blueknow
|
11 |
-
* @copyright Copyright (c)
|
12 |
* @license GNU General Public License
|
13 |
* @author <a href="mailto:santi.ameller@blueknow.com">Santiago Ameller</a>
|
14 |
* @since 1.0.0
|
8 |
* your needs please save your changes before upgrading.
|
9 |
*
|
10 |
* @category Blueknow
|
11 |
+
* @copyright Copyright (c) 2013 Blueknow, S.L. (http://www.blueknow.com)
|
12 |
* @license GNU General Public License
|
13 |
* @author <a href="mailto:santi.ameller@blueknow.com">Santiago Ameller</a>
|
14 |
* @since 1.0.0
|
app/design/adminhtml/default/default/layout/blueknow_recommender.xml
CHANGED
@@ -10,7 +10,7 @@
|
|
10 |
* your needs please save your changes before upgrading.
|
11 |
*
|
12 |
* @category design
|
13 |
-
* @copyright Copyright (c)
|
14 |
* @license GNU General Public License
|
15 |
* @author <a href="mailto:santi.ameller@blueknow.com">Santiago Ameller</a>
|
16 |
* @since 1.0.1
|
10 |
* your needs please save your changes before upgrading.
|
11 |
*
|
12 |
* @category design
|
13 |
+
* @copyright Copyright (c) 2013 Blueknow, S.L. (http://www.blueknow.com)
|
14 |
* @license GNU General Public License
|
15 |
* @author <a href="mailto:santi.ameller@blueknow.com">Santiago Ameller</a>
|
16 |
* @since 1.0.1
|
app/design/frontend/default/default/layout/blueknow_recommender.xml
CHANGED
@@ -10,9 +10,10 @@
|
|
10 |
* your needs please save your changes before upgrading.
|
11 |
*
|
12 |
* @category design
|
13 |
-
* @copyright Copyright (c)
|
14 |
* @license GNU General Public License
|
15 |
* @author <a href="mailto:santi.ameller@blueknow.com">Santiago Ameller</a>
|
|
|
16 |
* @since 1.0.0
|
17 |
*
|
18 |
*/
|
@@ -23,32 +24,56 @@
|
|
23 |
<block type="blueknow_recommender/customer_tracker" name="blueknow.customer.tracker" as="customer_tracker" template="blueknow/customer/tracker.phtml" />
|
24 |
</reference>
|
25 |
</default>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
<catalog_product_view>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
<reference name="content">
|
28 |
<reference name="product.info.additional">
|
29 |
<block before="-" type="blueknow_recommender/product_recommender" name="blueknow.product.recommender.widget" as="product_recommender_widget" template="blueknow/product/recommender_widget.phtml">
|
30 |
<block type="blueknow_recommender/base" name="blueknow.product.recommender.widget.footer" as="product_recommender_widget_footer" template="blueknow/common/recommender_widget_footer.phtml" />
|
31 |
</block>
|
32 |
-
</reference>
|
33 |
-
<block type="page/html" name="blueknow.product.recommender.renderer" as="product_recommender_renderer" template="blueknow/common/recommender_renderer.phtml" />
|
34 |
<block type="blueknow_recommender/product_recommender" name="blueknow.product.recommender" as="product_recommender" template="blueknow/product/recommender.phtml" />
|
35 |
<block type="blueknow_recommender/product_tracker" name="blueknow.product.tracker" as="product_tracker" template="blueknow/product/tracker.phtml" />
|
36 |
</reference>
|
37 |
</catalog_product_view>
|
38 |
<checkout_cart_index>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
<reference name="content">
|
40 |
<reference name="checkout.cart">
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
Code to add: <?php echo $this->getChildHtml('blueknow.cart.recommender.widget') ?>
|
45 |
-
IMPORTANT NOTE: not compatible with Magento v1.1.x.
|
46 |
-
-->
|
47 |
-
<block type="blueknow_recommender/cart_recommender" name="blueknow.cart.recommender.widget" template="blueknow/cart/recommender_widget.phtml">
|
48 |
<block type="blueknow_recommender/base" name="blueknow.cart.recommender.widget.footer" as="cart_recommender_widget_footer" template="blueknow/common/recommender_widget_footer.phtml" />
|
49 |
</block>
|
50 |
</reference>
|
51 |
-
<block type="page/html" name="blueknow.cart.recommender.renderer" as="cart_recommender_renderer" template="blueknow/common/recommender_renderer.phtml" />
|
52 |
<block type="blueknow_recommender/cart_recommender" name="blueknow.cart.recommender" as="cart_recommender" template="blueknow/cart/recommender.phtml" />
|
53 |
</reference>
|
54 |
</checkout_cart_index>
|
@@ -62,4 +87,10 @@
|
|
62 |
<block type="blueknow_recommender/checkout_tracker" name="blueknow.checkout.multishipping.tracker" as="checkout_multishipping_tracker" template="blueknow/checkout/tracker.phtml" />
|
63 |
</reference>
|
64 |
</checkout_multishipping_success>
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
</layout>
|
10 |
* your needs please save your changes before upgrading.
|
11 |
*
|
12 |
* @category design
|
13 |
+
* @copyright Copyright (c) 2013 Blueknow, S.L. (http://www.blueknow.com)
|
14 |
* @license GNU General Public License
|
15 |
* @author <a href="mailto:santi.ameller@blueknow.com">Santiago Ameller</a>
|
16 |
+
* @author <a href="mailto:josep.ventura@blueknow.com">Josep M Ventura</a>
|
17 |
* @since 1.0.0
|
18 |
*
|
19 |
*/
|
24 |
<block type="blueknow_recommender/customer_tracker" name="blueknow.customer.tracker" as="customer_tracker" template="blueknow/customer/tracker.phtml" />
|
25 |
</reference>
|
26 |
</default>
|
27 |
+
<!-- Home page -->
|
28 |
+
<cms_index_index>
|
29 |
+
<reference name="head">
|
30 |
+
<action method="addCss"><stylesheet>css/blueknow_recommender/blueknow_widget.css</stylesheet></action>
|
31 |
+
<action method="addItem">
|
32 |
+
<type>skin_js</type>
|
33 |
+
<name>js/blueknow_recommender/blueknow_recommender.min.js</name>
|
34 |
+
</action>
|
35 |
+
</reference>
|
36 |
+
<reference name="content">
|
37 |
+
<block type="blueknow_recommender/home_recommender" name="blueknow.home.recommender.widget" as="home_recommender_widget" template="blueknow/home/recommender_widget.phtml">
|
38 |
+
<block type="blueknow_recommender/base" name="blueknow.home.recommender.widget.footer" as="product_recommender_widget_footer" template="blueknow/common/recommender_widget_footer.phtml" />
|
39 |
+
</block>
|
40 |
+
<block type="blueknow_recommender/home_recommender" name="blueknow.home.recommender" as="home_recommender" template="blueknow/home/recommender.phtml" />
|
41 |
+
</reference>
|
42 |
+
</cms_index_index>
|
43 |
<catalog_product_view>
|
44 |
+
<reference name="head">
|
45 |
+
<action method="addCss"><stylesheet>css/blueknow_recommender/blueknow_widget.css</stylesheet></action>
|
46 |
+
<action method="addItem">
|
47 |
+
<type>skin_js</type>
|
48 |
+
<name>js/blueknow_recommender/blueknow_recommender.min.js</name>
|
49 |
+
</action>
|
50 |
+
</reference>
|
51 |
<reference name="content">
|
52 |
<reference name="product.info.additional">
|
53 |
<block before="-" type="blueknow_recommender/product_recommender" name="blueknow.product.recommender.widget" as="product_recommender_widget" template="blueknow/product/recommender_widget.phtml">
|
54 |
<block type="blueknow_recommender/base" name="blueknow.product.recommender.widget.footer" as="product_recommender_widget_footer" template="blueknow/common/recommender_widget_footer.phtml" />
|
55 |
</block>
|
56 |
+
</reference>
|
|
|
57 |
<block type="blueknow_recommender/product_recommender" name="blueknow.product.recommender" as="product_recommender" template="blueknow/product/recommender.phtml" />
|
58 |
<block type="blueknow_recommender/product_tracker" name="blueknow.product.tracker" as="product_tracker" template="blueknow/product/tracker.phtml" />
|
59 |
</reference>
|
60 |
</catalog_product_view>
|
61 |
<checkout_cart_index>
|
62 |
+
<reference name="head">
|
63 |
+
<action method="addCss"><stylesheet>css/blueknow_recommender/blueknow_widget.css</stylesheet></action>
|
64 |
+
<action method="addItem">
|
65 |
+
<type>skin_js</type>
|
66 |
+
<name>js/blueknow_recommender/blueknow_recommender.min.js</name>
|
67 |
+
</action>
|
68 |
+
</reference>
|
69 |
<reference name="content">
|
70 |
<reference name="checkout.cart">
|
71 |
+
<remove name="checkout.cart.crosssell"/>
|
72 |
+
<!-- [2013-01-01] MAGPLUGIN-15. Not necessary to add code to the cart. -->
|
73 |
+
<block type="blueknow_recommender/cart_recommender" name="blueknow.cart.recommender.widget" as="crosssell" template="blueknow/cart/recommender_widget.phtml">
|
|
|
|
|
|
|
|
|
74 |
<block type="blueknow_recommender/base" name="blueknow.cart.recommender.widget.footer" as="cart_recommender_widget_footer" template="blueknow/common/recommender_widget_footer.phtml" />
|
75 |
</block>
|
76 |
</reference>
|
|
|
77 |
<block type="blueknow_recommender/cart_recommender" name="blueknow.cart.recommender" as="cart_recommender" template="blueknow/cart/recommender.phtml" />
|
78 |
</reference>
|
79 |
</checkout_cart_index>
|
87 |
<block type="blueknow_recommender/checkout_tracker" name="blueknow.checkout.multishipping.tracker" as="checkout_multishipping_tracker" template="blueknow/checkout/tracker.phtml" />
|
88 |
</reference>
|
89 |
</checkout_multishipping_success>
|
90 |
+
<!-- 404 page -->
|
91 |
+
<cms_index_noroute>
|
92 |
+
<reference name="content">
|
93 |
+
<block type="blueknow_recommender/product_notFound_tracker" name="blueknow.product.notFound" as="discontinued_product_not_found" template="blueknow/product/notFound/tracker.phtml" />
|
94 |
+
</reference>
|
95 |
+
</cms_index_noroute>
|
96 |
</layout>
|
app/design/frontend/default/default/template/blueknow/cart/recommender.phtml
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* your needs please save your changes before upgrading.
|
10 |
*
|
11 |
* @category design
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @license GNU General Public License
|
14 |
* @author <a href="mailto:santi.ameller@blueknow.com">Santiago Ameller</a>
|
15 |
* @since 1.0.0
|
@@ -33,5 +33,5 @@
|
|
33 |
<?php foreach ($this->getCart()->getProducts() as $bProduct) { ?>
|
34 |
i2b_products.push('<?php echo $bProduct ?>');
|
35 |
<?php } //eof foreach ?>
|
36 |
-
rec.item2basket('
|
37 |
</script>
|
9 |
* your needs please save your changes before upgrading.
|
10 |
*
|
11 |
* @category design
|
12 |
+
* @copyright Copyright (c) 2013 Blueknow, S.L. (http://www.blueknow.com)
|
13 |
* @license GNU General Public License
|
14 |
* @author <a href="mailto:santi.ameller@blueknow.com">Santiago Ameller</a>
|
15 |
* @since 1.0.0
|
33 |
<?php foreach ($this->getCart()->getProducts() as $bProduct) { ?>
|
34 |
i2b_products.push('<?php echo $bProduct ?>');
|
35 |
<?php } //eof foreach ?>
|
36 |
+
rec.item2basket('cart', i2b_products, i2b_properties);
|
37 |
</script>
|
app/design/frontend/default/default/template/blueknow/cart/recommender_widget.phtml
CHANGED
@@ -9,50 +9,15 @@
|
|
9 |
* your needs please save your changes before upgrading.
|
10 |
*
|
11 |
* @category design
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @license GNU General Public License
|
14 |
* @author <a href="mailto:santi.ameller@blueknow.com">Santiago Ameller</a>
|
|
|
15 |
* @since 1.0.0
|
16 |
*
|
17 |
*/
|
18 |
?>
|
19 |
-
<style type="text/css">
|
20 |
-
|
21 |
-
#blueknow-widget {
|
22 |
-
margin-top: 20px;
|
23 |
-
}
|
24 |
-
|
25 |
-
#blueknow-widget h2 {
|
26 |
-
font-weight: bold;
|
27 |
-
font-size: 15px;
|
28 |
-
color: #e26703;
|
29 |
-
}
|
30 |
-
|
31 |
-
.blueknow-products-grid {
|
32 |
-
float: left;
|
33 |
-
width: 126px !important;
|
34 |
-
height: 235px;
|
35 |
-
background-color: #fafaec;
|
36 |
-
border: 1px solid #e5dcc3;
|
37 |
-
}
|
38 |
-
|
39 |
-
.blueknow-product {
|
40 |
-
padding: 10px;
|
41 |
-
}
|
42 |
-
|
43 |
-
.blueknow-product-image {
|
44 |
-
width: 110px !important;
|
45 |
-
height: 110px !important;
|
46 |
-
}
|
47 |
-
|
48 |
-
.blueknow-product img {
|
49 |
-
border:1px solid #e5dcc3;
|
50 |
-
}
|
51 |
-
|
52 |
-
</style>
|
53 |
-
|
54 |
<div id="blueknow-widget"></div>
|
55 |
-
|
56 |
<?php $bConfiguration = $this->getConfig(); ?>
|
57 |
|
58 |
<script id="blueknow-header" type="text/x-blueknow-template">
|
@@ -65,12 +30,15 @@
|
|
65 |
// Additionally, <img /> tag has been changed to avoid unexpected requests ("src" was replaced by "source").
|
66 |
?>
|
67 |
<script id="blueknow-template" type="text/x-blueknow-template">
|
68 |
-
<div class="products-grid blueknow-products-grid">
|
69 |
<div class="blueknow-product">
|
70 |
-
<a href="$url" title="$name" class="product-image blueknow-product-image"
|
|
|
71 |
<img source="$image" alt="$name" title="$name" width="100" height="100" hspace="0" vspace="0" border="0" />
|
72 |
</a>
|
73 |
-
<h3 class="product-name"><a href="$url" title="$name"
|
|
|
|
|
74 |
<div class="price-box">
|
75 |
<span class="regular-price">
|
76 |
<span class="price">$price <?php echo $bConfiguration->getCurrentCurrency()->getSymbol() ?></span>
|
9 |
* your needs please save your changes before upgrading.
|
10 |
*
|
11 |
* @category design
|
12 |
+
* @copyright Copyright (c) 2013 Blueknow, S.L. (http://www.blueknow.com)
|
13 |
* @license GNU General Public License
|
14 |
* @author <a href="mailto:santi.ameller@blueknow.com">Santiago Ameller</a>
|
15 |
+
* @author <a href="mailto:josep.ventura@blueknow.com">Josep M Ventura</a>
|
16 |
* @since 1.0.0
|
17 |
*
|
18 |
*/
|
19 |
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
<div id="blueknow-widget"></div>
|
|
|
21 |
<?php $bConfiguration = $this->getConfig(); ?>
|
22 |
|
23 |
<script id="blueknow-header" type="text/x-blueknow-template">
|
30 |
// Additionally, <img /> tag has been changed to avoid unexpected requests ("src" was replaced by "source").
|
31 |
?>
|
32 |
<script id="blueknow-template" type="text/x-blueknow-template">
|
33 |
+
<div class="products-grid blueknow-cart-products-grid">
|
34 |
<div class="blueknow-product">
|
35 |
+
<a href="$url" title="$name" class="product-image blueknow-cart-product-image"
|
36 |
+
onclick="try { rec.onclick('$id','item2basket','cart');} catch(err) {};">
|
37 |
<img source="$image" alt="$name" title="$name" width="100" height="100" hspace="0" vspace="0" border="0" />
|
38 |
</a>
|
39 |
+
<h3 class="product-name"><a href="$url" title="$name"
|
40 |
+
onclick="try { rec.onclick('$id','item2basket','cart');} catch(err) {};">
|
41 |
+
$name</a></h3>
|
42 |
<div class="price-box">
|
43 |
<span class="regular-price">
|
44 |
<span class="price">$price <?php echo $bConfiguration->getCurrentCurrency()->getSymbol() ?></span>
|
app/design/frontend/default/default/template/blueknow/checkout/tracker.phtml
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* your needs please save your changes before upgrading.
|
10 |
*
|
11 |
* @category design
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @license GNU General Public License
|
14 |
* @author <a href="mailto:santi.ameller@blueknow.com">Santiago Ameller</a>
|
15 |
* @since 1.0.0
|
9 |
* your needs please save your changes before upgrading.
|
10 |
*
|
11 |
* @category design
|
12 |
+
* @copyright Copyright (c) 2013 Blueknow, S.L. (http://www.blueknow.com)
|
13 |
* @license GNU General Public License
|
14 |
* @author <a href="mailto:santi.ameller@blueknow.com">Santiago Ameller</a>
|
15 |
* @since 1.0.0
|
app/design/frontend/default/default/template/blueknow/common/recommender_renderer.phtml
DELETED
@@ -1,55 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Basic template (Mage_Page_Block_Html).
|
4 |
-
*
|
5 |
-
* DISCLAIMER
|
6 |
-
*
|
7 |
-
* Do not edit or add to this file if you wish to upgrade Blueknow Recommender
|
8 |
-
* extension to newer versions in the future. If you wish to customize it for
|
9 |
-
* your needs please save your changes before upgrading.
|
10 |
-
*
|
11 |
-
* @category design
|
12 |
-
* @copyright Copyright (c) 2010 Blueknow, S.L. (http://www.blueknow.com)
|
13 |
-
* @license GNU General Public License
|
14 |
-
* @author <a href="mailto:santi.ameller@blueknow.com">Santiago Ameller</a>
|
15 |
-
* @since 1.0.0
|
16 |
-
*
|
17 |
-
*/
|
18 |
-
?>
|
19 |
-
<script type="text/javascript">
|
20 |
-
//success function
|
21 |
-
function renderItems(items) {
|
22 |
-
if (items.length > 0) {
|
23 |
-
var widget = "";
|
24 |
-
var header = document.getElementById("blueknow-header");
|
25 |
-
widget += header ? header.innerHTML : "";
|
26 |
-
for (var i=0; i < items.length; i++) {
|
27 |
-
var item = items[i];
|
28 |
-
var templateHolder = document.getElementById("blueknow-template");
|
29 |
-
if (!templateHolder) {
|
30 |
-
break;
|
31 |
-
}
|
32 |
-
var template = templateHolder.innerHTML;
|
33 |
-
<?php
|
34 |
-
//[2011-03-14] Issue MAGPLUGIN-3: Unexpected page loading whenever widget is rendered.
|
35 |
-
// Header mark of any string-to-replace has been changed from "#" to "$".
|
36 |
-
// Additionally, <img /> tag has been changed to avoid unexpected requests ("src" was replaced by "source").
|
37 |
-
?>
|
38 |
-
template = template.replace(/\$name/g, item.name);
|
39 |
-
template = template.replace(/\$url/g, item.url);
|
40 |
-
template = template.replace(/source="\$image"/g, "src='" + item.image + "'");
|
41 |
-
<?php //TODO workaround: no decimals in some cases ?>
|
42 |
-
template = template.replace(/\$price/g, item.price);
|
43 |
-
widget += template;
|
44 |
-
}
|
45 |
-
var footer = document.getElementById("blueknow-footer");
|
46 |
-
widget += footer ? footer.innerHTML : "";
|
47 |
-
var container = document.getElementById("blueknow-widget");
|
48 |
-
if (container) {
|
49 |
-
container.innerHTML = widget;
|
50 |
-
}
|
51 |
-
}
|
52 |
-
}
|
53 |
-
//error function
|
54 |
-
function processError(message) {}
|
55 |
-
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/frontend/default/default/template/blueknow/common/recommender_widget_footer.phtml
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* your needs please save your changes before upgrading.
|
10 |
*
|
11 |
* @category design
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @license GNU General Public License
|
14 |
* @author <a href="mailto:santi.ameller@blueknow.com">Santiago Ameller</a>
|
15 |
* @since 1.0.0
|
9 |
* your needs please save your changes before upgrading.
|
10 |
*
|
11 |
* @category design
|
12 |
+
* @copyright Copyright (c) 2013 Blueknow, S.L. (http://www.blueknow.com)
|
13 |
* @license GNU General Public License
|
14 |
* @author <a href="mailto:santi.ameller@blueknow.com">Santiago Ameller</a>
|
15 |
* @since 1.0.0
|
app/design/frontend/default/default/template/blueknow/customer/tracker.phtml
CHANGED
@@ -9,9 +9,10 @@
|
|
9 |
* your needs please save your changes before upgrading.
|
10 |
*
|
11 |
* @category design
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @license GNU General Public License
|
14 |
* @author <a href="mailto:santi.ameller@blueknow.com">Santiago Ameller</a>
|
|
|
15 |
* @since 1.0.0
|
16 |
*
|
17 |
*/
|
9 |
* your needs please save your changes before upgrading.
|
10 |
*
|
11 |
* @category design
|
12 |
+
* @copyright Copyright (c) 2013 Blueknow, S.L. (http://www.blueknow.com)
|
13 |
* @license GNU General Public License
|
14 |
* @author <a href="mailto:santi.ameller@blueknow.com">Santiago Ameller</a>
|
15 |
+
* @author <a href="mailto:josep.ventura@blueknow.com">Josep M Ventura</a>
|
16 |
* @since 1.0.0
|
17 |
*
|
18 |
*/
|
app/design/frontend/default/default/template/blueknow/home/recommender.phtml
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Template for Blueknow_Recommender_Block_Home_Recommmender.
|
4 |
+
*
|
5 |
+
* DISCLAIMER
|
6 |
+
*
|
7 |
+
* Do not edit or add to this file if you wish to upgrade Blueknow Recommender
|
8 |
+
* extension to newer versions in the future. If you wish to customize it for
|
9 |
+
* your needs please save your changes before upgrading.
|
10 |
+
*
|
11 |
+
* @category design
|
12 |
+
* @copyright Copyright (c) 2013 Blueknow, S.L. (http://www.blueknow.com)
|
13 |
+
* @license GNU General Public License
|
14 |
+
* @author <a href="mailto:santi.ameller@blueknow.com">Santiago Ameller</a>
|
15 |
+
* @author <a href="mailto:josep.ventura@blueknow.com">Josep M Ventura</a>
|
16 |
+
* @since 1.2.0
|
17 |
+
*
|
18 |
+
*/
|
19 |
+
?>
|
20 |
+
<?php $bConfiguration = $this->getConfig(); ?>
|
21 |
+
|
22 |
+
<script src="<?php echo $bConfiguration->getBaseURL() ?>/bk-r.js" type="text/javascript"></script>
|
23 |
+
|
24 |
+
<script type="text/javascript">
|
25 |
+
var rec = new Blueknow.Recommender('<?php echo $bConfiguration->getBKNumber() ?>');
|
26 |
+
rec.setCurrency('<?php echo $bConfiguration->getCurrentCurrency()->getCode() ?>');
|
27 |
+
rec.setLanguage('<?php echo $bConfiguration->getLanguage() ?>');
|
28 |
+
</script>
|
29 |
+
|
30 |
+
<script type="text/javascript">
|
31 |
+
var i2u_properties = new Object();
|
32 |
+
i2u_properties.recommendations = '<?php echo $bConfiguration->getHomeNOR() ?>';
|
33 |
+
rec.item2user('home', i2u_properties);
|
34 |
+
</script>
|
app/design/frontend/default/default/template/blueknow/home/recommender_widget.phtml
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Template for Blueknow_Recommender_Block_Home_Recommmender.
|
4 |
+
*
|
5 |
+
* DISCLAIMER
|
6 |
+
*
|
7 |
+
* Do not edit or add to this file if you wish to upgrade Blueknow Recommender
|
8 |
+
* extension to newer versions in the future. If you wish to customize it for
|
9 |
+
* your needs please save your changes before upgrading.
|
10 |
+
*
|
11 |
+
* @category design
|
12 |
+
* @copyright Copyright (c) 2013 Blueknow, S.L. (http://www.blueknow.com)
|
13 |
+
* @license GNU General Public License
|
14 |
+
* @author <a href="mailto:santi.ameller@blueknow.com">Santiago Ameller</a>
|
15 |
+
* @author <a href="mailto:josep.ventura@blueknow.com">Josep M Ventura</a>
|
16 |
+
* @since 1.2.0
|
17 |
+
*
|
18 |
+
*/
|
19 |
+
?>
|
20 |
+
<div id="blueknow-widget" class="blueknow-home-widget"></div>
|
21 |
+
<?php $bConfiguration = $this->getConfig();?>
|
22 |
+
<script id="blueknow-header" type="text/x-blueknow-template">
|
23 |
+
<div><h2><?php echo $this->__('We recommend to you the following products') ?></h2></div>
|
24 |
+
</script>
|
25 |
+
<script id="blueknow-template" type="text/x-blueknow-template">
|
26 |
+
<div class="products-grid blueknow-home-products-grid">
|
27 |
+
<div class="blueknow-product">
|
28 |
+
<a href="$url" title="$name" class="product-image blueknow-home-product-image"
|
29 |
+
onclick="try { rec.onclick('$id','item2user','home');} catch(err) {};" >
|
30 |
+
<img source="$image" alt="$name" title="$name" width="115" height="auto" hspace="0" vspace="0" border="0" />
|
31 |
+
</a>
|
32 |
+
<h3 class="product-name"><a href="$url" title="$name"
|
33 |
+
onclick="try { rec.onclick('$id','item2user','home');} catch(err) {};">
|
34 |
+
$name</a></h3>
|
35 |
+
<div class="price-box">
|
36 |
+
<span class="regular-price">
|
37 |
+
<span class="price">$price <?php echo $bConfiguration->getCurrentCurrency()->getSymbol() ?></span>
|
38 |
+
</span>
|
39 |
+
</div>
|
40 |
+
</div>
|
41 |
+
</div>
|
42 |
+
</script>
|
43 |
+
|
44 |
+
<?php echo $this->getChildHtml('product_recommender_widget_footer') ?>
|
app/design/frontend/default/default/template/blueknow/product/notFound/tracker.phtml
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Template for Blueknow_Recommender_Block_Product_NotFound_Tracker.
|
4 |
+
*
|
5 |
+
* DISCLAIMER
|
6 |
+
*
|
7 |
+
* Do not edit or add to this file if you wish to upgrade Blueknow Recommender
|
8 |
+
* extension to newer versions in the future. If you wish to customize it for
|
9 |
+
* your needs please save your changes before upgrading.
|
10 |
+
*
|
11 |
+
* @category design
|
12 |
+
* @copyright Copyright (c) 2012 Blueknow, S.L. (http://www.blueknow.com)
|
13 |
+
* @license GNU General Public License
|
14 |
+
* @author <a href="mailto:santi.ameller@blueknow.com">Santiago Ameller</a>
|
15 |
+
* @author <a href="mailto:josep.ventura@blueknow.com">Josep M Ventura</a>
|
16 |
+
* @since 1.2.0
|
17 |
+
*
|
18 |
+
*/
|
19 |
+
?>
|
20 |
+
<?php $bConfiguration = $this->getConfig(); ?>
|
21 |
+
<script
|
22 |
+
src="<?php echo $bConfiguration->getBaseURL() ?>/bk.js"
|
23 |
+
type="text/javascript"></script>
|
24 |
+
|
25 |
+
<script type="text/javascript">
|
26 |
+
var tracker = Blueknow.getTracker('<?php echo $bConfiguration->getBKNumber() ?>');
|
27 |
+
tracker.setCurrency('<?php echo $bConfiguration->getCurrentCurrency()->getCode() ?>');
|
28 |
+
tracker.setLanguage('<?php echo $bConfiguration->getLanguage() ?>');
|
29 |
+
</script>
|
30 |
+
<script type="text/javascript">
|
31 |
+
tracker.trackDiscontinued('<?php echo $this->getCurrentProductId(); ?>');
|
32 |
+
</script>
|
app/design/frontend/default/default/template/blueknow/product/recommender.phtml
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* your needs please save your changes before upgrading.
|
10 |
*
|
11 |
* @category design
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @license GNU General Public License
|
14 |
* @author <a href="mailto:santi.ameller@blueknow.com">Santiago Ameller</a>
|
15 |
* @since 1.0.0
|
@@ -29,5 +29,5 @@
|
|
29 |
<script type="text/javascript">
|
30 |
var i2i_properties = new Object();
|
31 |
i2i_properties.recommendations = '<?php echo $bConfiguration->getCrossSellNOR() ?>';
|
32 |
-
rec.item2item('
|
33 |
</script>
|
9 |
* your needs please save your changes before upgrading.
|
10 |
*
|
11 |
* @category design
|
12 |
+
* @copyright Copyright (c) 2013 Blueknow, S.L. (http://www.blueknow.com)
|
13 |
* @license GNU General Public License
|
14 |
* @author <a href="mailto:santi.ameller@blueknow.com">Santiago Ameller</a>
|
15 |
* @since 1.0.0
|
29 |
<script type="text/javascript">
|
30 |
var i2i_properties = new Object();
|
31 |
i2i_properties.recommendations = '<?php echo $bConfiguration->getCrossSellNOR() ?>';
|
32 |
+
rec.item2item('product', '<?php echo $this->getProduct()->getIdentifier() ?>', i2i_properties);
|
33 |
</script>
|
app/design/frontend/default/default/template/blueknow/product/recommender_widget.phtml
CHANGED
@@ -9,39 +9,15 @@
|
|
9 |
* your needs please save your changes before upgrading.
|
10 |
*
|
11 |
* @category design
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @license GNU General Public License
|
14 |
* @author <a href="mailto:santi.ameller@blueknow.com">Santiago Ameller</a>
|
|
|
15 |
* @since 1.0.0
|
16 |
*
|
17 |
*/
|
18 |
?>
|
19 |
-
<style type="text/css">
|
20 |
-
|
21 |
-
.blueknow-products-grid {
|
22 |
-
float: left;
|
23 |
-
width: 156px !important;
|
24 |
-
height: 250px;
|
25 |
-
background-color: #f6f2e7;
|
26 |
-
border: 1px solid #e5dcc3;
|
27 |
-
}
|
28 |
-
|
29 |
-
.blueknow-product {
|
30 |
-
padding: 10px;
|
31 |
-
}
|
32 |
-
|
33 |
-
.blueknow-product-image {
|
34 |
-
|
35 |
-
}
|
36 |
-
|
37 |
-
.blueknow-product img {
|
38 |
-
border:1px solid #e5dcc3;
|
39 |
-
}
|
40 |
-
|
41 |
-
</style>
|
42 |
-
|
43 |
<div id="blueknow-widget"></div>
|
44 |
-
|
45 |
<?php $bConfiguration = $this->getConfig(); ?>
|
46 |
|
47 |
<script id="blueknow-header" type="text/x-blueknow-template">
|
@@ -56,10 +32,13 @@
|
|
56 |
<script id="blueknow-template" type="text/x-blueknow-template">
|
57 |
<div class="products-grid blueknow-products-grid">
|
58 |
<div class="blueknow-product">
|
59 |
-
<a href="$url" title="$name" class="product-image blueknow-product-image"
|
60 |
-
|
|
|
61 |
</a>
|
62 |
-
<h3 class="product-name"><a href="$url" title="$name"
|
|
|
|
|
63 |
<div class="price-box">
|
64 |
<span class="regular-price">
|
65 |
<span class="price">$price <?php echo $bConfiguration->getCurrentCurrency()->getSymbol() ?></span>
|
9 |
* your needs please save your changes before upgrading.
|
10 |
*
|
11 |
* @category design
|
12 |
+
* @copyright Copyright (c) 2013 Blueknow, S.L. (http://www.blueknow.com)
|
13 |
* @license GNU General Public License
|
14 |
* @author <a href="mailto:santi.ameller@blueknow.com">Santiago Ameller</a>
|
15 |
+
* @author <a href="mailto:josep.ventura@blueknow.com">Josep M Ventura</a>
|
16 |
* @since 1.0.0
|
17 |
*
|
18 |
*/
|
19 |
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
<div id="blueknow-widget"></div>
|
|
|
21 |
<?php $bConfiguration = $this->getConfig(); ?>
|
22 |
|
23 |
<script id="blueknow-header" type="text/x-blueknow-template">
|
32 |
<script id="blueknow-template" type="text/x-blueknow-template">
|
33 |
<div class="products-grid blueknow-products-grid">
|
34 |
<div class="blueknow-product">
|
35 |
+
<a href="$url" title="$name" class="product-image blueknow-product-image"
|
36 |
+
onclick="try { rec.onclick('$id','item2item','product');} catch(err) {};">
|
37 |
+
<img source="$image" alt="$name" title="$name" width="135" height="auto" hspace="0" vspace="0" border="0" />
|
38 |
</a>
|
39 |
+
<h3 class="product-name"><a href="$url" title="$name"
|
40 |
+
onclick="try { rec.onclick('$id','item2user','product');} catch(err) {};">
|
41 |
+
$name</a></h3>
|
42 |
<div class="price-box">
|
43 |
<span class="regular-price">
|
44 |
<span class="price">$price <?php echo $bConfiguration->getCurrentCurrency()->getSymbol() ?></span>
|
app/design/frontend/default/default/template/blueknow/product/tracker.phtml
CHANGED
@@ -9,9 +9,10 @@
|
|
9 |
* your needs please save your changes before upgrading.
|
10 |
*
|
11 |
* @category design
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @license GNU General Public License
|
14 |
* @author <a href="mailto:santi.ameller@blueknow.com">Santiago Ameller</a>
|
|
|
15 |
* @since 1.0.0
|
16 |
*
|
17 |
*/
|
9 |
* your needs please save your changes before upgrading.
|
10 |
*
|
11 |
* @category design
|
12 |
+
* @copyright Copyright (c) 2013 Blueknow, S.L. (http://www.blueknow.com)
|
13 |
* @license GNU General Public License
|
14 |
* @author <a href="mailto:santi.ameller@blueknow.com">Santiago Ameller</a>
|
15 |
+
* @author <a href="mailto:josep.ventura@blueknow.com">Josep M Ventura</a>
|
16 |
* @since 1.0.0
|
17 |
*
|
18 |
*/
|
app/etc/modules/Blueknow_Recommender.xml
CHANGED
@@ -10,7 +10,7 @@
|
|
10 |
* your needs please save your changes before upgrading.
|
11 |
*
|
12 |
* @category Blueknow
|
13 |
-
* @copyright Copyright (c)
|
14 |
* @license GNU General Public License
|
15 |
* @author <a href="mailto:santi.ameller@blueknow.com">Santiago Ameller</a>
|
16 |
* @since 1.0.0
|
10 |
* your needs please save your changes before upgrading.
|
11 |
*
|
12 |
* @category Blueknow
|
13 |
+
* @copyright Copyright (c) 2013 Blueknow, S.L. (http://www.blueknow.com)
|
14 |
* @license GNU General Public License
|
15 |
* @author <a href="mailto:santi.ameller@blueknow.com">Santiago Ameller</a>
|
16 |
* @since 1.0.0
|
app/locale/de_DE/Blueknow_recommender.csv
CHANGED
@@ -8,10 +8,14 @@
|
|
8 |
"Cross-sell recommendations", "Cross-sell Empfehlungen"
|
9 |
"Activate/Deactivate cross-sell recommendations in product detail page.", "Aktivieren/deaktivieren cross-sell Empfehlungen auf der Produktseite."
|
10 |
"Recommendations", "Empfehlungen"
|
11 |
-
"Number of cross-sell recommendations to show in product detail page.", "
|
12 |
"Up-sell recommendations", "Up-sell Empfehlungen"
|
13 |
"Activate/Deactivate up-sell recommendations in shopping cart page.", "Aktivieren/Deaktivieren Up-sell Empfehlungen auf der Einkaufswagenseite."
|
14 |
-
"Number of up-sell recommendations to show in shopping cart page.", "
|
|
|
|
|
|
|
15 |
|
16 |
"You may also be interested in the following products", "Sie können auch Interesse an folgende Produkte haben"
|
17 |
-
"Customers who bought these products also bought", "Kunden, die diesen Artikel gekauft haben, kauften auch"
|
|
8 |
"Cross-sell recommendations", "Cross-sell Empfehlungen"
|
9 |
"Activate/Deactivate cross-sell recommendations in product detail page.", "Aktivieren/deaktivieren cross-sell Empfehlungen auf der Produktseite."
|
10 |
"Recommendations", "Empfehlungen"
|
11 |
+
"Number of cross-sell recommendations to show in product detail page.", "Anzahl von cross-sell Empfehlungen, die auf der Produktseite angezeigt werden."
|
12 |
"Up-sell recommendations", "Up-sell Empfehlungen"
|
13 |
"Activate/Deactivate up-sell recommendations in shopping cart page.", "Aktivieren/Deaktivieren Up-sell Empfehlungen auf der Einkaufswagenseite."
|
14 |
+
"Number of up-sell recommendations to show in shopping cart page.", "Anzahl von up-sell Empfehlungen, die auf der Einkaufswagen Seite angezeigt werden."
|
15 |
+
"Home recommendations", "Startseite Empfehlungen"
|
16 |
+
"Activate/Deactivate recommendations in home page.", "Aktivieren/Deaktivieren startseite Empfehlungen."
|
17 |
+
"Number of recommendations to show in home page.", "Anzahl von Empfehlungen, die Empfehlungen der startseite angezeigt werden."
|
18 |
|
19 |
"You may also be interested in the following products", "Sie können auch Interesse an folgende Produkte haben"
|
20 |
+
"Customers who bought these products also bought", "Kunden, die diesen Artikel gekauft haben, kauften auch"
|
21 |
+
"We recommend to you the following products", "Wir empfehlen Ihnen folgende Produkte"
|
app/locale/en_US/Blueknow_recommender.csv
CHANGED
@@ -14,4 +14,5 @@
|
|
14 |
"Number of up-sell recommendations to show in shopping cart page.", "Number of up-sell recommendations to show in shopping cart page."
|
15 |
|
16 |
"You may also be interested in the following products", "You may also be interested in the following products"
|
17 |
-
"Customers who bought these products also bought", "Customers who bought these products also bought"
|
|
14 |
"Number of up-sell recommendations to show in shopping cart page.", "Number of up-sell recommendations to show in shopping cart page."
|
15 |
|
16 |
"You may also be interested in the following products", "You may also be interested in the following products"
|
17 |
+
"Customers who bought these products also bought", "Customers who bought these products also bought"
|
18 |
+
"We recommend to you the following products", "We recommend to you the following products"
|
app/locale/es_ES/Blueknow_recommender.csv
CHANGED
@@ -12,6 +12,10 @@
|
|
12 |
"Up-sell recommendations", "Recomendaciones up-sell"
|
13 |
"Activate/Deactivate up-sell recommendations in shopping cart page.", "Activa/Desactiva las recomendaciones up-sell en la página del carrito."
|
14 |
"Number of up-sell recommendations to show in shopping cart page.", "Número de recomendaciones up-sell a mostrar en la página del carrito."
|
|
|
|
|
|
|
15 |
|
16 |
"You may also be interested in the following products", "También te pueden interesar los siguientes productos"
|
17 |
-
"Customers who bought these products also bought", "Los clientes que compraron estos productos también compraron"
|
|
12 |
"Up-sell recommendations", "Recomendaciones up-sell"
|
13 |
"Activate/Deactivate up-sell recommendations in shopping cart page.", "Activa/Desactiva las recomendaciones up-sell en la página del carrito."
|
14 |
"Number of up-sell recommendations to show in shopping cart page.", "Número de recomendaciones up-sell a mostrar en la página del carrito."
|
15 |
+
"Home recommendations", "Recomendaciones página principal"
|
16 |
+
"Activate/Deactivate recommendations in home page.", "Activa/Desactiva las recomendaciones en la página principal."
|
17 |
+
"Number of recommendations to show in home page.", "Número de recomendaciones a mostrar en la página principal."
|
18 |
|
19 |
"You may also be interested in the following products", "También te pueden interesar los siguientes productos"
|
20 |
+
"Customers who bought these products also bought", "Los clientes que compraron estos productos también compraron"
|
21 |
+
"We recommend to you the following products", "Te recomendamos los siguientes productos"
|
app/locale/fr_FR/Blueknow_recommender.csv
CHANGED
@@ -12,6 +12,10 @@
|
|
12 |
"Up-sell recommendations", "Up-sell recommandations"
|
13 |
"Activate/Deactivate up-sell recommendations in shopping cart page.", "Activer/Désactiver up-sell recommandations en page du panier."
|
14 |
"Number of up-sell recommendations to show in shopping cart page.", "Nombre de up-sell recommandations à afficher dans la page panier."
|
|
|
|
|
|
|
15 |
|
16 |
"You may also be interested in the following products", "Vous pouvez également être intéressé par les produits suivants"
|
17 |
-
"Customers who bought these products also bought", "Les clients qui ont acheté ces produits ont également acheté"
|
|
12 |
"Up-sell recommendations", "Up-sell recommandations"
|
13 |
"Activate/Deactivate up-sell recommendations in shopping cart page.", "Activer/Désactiver up-sell recommandations en page du panier."
|
14 |
"Number of up-sell recommendations to show in shopping cart page.", "Nombre de up-sell recommandations à afficher dans la page panier."
|
15 |
+
"Home recommendations", "Recommandations page d'accueil"
|
16 |
+
"Activate/Deactivate recommendations in home page.", "Activer/Désactiver les recommandations dans la page d'accueil."
|
17 |
+
"Number of recommendations to show in home page.", "Nombre de recommandations á afficher dans la page d'accueil."
|
18 |
|
19 |
"You may also be interested in the following products", "Vous pouvez également être intéressé par les produits suivants"
|
20 |
+
"Customers who bought these products also bought", "Les clients qui ont acheté ces produits ont également acheté"
|
21 |
+
"We recommend to you the following products", "Nous vous recommandons les produits suivants"
|
app/locale/pt_PT/Blueknow_recommender.csv
CHANGED
@@ -12,6 +12,10 @@
|
|
12 |
"Up-sell recommendations", "Recomendações up-sell"
|
13 |
"Activate/Deactivate up-sell recommendations in shopping cart page.", "Activar/Desactivar recomendações up-sell na página do carrinho de compras."
|
14 |
"Number of up-sell recommendations to show in shopping cart page.", "Número de recomendações up-sell para mostrar na página do carrinho de compras."
|
|
|
|
|
|
|
15 |
|
16 |
"You may also be interested in the following products", "Você pode também estar interessado nos seguintes produtos"
|
17 |
-
"Customers who bought these products also bought", "Os clientes que compraram estes produtos também compraram"
|
|
12 |
"Up-sell recommendations", "Recomendações up-sell"
|
13 |
"Activate/Deactivate up-sell recommendations in shopping cart page.", "Activar/Desactivar recomendações up-sell na página do carrinho de compras."
|
14 |
"Number of up-sell recommendations to show in shopping cart page.", "Número de recomendações up-sell para mostrar na página do carrinho de compras."
|
15 |
+
"Home recommendations", "Recomendações homepage."
|
16 |
+
"Activate/Deactivate recommendations in home page.", "Activar/Desactivar recomendações up-sell na homepage."
|
17 |
+
"Number of recommendations to show in home page.", "Número de recomendações para mostrar na homepage."
|
18 |
|
19 |
"You may also be interested in the following products", "Você pode também estar interessado nos seguintes produtos"
|
20 |
+
"Customers who bought these products also bought", "Os clientes que compraram estes produtos também compraram"
|
21 |
+
"We recommend to you the following products", "Recomendamos-lhe os seguintes produtos"
|
package.xml
CHANGED
@@ -1,22 +1,22 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>BlueknowRecommender</name>
|
4 |
-
<version>1.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.gnu.org/licenses/gpl-3.0.en.html">GNU General Public License (GPL)</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Blueknow Recommender, personalized recommendations for your eCommerce</summary>
|
10 |
-
<description>Module that allows cross-selling in the product template
|
11 |

|
12 |
For more information please visit http://www.blueknow.com
|
13 |

|
14 |
Version compatible with Magento v1.3.x or higher.</description>
|
15 |
-
<notes>Blueknow Magento extension v1.
|
16 |
-
<authors><author><name>Santiago Ameller</name><user>
|
17 |
-
<date>
|
18 |
-
<time>
|
19 |
-
<contents><target name="mageetc"><dir name="modules"><file name="Blueknow_Recommender.xml" hash="
|
20 |
<compatible/>
|
21 |
-
<dependencies
|
22 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>BlueknowRecommender</name>
|
4 |
+
<version>1.2.0</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.gnu.org/licenses/gpl-3.0.en.html">GNU General Public License (GPL)</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Blueknow Recommender, personalized recommendations for your eCommerce</summary>
|
10 |
+
<description>Module that allows cross-selling in the product template, up-selling in the shopping cart and home page recommendations. The module is based on a recommendation service similar to that used by Amazon in their own shop. The basis of recommendations are product purchases and visits by users. They are used to display the most relevant products to the user. It has been demonstrated that Blueknow recommender can increase sales between 10% and 30% and is able to recommend products in 70% of orders made.
|
11 |

|
12 |
For more information please visit http://www.blueknow.com
|
13 |

|
14 |
Version compatible with Magento v1.3.x or higher.</description>
|
15 |
+
<notes>Blueknow Magento extension v1.2.0 compatible with Magento v1.3.x or higher.</notes>
|
16 |
+
<authors><author><name>Santiago Ameller</name><user>ameller</user><email>santi.ameller@blueknow.com</email></author><author><name>Josep M Ventura </name><user>ventura</user><email>josep.ventura@blueknow.com</email></author></authors>
|
17 |
+
<date>2013-02-07</date>
|
18 |
+
<time>21:19:53</time>
|
19 |
+
<contents><target name="mageetc"><dir name="modules"><file name="Blueknow_Recommender.xml" hash="445ad86a5c6e3d004cef6e9024812d4e"/></dir></target><target name="magecommunity"><dir name="Blueknow"><dir name="Recommender"><dir name="Block"><file name="Base.php" hash="d8278d2af0763ccc796a66c9ccf7c067"/><dir name="Cart"><file name="Recommender.php" hash="4964240179c6aa4436c1f2d91ed1005c"/></dir><dir name="Checkout"><file name="Tracker.php" hash="18ee4cbe9b5e602cde087dfad1b321ba"/></dir><dir name="Customer"><file name="Tracker.php" hash="4fbae00971226b36deaefcb24eeb3a6f"/></dir><dir name="Home"><file name="Recommender.php" hash="da57f908b618e91f426fb1adf09f5a0f"/></dir><dir name="Product"><file name="Base.php" hash="bd5987b0e934ca6ce96082e6fc72b736"/><dir name="NotFound"><file name="Tracker.php" hash="092dc0c3272b0420b300216bdd60b90a"/></dir><file name="Recommender.php" hash="24ff4244c2bdab4de963a21254dce839"/><file name="Tracker.php" hash="e25aad30c4d5e903008b8b5e346f0974"/></dir><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Version.php" hash="cfa74a397c47acb703cda95e87b289ec"/></dir></dir></dir></dir></dir><dir name="Helper"><file name="Category.php" hash="82c65c40096c6f6e9657444ac854d8e6"/><file name="Currency.php" hash="91a70af9b5b973e971318d17b2c153ae"/><file name="Data.php" hash="c21f073b9856fd20955e65e6e7627684"/><file name="Price.php" hash="ff7c705f1d488011e6514ac1b6e3e903"/><file name="Product.php" hash="bb5f8431a3de166049f79a40019b1a6e"/></dir><dir name="Model"><file name="Cart.php" hash="94f4d46456fb8fc4c57e8481bd79ebd9"/><dir name="Checkout"><file name="Order.php" hash="fcdb6e8eafa64aca6d4d51f94efe2017"/><file name="Product.php" hash="87aa5dec9c2d773b086bd5f5e8ec5157"/></dir><file name="Checkout.php" hash="a7907190c3b79579bd4a33a3ba9b767a"/><file name="Configuration.php" hash="05602ef62b160ed1532e2b5f74ec3715"/><file name="Currency.php" hash="22a0296f0db833a19c4d1a2fae1d7364"/><file name="Customer.php" hash="e558d29b8d9b667fd3b21df0e5b3fce9"/><file name="Observer.php" hash="9d92ee1389bca9b582e648d6e0e626aa"/><file name="PlatformApiService.php" hash="6c5b6119aa9404fef18b2440f46cb445"/><file name="Product.php" hash="8b79cc452d58a124a99907f1995afdb1"/><file name="Session.php" hash="b377c05c7388b4a7fd0bc3069dc2c0cb"/><dir name="Source"><file name="Numberofrecommendations.php" hash="12709d32569a0d0c3641ef76ee6dacf7"/></dir></dir><dir name="documentation"><file name="Blueknow_Recommender_1.2.0_Guia_de_Instalacion.pdf" hash="e24a5d25ed2f43071250f9fa1bd24002"/><file name="Blueknow_Recommender_1.2.0_Guide_Installation.pdf" hash="e058afa31b2c95976de4f5679488f95e"/><file name="Blueknow_Recommender_1.2.0_Installation_Guide.pdf" hash="d554c8ba20f9401d8a482eb7c2fb71fa"/><file name="README.txt" hash="673b0a5c82930451720036afbac446ce"/></dir><dir name="etc"><file name="config.xml" hash="b921027f513415310540a530f72037cd"/><file name="system.xml" hash="c8a1e6d7556db57e0f9e16fecc1bfbb1"/></dir><dir name="sql"><dir name="recommender_setup"><file name="uninstall.sql" hash="cf0e97152d9d10a5ecde70ba9867b463"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="blueknow_recommender.xml" hash="062106406e8e1ebccd8235c4cafa7e27"/></dir><dir name="template"><dir name="blueknow"><dir name="cart"><file name="recommender.phtml" hash="3df9addd4cc320e1ff977b97c9c9d5c1"/><file name="recommender_widget.phtml" hash="cc50b2a7c464c3f091f42d6fe82b968f"/></dir><dir name="checkout"><file name="tracker.phtml" hash="274b3c2b6c8b84af55bb06689ad77331"/></dir><dir name="common"><file name="recommender_widget_footer.phtml" hash="135cdf156b45cdbb7f2e73fc9cdd66dd"/></dir><dir name="customer"><file name="tracker.phtml" hash="07ae4b3e0b00bc9f744b4dde94be8b36"/></dir><dir name="home"><file name="recommender.phtml" hash="2f8747c1b14a4b5e06c7501d14e40255"/><file name="recommender_widget.phtml" hash="0c67246d5be28e26e0291e87b71379da"/></dir><dir name="product"><dir name="notFound"><file name="tracker.phtml" hash="837f50667e56b8252167f41c66e083f8"/></dir><file name="recommender.phtml" hash="b6f9cc4c5d818f603ab52be1cefea2fd"/><file name="recommender_widget.phtml" hash="cc39f50f85eb9bdcfe797f9ff3e7d000"/><file name="tracker.phtml" hash="b438725c07b9131918b5c17c225a14f1"/></dir></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="blueknow_recommender.xml" hash="b4586ddaffc0be462f73fcc08d51b055"/></dir></dir></dir></dir></target><target name="magelocale"><dir name="de_DE"><file name="Blueknow_recommender.csv" hash="9767379d1230157957849edc4ecd8d22"/></dir><dir name="es_ES"><file name="Blueknow_recommender.csv" hash="ad7cf068acd4b71ac7e25491813e555e"/></dir><dir name="en_US"><file name="Blueknow_recommender.csv" hash="9942454a4da595a374092f9ef3a90888"/></dir><dir name="fr_FR"><file name="Blueknow_recommender.csv" hash="339a989ceb97d49bb13432086f4e7beb"/></dir><dir name="pt_PT"><file name="Blueknow_recommender.csv" hash="5ea527881c072045be4f367f7c45d792"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="blueknow_recommender"><dir name="css"><file name="blueknow_recommender.css" hash="ad0664b53b83588fe76d8a874f46f8d1"/></dir><dir name="images"><file name="blueknow_logo.png" hash="5e334e84baad3ff73cf5ce7199c0c6b6"/><file name="blueknow_logo_small.png" hash="ea72a7c4e407de66dfd13af998a50c48"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><dir name="blueknow_recommender"><file name="blueknow_widget.css" hash="cb1e524a5e0710a4e9fdd350c523b7f1"/></dir></dir><dir name="js"><dir name="blueknow_recommender"><file name="blueknow_recommender.min.js" hash="ede4c77323e76f99c3260e56e0148398"/></dir></dir></dir></dir></dir></target></contents>
|
20 |
<compatible/>
|
21 |
+
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
22 |
</package>
|
skin/frontend/base/default/css/blueknow_recommender/blueknow_widget.css
ADDED
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* General CSS properties and product page default ones */
|
2 |
+
#blueknow-widget {
|
3 |
+
margin-top: 20px;
|
4 |
+
}
|
5 |
+
|
6 |
+
/* Recommender widget title */
|
7 |
+
#blueknow-widget h2 {
|
8 |
+
font-weight: bold;
|
9 |
+
font-size: 15px;
|
10 |
+
color: #e26703;
|
11 |
+
}
|
12 |
+
|
13 |
+
.blueknow-product {
|
14 |
+
padding: 10px;
|
15 |
+
}
|
16 |
+
|
17 |
+
.blueknow-product img {
|
18 |
+
border: 1px solid #e5dcc3;
|
19 |
+
}
|
20 |
+
|
21 |
+
/* Widget layout and properties (Product page) */
|
22 |
+
.blueknow-products-grid {
|
23 |
+
float: left;
|
24 |
+
width: 156px !important;
|
25 |
+
height: 250px;
|
26 |
+
background-color: #f6f2e7;
|
27 |
+
border: 1px solid #e5dcc3;
|
28 |
+
}
|
29 |
+
|
30 |
+
/* Shopping cart page specific CSS properties */
|
31 |
+
.blueknow-cart-product-image {
|
32 |
+
width: 110px !important;
|
33 |
+
height: 110px !important;
|
34 |
+
}
|
35 |
+
|
36 |
+
/* Widget layout and properties (Cart page) */
|
37 |
+
.blueknow-cart-products-grid {
|
38 |
+
float: left;
|
39 |
+
width: 126px !important;
|
40 |
+
height: 235px;
|
41 |
+
background-color: #fafaec;
|
42 |
+
border: 1px solid #e5dcc3;
|
43 |
+
}
|
44 |
+
|
45 |
+
/* Home page specific CSS properties */
|
46 |
+
.blueknow-home-widget {
|
47 |
+
display: block;
|
48 |
+
padding-left: 215px;
|
49 |
+
}
|
50 |
+
|
51 |
+
/* Recommender widget Home page title */
|
52 |
+
.blueknow-home-widget h2{
|
53 |
+
line-height: 25px;
|
54 |
+
}
|
55 |
+
|
56 |
+
/* Widget layout and properties (Home page) */
|
57 |
+
.blueknow-home-products-grid {
|
58 |
+
float: left;
|
59 |
+
width: 154px !important;
|
60 |
+
height: 235px;
|
61 |
+
background-color: #fafaec;
|
62 |
+
border: 1px solid #e5dcc3;
|
63 |
+
}
|
64 |
+
|
65 |
+
.blueknow-home-product-image {
|
66 |
+
width: 120px !important;
|
67 |
+
height: 120px !important;
|
68 |
+
}
|
skin/frontend/base/default/js/blueknow_recommender/blueknow_recommender.min.js
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* Recommender renderer
|
3 |
+
*
|
4 |
+
* DISCLAIMER
|
5 |
+
*
|
6 |
+
* Do not edit or add to this file if you wish to upgrade Blueknow Recommender
|
7 |
+
* extension to newer versions in the future. If you wish to customize it for
|
8 |
+
* your needs please save your changes before upgrading.
|
9 |
+
*
|
10 |
+
* @category skin
|
11 |
+
* @copyright Copyright (c) 2013 Blueknow, S.L. (http://www.blueknow.com)
|
12 |
+
* @license GNU General Public License
|
13 |
+
* @author <a href="mailto:santi.ameller@blueknow.com">Santiago Ameller</a>
|
14 |
+
* @author <a href="mailto:josep.ventura@blueknow.com">Josep M Ventura</a>
|
15 |
+
* @since 1.2.0
|
16 |
+
*/
|
17 |
+
var Blueknow=Blueknow||{};Blueknow.Renderer=function(){this.renderItems=function(e){if(e.length>0){var d="";var c=document.getElementById("blueknow-header");d+=c?c.innerHTML:"";for(var b=0;b<e.length;b++){var j=e[b];var g=document.getElementById("blueknow-template");if(!g){break}var h=g.innerHTML;h=h.replace(/\$id/g,j.id);h=h.replace(/\$name/g,j.name);h=h.replace(/\$url/g,j.url);h=h.replace(/source="\$image"/g,"src='"+j.image+"'");h=h.replace(/\$price/g,this.formatCurrency(j.price));d+=h}var f=document.getElementById("blueknow-footer");d+=f?f.innerHTML:"";var a=document.getElementById("blueknow-widget");if(a){a.innerHTML=d}}};this.formatCurrency=function(a){return Number(a).toFixed(2)};this.processError=function(a){}}();
|