Version Notes
- Optimized caching behaviour for e.g. compatibility with Varnish
Download this release
Release Info
Developer | Recolize GmbH |
Extension | recolize_recommendation_engine |
Version | 2.1.1 |
Comparing to | |
See all releases |
Code changes from version 2.1.0 to 2.1.1
- app/code/community/Recolize/RecommendationEngine/Block/Parameter.php +45 -0
- app/code/community/Recolize/RecommendationEngine/Model/Cookie.php +83 -0
- app/code/community/Recolize/RecommendationEngine/Model/Observer.php +30 -4
- app/code/community/Recolize/RecommendationEngine/{Block/Userparameter.php → Model/User.php} +56 -13
- app/code/community/Recolize/RecommendationEngine/etc/cache.xml +0 -5
- app/code/community/Recolize/RecommendationEngine/etc/config.xml +4 -4
- app/design/frontend/base/default/layout/recolize_recommendation_engine.xml +1 -1
- app/design/frontend/base/default/template/recolize/recommendation_engine/add_to_wishlist_ajax.phtml +27 -0
- app/design/frontend/base/default/template/recolize/recommendation_engine/parameter.phtml +37 -0
- app/design/frontend/base/default/template/recolize/recommendation_engine/user_parameter.phtml +0 -26
- package.xml +5 -9
app/code/community/Recolize/RecommendationEngine/Block/Parameter.php
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Recolize GmbH
|
4 |
+
*
|
5 |
+
* @section LICENSE
|
6 |
+
* This source file is subject to the GNU General Public License Version 3 (GPLv3).
|
7 |
+
*
|
8 |
+
* @category Recolize
|
9 |
+
* @package Recolize_RecommendationEngine
|
10 |
+
* @author Recolize GmbH <service@recolize.com>
|
11 |
+
* @copyright 2015 Recolize GmbH (http://www.recolize.com)
|
12 |
+
* @license http://opensource.org/licenses/GPL-3.0 GNU General Public License Version 3 (GPLv3).
|
13 |
+
*/
|
14 |
+
class Recolize_RecommendationEngine_Block_Parameter extends Mage_Core_Block_Template
|
15 |
+
{
|
16 |
+
/**
|
17 |
+
* Returns the Recolize cookie name.
|
18 |
+
*
|
19 |
+
* @return string the cookie name
|
20 |
+
*/
|
21 |
+
public function getCookieName()
|
22 |
+
{
|
23 |
+
return Recolize_RecommendationEngine_Model_Cookie::COOKIE_NAME;
|
24 |
+
}
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Returns the default user status.
|
28 |
+
*
|
29 |
+
* @return string the user status
|
30 |
+
*/
|
31 |
+
public function getDefaultUserStatus()
|
32 |
+
{
|
33 |
+
return Mage::getModel('recolize_recommendation_engine/user')->getDefaultCustomerStatus();
|
34 |
+
}
|
35 |
+
|
36 |
+
/**
|
37 |
+
* Returns the default user group for logged out users.
|
38 |
+
*
|
39 |
+
* @return string the user group
|
40 |
+
*/
|
41 |
+
public function getDefaultUserGroup()
|
42 |
+
{
|
43 |
+
return Mage::getModel('recolize_recommendation_engine/user')->getDefaultCustomerGroup();
|
44 |
+
}
|
45 |
+
}
|
app/code/community/Recolize/RecommendationEngine/Model/Cookie.php
ADDED
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Recolize GmbH
|
4 |
+
*
|
5 |
+
* @section LICENSE
|
6 |
+
* This source file is subject to the GNU General Public License Version 3 (GPLv3).
|
7 |
+
*
|
8 |
+
* @category Recolize
|
9 |
+
* @package Recolize_RecommendationEngine
|
10 |
+
* @author Recolize GmbH <service@recolize.com>
|
11 |
+
* @copyright 2015 Recolize GmbH (http://www.recolize.com)
|
12 |
+
* @license http://opensource.org/licenses/GPL-3.0 GNU General Public License Version 3 (GPLv3).
|
13 |
+
*/
|
14 |
+
class Recolize_RecommendationEngine_Model_Cookie extends Mage_Core_Model_Cookie
|
15 |
+
{
|
16 |
+
/**
|
17 |
+
* The cookie name.
|
18 |
+
*
|
19 |
+
* @var string
|
20 |
+
*/
|
21 |
+
const COOKIE_NAME = 'recolize_parameter';
|
22 |
+
|
23 |
+
/**
|
24 |
+
* The cookie lifetime (browser session based).
|
25 |
+
*
|
26 |
+
* @var integer
|
27 |
+
*/
|
28 |
+
const COOKIE_LIFETIME = 0;
|
29 |
+
|
30 |
+
/**
|
31 |
+
* Updates the user data in the Recolize cookie.
|
32 |
+
*
|
33 |
+
* @param string $userId user id
|
34 |
+
* @param string $status user status
|
35 |
+
* @param string $group user group
|
36 |
+
* @return Recolize_RecommendationEngine_Model_Cookie chaining
|
37 |
+
*/
|
38 |
+
public function updateUserData($userId, $status, $group)
|
39 |
+
{
|
40 |
+
$userDataArray = array();
|
41 |
+
|
42 |
+
if (empty($userId) === false) {
|
43 |
+
$userDataArray = array(
|
44 |
+
'User' => array(
|
45 |
+
'id' => $userId
|
46 |
+
)
|
47 |
+
);
|
48 |
+
}
|
49 |
+
|
50 |
+
$userDataArray = array_merge_recursive($userDataArray, array(
|
51 |
+
'User' => array(
|
52 |
+
'status' => $status,
|
53 |
+
'group' => $group
|
54 |
+
)
|
55 |
+
));
|
56 |
+
|
57 |
+
return $this->_saveCookie($userDataArray);
|
58 |
+
}
|
59 |
+
|
60 |
+
/**
|
61 |
+
* Saves the Recolize cookie.
|
62 |
+
*
|
63 |
+
* @param array $additionalData the cookie data
|
64 |
+
* @return Recolize_RecommendationEngine_Model_Cookie chaining
|
65 |
+
*/
|
66 |
+
protected function _saveCookie($additionalData)
|
67 |
+
{
|
68 |
+
try {
|
69 |
+
$cookieValue = Zend_Json::decode($this->get(self::COOKIE_NAME));
|
70 |
+
|
71 |
+
if (empty($cookieValue) === true) {
|
72 |
+
$cookieValue = array();
|
73 |
+
}
|
74 |
+
|
75 |
+
$cookieValue = Zend_Json::encode(array_replace($cookieValue, $additionalData));
|
76 |
+
$this->set(self::COOKIE_NAME, $cookieValue, self::COOKIE_LIFETIME, null, null, null, false);
|
77 |
+
} catch (Exception $exception) {
|
78 |
+
|
79 |
+
}
|
80 |
+
|
81 |
+
return $this;
|
82 |
+
}
|
83 |
+
}
|
app/code/community/Recolize/RecommendationEngine/Model/Observer.php
CHANGED
@@ -48,17 +48,43 @@ class Recolize_RecommendationEngine_Model_Observer
|
|
48 |
}
|
49 |
|
50 |
/**
|
51 |
-
*
|
52 |
*
|
53 |
-
*
|
54 |
*
|
55 |
* @param Varien_Event_Observer $observer event object
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
*
|
|
|
|
|
|
|
57 |
* @return Recolize_RecommendationEngine_Model_Observer chaining
|
58 |
*/
|
59 |
-
public function
|
60 |
{
|
61 |
-
Mage::
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
|
63 |
return $this;
|
64 |
}
|
48 |
}
|
49 |
|
50 |
/**
|
51 |
+
* Updates the user data in the Recolize cookie.
|
52 |
*
|
53 |
+
* Events: customer_login, sales_order_place_after
|
54 |
*
|
55 |
* @param Varien_Event_Observer $observer event object
|
56 |
+
* @return Recolize_RecommendationEngine_Model_Observer chaining
|
57 |
+
*/
|
58 |
+
public function updateUserDataInCookie(Varien_Event_Observer $observer)
|
59 |
+
{
|
60 |
+
$user = Mage::getModel('recolize_recommendation_engine/user');
|
61 |
+
|
62 |
+
Mage::getModel('recolize_recommendation_engine/cookie')->updateUserData(
|
63 |
+
$user->getCustomerId(),
|
64 |
+
$user->getCustomerStatus(),
|
65 |
+
$user->getCustomerGroup()
|
66 |
+
);
|
67 |
+
|
68 |
+
return $this;
|
69 |
+
}
|
70 |
+
|
71 |
+
/**
|
72 |
+
* Updates the user data in the Recolize cookie after a customer logout.
|
73 |
*
|
74 |
+
* Events: customer_logout
|
75 |
+
*
|
76 |
+
* @param Varien_Event_Observer $observer event object
|
77 |
* @return Recolize_RecommendationEngine_Model_Observer chaining
|
78 |
*/
|
79 |
+
public function updateUserDataAfterLogoutInCookie(Varien_Event_Observer $observer)
|
80 |
{
|
81 |
+
$user = Mage::getModel('recolize_recommendation_engine/user');
|
82 |
+
|
83 |
+
Mage::getModel('recolize_recommendation_engine/cookie')->updateUserData(
|
84 |
+
null,
|
85 |
+
$user->getDefaultCustomerStatus(),
|
86 |
+
$user->getDefaultCustomerGroup()
|
87 |
+
);
|
88 |
|
89 |
return $this;
|
90 |
}
|
app/code/community/Recolize/RecommendationEngine/{Block/Userparameter.php → Model/User.php}
RENAMED
@@ -11,7 +11,7 @@
|
|
11 |
* @copyright 2015 Recolize GmbH (http://www.recolize.com)
|
12 |
* @license http://opensource.org/licenses/GPL-3.0 GNU General Public License Version 3 (GPLv3).
|
13 |
*/
|
14 |
-
class
|
15 |
{
|
16 |
/**
|
17 |
* Customer status for a new customer.
|
@@ -38,13 +38,31 @@ class Recolize_RecommendationEngine_Block_Userparameter extends Mage_Core_Block_
|
|
38 |
}
|
39 |
|
40 |
/**
|
41 |
-
* Get logged in customer id.
|
42 |
*
|
43 |
-
* @return integer
|
44 |
*/
|
45 |
public function getCustomerId()
|
46 |
{
|
47 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
}
|
49 |
|
50 |
/**
|
@@ -57,7 +75,7 @@ class Recolize_RecommendationEngine_Block_Userparameter extends Mage_Core_Block_
|
|
57 |
$customerGroupId = $this->_getCustomerSession()->getCustomerGroupId();
|
58 |
$customerGroupCode = Mage::getModel('customer/group')->load($customerGroupId)->getCustomerGroupCode();
|
59 |
|
60 |
-
return $customerGroupCode;
|
61 |
}
|
62 |
|
63 |
/**
|
@@ -68,16 +86,13 @@ class Recolize_RecommendationEngine_Block_Userparameter extends Mage_Core_Block_
|
|
68 |
*/
|
69 |
public function getCustomerStatus()
|
70 |
{
|
71 |
-
$customerStatus =
|
72 |
-
if (empty($customerStatus) === false) {
|
73 |
-
return $customerStatus;
|
74 |
-
}
|
75 |
|
76 |
if ($this->isCustomerLoggedIn() === true) {
|
77 |
/** @var Mage_Sales_Model_Order $order */
|
78 |
$order = Mage::getResourceModel('sales/order_collection')
|
79 |
->addFieldToSelect('entity_id')
|
80 |
-
->addFieldToFilter('customer_id', $this->
|
81 |
->setCurPage(1)
|
82 |
->setPageSize(1)
|
83 |
->getFirstItem();
|
@@ -86,16 +101,23 @@ class Recolize_RecommendationEngine_Block_Userparameter extends Mage_Core_Block_
|
|
86 |
$lastOrderId = Mage::getSingleton('checkout/session')->getLastOrderId();
|
87 |
}
|
88 |
|
89 |
-
$customerStatus = self::STATUS_NEW_CUSTOMER;
|
90 |
-
|
91 |
if (empty($lastOrderId) === false) {
|
92 |
$customerStatus = self::STATUS_RETURNING_CUSTOMER;
|
93 |
}
|
94 |
|
95 |
-
Mage::getSingleton('recolize_recommendation_engine/session')->setCustomerStatus($customerStatus);
|
96 |
return $customerStatus;
|
97 |
}
|
98 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
/**
|
100 |
* Return customer session model.
|
101 |
*
|
@@ -105,4 +127,25 @@ class Recolize_RecommendationEngine_Block_Userparameter extends Mage_Core_Block_
|
|
105 |
{
|
106 |
return Mage::getSingleton('customer/session');
|
107 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
108 |
}
|
11 |
* @copyright 2015 Recolize GmbH (http://www.recolize.com)
|
12 |
* @license http://opensource.org/licenses/GPL-3.0 GNU General Public License Version 3 (GPLv3).
|
13 |
*/
|
14 |
+
class Recolize_RecommendationEngine_Model_User extends Mage_Core_Model_Abstract
|
15 |
{
|
16 |
/**
|
17 |
* Customer status for a new customer.
|
38 |
}
|
39 |
|
40 |
/**
|
41 |
+
* Get an encrypted logged in customer id.
|
42 |
*
|
43 |
+
* @return integer|null the encrypted customer id; null, if the customer is not logged in
|
44 |
*/
|
45 |
public function getCustomerId()
|
46 |
{
|
47 |
+
$internalCustomerId = $this->_getInternalCustomerId();
|
48 |
+
|
49 |
+
if (empty($internalCustomerId) === true) {
|
50 |
+
return $internalCustomerId;
|
51 |
+
}
|
52 |
+
|
53 |
+
return sha1($internalCustomerId);
|
54 |
+
}
|
55 |
+
|
56 |
+
/**
|
57 |
+
* Returns the default customer group.
|
58 |
+
*
|
59 |
+
* @return string the default customer group
|
60 |
+
*/
|
61 |
+
public function getDefaultCustomerGroup()
|
62 |
+
{
|
63 |
+
$customerGroupCode = Mage::getModel('customer/group')->load(Mage_Customer_Model_Group::NOT_LOGGED_IN_ID)->getCustomerGroupCode();
|
64 |
+
|
65 |
+
return $this->_replaceSpecialCharacters($customerGroupCode);
|
66 |
}
|
67 |
|
68 |
/**
|
75 |
$customerGroupId = $this->_getCustomerSession()->getCustomerGroupId();
|
76 |
$customerGroupCode = Mage::getModel('customer/group')->load($customerGroupId)->getCustomerGroupCode();
|
77 |
|
78 |
+
return $this->_replaceSpecialCharacters($customerGroupCode);
|
79 |
}
|
80 |
|
81 |
/**
|
86 |
*/
|
87 |
public function getCustomerStatus()
|
88 |
{
|
89 |
+
$customerStatus = $this->getDefaultCustomerStatus();
|
|
|
|
|
|
|
90 |
|
91 |
if ($this->isCustomerLoggedIn() === true) {
|
92 |
/** @var Mage_Sales_Model_Order $order */
|
93 |
$order = Mage::getResourceModel('sales/order_collection')
|
94 |
->addFieldToSelect('entity_id')
|
95 |
+
->addFieldToFilter('customer_id', $this->_getInternalCustomerId())
|
96 |
->setCurPage(1)
|
97 |
->setPageSize(1)
|
98 |
->getFirstItem();
|
101 |
$lastOrderId = Mage::getSingleton('checkout/session')->getLastOrderId();
|
102 |
}
|
103 |
|
|
|
|
|
104 |
if (empty($lastOrderId) === false) {
|
105 |
$customerStatus = self::STATUS_RETURNING_CUSTOMER;
|
106 |
}
|
107 |
|
|
|
108 |
return $customerStatus;
|
109 |
}
|
110 |
|
111 |
+
/**
|
112 |
+
* Returns the default customer status.
|
113 |
+
*
|
114 |
+
* @return string the default customer status
|
115 |
+
*/
|
116 |
+
public function getDefaultCustomerStatus()
|
117 |
+
{
|
118 |
+
return self::STATUS_NEW_CUSTOMER;
|
119 |
+
}
|
120 |
+
|
121 |
/**
|
122 |
* Return customer session model.
|
123 |
*
|
127 |
{
|
128 |
return Mage::getSingleton('customer/session');
|
129 |
}
|
130 |
+
|
131 |
+
/**
|
132 |
+
* Returns the Magento internal customer id if the customer is logged in.
|
133 |
+
*
|
134 |
+
* @return integer|null the internal Magento customer id; null if not available/not logged in
|
135 |
+
*/
|
136 |
+
protected function _getInternalCustomerId()
|
137 |
+
{
|
138 |
+
return $this->_getCustomerSession()->getId();
|
139 |
+
}
|
140 |
+
|
141 |
+
/**
|
142 |
+
* Replaces special characters in a given string.
|
143 |
+
*
|
144 |
+
* @param string $text the text with possible special characters
|
145 |
+
* @return string a cleaned text
|
146 |
+
*/
|
147 |
+
protected function _replaceSpecialCharacters($text)
|
148 |
+
{
|
149 |
+
return str_replace('\'', '', $text);
|
150 |
+
}
|
151 |
}
|
app/code/community/Recolize/RecommendationEngine/etc/cache.xml
CHANGED
@@ -1,11 +1,6 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<config>
|
3 |
<placeholders>
|
4 |
-
<recolize_recommendation_engine_user_parameter>
|
5 |
-
<block>recolize_recommendation_engine/userparameter</block>
|
6 |
-
<placeholder>RECOLIZE_RECOMMENDATION_ENGINE_USER_PARAMETER</placeholder>
|
7 |
-
<container>Recolize_RecommendationEngine_Model_Enterprise_PageCache_Container</container>
|
8 |
-
</recolize_recommendation_engine_user_parameter>
|
9 |
<recolize_recommendation_engine_add_to_cart>
|
10 |
<block>core/template</block>
|
11 |
<name>recolize.recommendation.engine.add.to.cart</name>
|
1 |
<?xml version="1.0"?>
|
2 |
<config>
|
3 |
<placeholders>
|
|
|
|
|
|
|
|
|
|
|
4 |
<recolize_recommendation_engine_add_to_cart>
|
5 |
<block>core/template</block>
|
6 |
<name>recolize.recommendation.engine.add.to.cart</name>
|
app/code/community/Recolize/RecommendationEngine/etc/config.xml
CHANGED
@@ -16,7 +16,7 @@
|
|
16 |
<config>
|
17 |
<modules>
|
18 |
<Recolize_RecommendationEngine>
|
19 |
-
<version>2.1.
|
20 |
</Recolize_RecommendationEngine>
|
21 |
</modules>
|
22 |
<global>
|
@@ -48,7 +48,7 @@
|
|
48 |
<recolize_recommendation_engine_flush_customer_status_in_session>
|
49 |
<type>singleton</type>
|
50 |
<class>recolize_recommendation_engine/observer</class>
|
51 |
-
<method>
|
52 |
</recolize_recommendation_engine_flush_customer_status_in_session>
|
53 |
</observers>
|
54 |
</sales_order_place_after>
|
@@ -57,7 +57,7 @@
|
|
57 |
<recolize_recommendation_engine_flush_customer_status_in_session>
|
58 |
<type>singleton</type>
|
59 |
<class>recolize_recommendation_engine/observer</class>
|
60 |
-
<method>
|
61 |
</recolize_recommendation_engine_flush_customer_status_in_session>
|
62 |
</observers>
|
63 |
</customer_login>
|
@@ -66,7 +66,7 @@
|
|
66 |
<recolize_recommendation_engine_flush_customer_status_in_session>
|
67 |
<type>singleton</type>
|
68 |
<class>recolize_recommendation_engine/observer</class>
|
69 |
-
<method>
|
70 |
</recolize_recommendation_engine_flush_customer_status_in_session>
|
71 |
</observers>
|
72 |
</customer_logout>
|
16 |
<config>
|
17 |
<modules>
|
18 |
<Recolize_RecommendationEngine>
|
19 |
+
<version>2.1.1</version>
|
20 |
</Recolize_RecommendationEngine>
|
21 |
</modules>
|
22 |
<global>
|
48 |
<recolize_recommendation_engine_flush_customer_status_in_session>
|
49 |
<type>singleton</type>
|
50 |
<class>recolize_recommendation_engine/observer</class>
|
51 |
+
<method>updateUserDataInCookie</method>
|
52 |
</recolize_recommendation_engine_flush_customer_status_in_session>
|
53 |
</observers>
|
54 |
</sales_order_place_after>
|
57 |
<recolize_recommendation_engine_flush_customer_status_in_session>
|
58 |
<type>singleton</type>
|
59 |
<class>recolize_recommendation_engine/observer</class>
|
60 |
+
<method>updateUserDataInCookie</method>
|
61 |
</recolize_recommendation_engine_flush_customer_status_in_session>
|
62 |
</observers>
|
63 |
</customer_login>
|
66 |
<recolize_recommendation_engine_flush_customer_status_in_session>
|
67 |
<type>singleton</type>
|
68 |
<class>recolize_recommendation_engine/observer</class>
|
69 |
+
<method>updateUserDataAfterLogoutInCookie</method>
|
70 |
</recolize_recommendation_engine_flush_customer_status_in_session>
|
71 |
</observers>
|
72 |
</customer_logout>
|
app/design/frontend/base/default/layout/recolize_recommendation_engine.xml
CHANGED
@@ -17,7 +17,7 @@
|
|
17 |
<default>
|
18 |
<reference name="after_body_start">
|
19 |
<block type="core/template" name="recolize.recommendation.engine.javascript.snippet" template="recolize/recommendation_engine/javascript_snippet.phtml" before="-">
|
20 |
-
<block type="recolize_recommendation_engine/
|
21 |
</block>
|
22 |
<block type="core/template" name="recolize.recommendation.engine.add.to.cart" template="recolize/recommendation_engine/add_to_cart.phtml" before="-" />
|
23 |
<block type="core/template" name="recolize.recommendation.engine.add.to.wishlist" template="recolize/recommendation_engine/add_to_wishlist.phtml" before="-" />
|
17 |
<default>
|
18 |
<reference name="after_body_start">
|
19 |
<block type="core/template" name="recolize.recommendation.engine.javascript.snippet" template="recolize/recommendation_engine/javascript_snippet.phtml" before="-">
|
20 |
+
<block type="recolize_recommendation_engine/parameter" name="recolize.recommendation.engine.parameter" template="recolize/recommendation_engine/parameter.phtml" before="-" />
|
21 |
</block>
|
22 |
<block type="core/template" name="recolize.recommendation.engine.add.to.cart" template="recolize/recommendation_engine/add_to_cart.phtml" before="-" />
|
23 |
<block type="core/template" name="recolize.recommendation.engine.add.to.wishlist" template="recolize/recommendation_engine/add_to_wishlist.phtml" before="-" />
|
app/design/frontend/base/default/template/recolize/recommendation_engine/add_to_wishlist_ajax.phtml
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Recolize GmbH
|
4 |
+
*
|
5 |
+
* @section LICENSE
|
6 |
+
* This source file is subject to the GNU General Public License Version 3 (GPLv3).
|
7 |
+
*
|
8 |
+
* @category Recolize
|
9 |
+
* @package Recolize_RecommendationEngine
|
10 |
+
* @author Recolize GmbH <service@recolize.com>
|
11 |
+
* @copyright 2015 Recolize GmbH (http://www.recolize.com)
|
12 |
+
* @license http://opensource.org/licenses/GPL-3.0 GNU General Public License Version 3 (GPLv3).
|
13 |
+
*/
|
14 |
+
?>
|
15 |
+
<?php if (Mage::getStoreConfigFlag('recolize_recommendation_engine/general/enable_extension') === true): ?>
|
16 |
+
<?php if (Mage::getSingleton('recolize_recommendation_engine/session')->getIsProductAddedToWishlist() === true): ?>
|
17 |
+
|
18 |
+
<script type="text/javascript">
|
19 |
+
var RecolizeParameters = RecolizeParameters || {};
|
20 |
+
RecolizeParameters['itemAction'] = 'add_to_wishlist';
|
21 |
+
RecolizeParameters['clickedItemId'] = '<?php echo Mage::getModel('recolize_recommendation_engine/session')->getProductIdInWishlist(); ?>';
|
22 |
+
Recolize.Recommendation.Api.request();
|
23 |
+
</script>
|
24 |
+
|
25 |
+
<?php Mage::getSingleton('recolize_recommendation_engine/session')->clearAddToWishlistData(); ?>
|
26 |
+
<?php endif; ?>
|
27 |
+
<?php endif; ?>
|
app/design/frontend/base/default/template/recolize/recommendation_engine/parameter.phtml
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Recolize GmbH
|
4 |
+
*
|
5 |
+
* @section LICENSE
|
6 |
+
* This source file is subject to the GNU General Public License Version 3 (GPLv3).
|
7 |
+
*
|
8 |
+
* @category Recolize
|
9 |
+
* @package Recolize_RecommendationEngine
|
10 |
+
* @author Recolize GmbH <service@recolize.com>
|
11 |
+
* @copyright 2015 Recolize GmbH (http://www.recolize.com)
|
12 |
+
* @license http://opensource.org/licenses/GPL-3.0 GNU General Public License Version 3 (GPLv3).
|
13 |
+
*/
|
14 |
+
?>
|
15 |
+
<?php if (Mage::getStoreConfigFlag('recolize_recommendation_engine/general/enable_extension') === true): ?>
|
16 |
+
<script type="text/javascript">
|
17 |
+
var RecolizeParameters = RecolizeParameters || {};
|
18 |
+
RecolizeParameters['User'] = RecolizeParameters['User'] || {};
|
19 |
+
RecolizeParameters['User']['status'] = '<?php echo $this->getDefaultUserStatus(); ?>';
|
20 |
+
RecolizeParameters['User']['group'] = '<?php echo $this->getDefaultUserGroup(); ?>';
|
21 |
+
|
22 |
+
try {
|
23 |
+
var cookieValue = document.cookie.match(new RegExp('<?php echo $this->getCookieName(); ?>=([^;]+)'));
|
24 |
+
|
25 |
+
if (cookieValue !== null) {
|
26 |
+
cookieValue = JSON.parse(decodeURIComponent((cookieValue[1]).replace(/\+/g, '%20')));
|
27 |
+
|
28 |
+
if (typeof cookieValue != 'undefined' && typeof cookieValue == 'object') {
|
29 |
+
if (typeof cookieValue['User'] != 'undefined') {
|
30 |
+
RecolizeParameters['User'] = cookieValue['User'];
|
31 |
+
}
|
32 |
+
}
|
33 |
+
}
|
34 |
+
} catch(exception) {
|
35 |
+
}
|
36 |
+
</script>
|
37 |
+
<?php endif; ?>
|
app/design/frontend/base/default/template/recolize/recommendation_engine/user_parameter.phtml
DELETED
@@ -1,26 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Recolize GmbH
|
4 |
-
*
|
5 |
-
* @section LICENSE
|
6 |
-
* This source file is subject to the GNU General Public License Version 3 (GPLv3).
|
7 |
-
*
|
8 |
-
* @category Recolize
|
9 |
-
* @package Recolize_RecommendationEngine
|
10 |
-
* @author Recolize GmbH <service@recolize.com>
|
11 |
-
* @copyright 2015 Recolize GmbH (http://www.recolize.com)
|
12 |
-
* @license http://opensource.org/licenses/GPL-3.0 GNU General Public License Version 3 (GPLv3).
|
13 |
-
*/
|
14 |
-
/**
|
15 |
-
* @var Recolize_RecommendationEngine_Block_Userparameter $this
|
16 |
-
*/
|
17 |
-
?>
|
18 |
-
<script type="text/javascript">
|
19 |
-
var RecolizeParameters = RecolizeParameters || {};
|
20 |
-
RecolizeParameters['User'] = RecolizeParameters['User'] || {};
|
21 |
-
<?php if ($this->isCustomerLoggedIn() === true): ?>
|
22 |
-
RecolizeParameters['User']['id'] = '<?php echo $this->getCustomerId(); ?>';
|
23 |
-
<?php endif; ?>
|
24 |
-
RecolizeParameters['User']['status'] = '<?php echo $this->getCustomerStatus(); ?>';
|
25 |
-
RecolizeParameters['User']['group'] = '<?php echo $this->getCustomerGroup(); ?>';
|
26 |
-
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
package.xml
CHANGED
@@ -1,22 +1,18 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>recolize_recommendation_engine</name>
|
4 |
-
<version>2.1.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/GPL-3.0">GNU General Public License (GPL)</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>The Recolize Recommendation Engine generates personalized product recommendations.</summary>
|
10 |
<description>The Recolize Recommendation Engine is a recommendation service for shops of every size. You can integrate our extension in minutes and immediately start with personalized recommendations in your shop. No matter what size it is.</description>
|
11 |
-
<notes>-
|
12 |
-
- Added a new add to wishlist action
|
13 |
-
- Enabled customer context filters
|
14 |
-
- The export now recognizes the tax display settings to export the correct prices also for e.g. B2B stores
|
15 |
-
- Improved cache handling for the FPC of Magento Enterprise</notes>
|
16 |
<authors><author><name>Recolize GmbH</name><user>recolize</user><email>admin@recolize.com</email></author></authors>
|
17 |
-
<date>2016-02-
|
18 |
-
<time>
|
19 |
-
<contents><target name="magecommunity"><dir name="Recolize"><dir name="RecommendationEngine"><dir name="Block"><file name="
|
20 |
<compatible/>
|
21 |
<dependencies><required><php><min>5.2.13</min><max>6.0.0</max></php></required></dependencies>
|
22 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>recolize_recommendation_engine</name>
|
4 |
+
<version>2.1.1</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/GPL-3.0">GNU General Public License (GPL)</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>The Recolize Recommendation Engine generates personalized product recommendations.</summary>
|
10 |
<description>The Recolize Recommendation Engine is a recommendation service for shops of every size. You can integrate our extension in minutes and immediately start with personalized recommendations in your shop. No matter what size it is.</description>
|
11 |
+
<notes>- Optimized caching behaviour for e.g. compatibility with Varnish</notes>
|
|
|
|
|
|
|
|
|
12 |
<authors><author><name>Recolize GmbH</name><user>recolize</user><email>admin@recolize.com</email></author></authors>
|
13 |
+
<date>2016-02-22</date>
|
14 |
+
<time>08:25:07</time>
|
15 |
+
<contents><target name="magecommunity"><dir name="Recolize"><dir name="RecommendationEngine"><dir name="Block"><file name="Parameter.php" hash="180f6297d51910742acdf38a5243f0c3"/></dir><dir name="Helper"><file name="Data.php" hash="f259029d42b61f7505d482bd71047c5f"/></dir><file name="Installation_Instructions.pdf" hash="6dbc83b65fc75a105fd49df6294f07f1"/><file name="Installationsanleitung.pdf" hash="755bda8b121e28b25c8630ce1f222ec1"/><dir name="Model"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Source"><file name="Feed.php" hash="2e47a8d51daf64b02646fe0516fd9449"/></dir></dir></dir></dir><dir name="Convert"><dir name="Mapper"><file name="Column.php" hash="d1f833e5bdd27a6e7ee5ea20bedc5052"/></dir><dir name="Parser"><file name="Product.php" hash="8bda25fb519231402379bf1747046906"/></dir></dir><file name="Cookie.php" hash="99893a483414f2ebdae61a6953bc5c4b"/><dir name="Enterprise"><dir name="PageCache"><file name="Container.php" hash="916bc2217ba4961bb5c79de6d6994e60"/></dir></dir><file name="Feed.php" hash="35fe46a26f2bc85cff458d8a3a922060"/><file name="Observer.php" hash="2134e5f86125f497e01834cdb83681fd"/><file name="Session.php" hash="615ca6fd39f138d286166b191fb34259"/><file name="User.php" hash="02e1a80192a85c5e5b2a9bf8807e63b0"/></dir><dir name="data"><dir name="recolize_re_setup"><file name="data-install-2.0.1.php" hash="91325d474359f9f4bbaf5ae96954d8d6"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="f2ac8a1129641c29badeb635f7d6911c"/><file name="cache.xml" hash="8cc1d018bdecf6b21cb5c138a9efa505"/><file name="config.xml" hash="8555bff4e758744bd390519c7a9268e8"/><file name="system.xml" hash="c5cb569c7c87ed56ed8f7adec9dcf38b"/></dir><dir name="sql"><dir name="recolize_re_setup"><file name="mysql4-install-2.0.0.php" hash="cd2fcf1924cd80c155e23e0448db1712"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="base"><dir name="default"><dir name="layout"><file name="recolize_recommendation_engine.xml" hash="bed9cd00bf277ff3ed65b8c75bef0102"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="recolize"><dir name="recommendation_engine"><file name="add_to_cart.phtml" hash="562d936642bb97fc68b759ab254e7043"/><file name="add_to_cart_ajax.phtml" hash="8e5b043a589834922675e35084e7f2fd"/><file name="add_to_wishlist.phtml" hash="95a1e63e74daf779a908abc703c4e1c7"/><file name="add_to_wishlist_ajax.phtml" hash="153874f9548eeea5d3ad600972fec146"/><file name="category_view.phtml" hash="a7dfaac5a2303784758cbcc0aaef4e66"/><file name="checkout_success.phtml" hash="3f6f805e803d4e79b3caf7bae53c1f12"/><file name="javascript_snippet.phtml" hash="88cbb5e0837512ed60e09bd6acffa67e"/><file name="parameter.phtml" hash="b07e6134615cb63e0390e31771385dc6"/><file name="product_view.phtml" hash="2df6201012bed18d210ee34df965ff48"/></dir></dir></dir><dir name="layout"><file name="recolize_recommendation_engine.xml" hash="763f8aa1ea5e23f7eab2086ba3556a4b"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Recolize_RecommendationEngine.xml" hash="379b47272f4b53bb5c8632474cb3bce7"/></dir></target><target name="magelocale"><dir><dir name="de_DE"><file name="Recolize_RecommendationEngine.csv" hash="f25ebed16c021391368f024268952f49"/></dir><dir name="en_US"><file name="Recolize_RecommendationEngine.csv" hash="85ec4bf3434c62b243f69edb26460ae5"/></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="css"><dir name="recolize"><dir name="recommendation_engine"><file name="configuration.css" hash="2edfa2909522551ec139a7c55b1e0348"/></dir></dir></dir></dir></dir></dir></target></contents>
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.2.13</min><max>6.0.0</max></php></required></dependencies>
|
18 |
</package>
|