Version Notes
New configuration option included to allow recommendation content to be returned with full product details including SKUs. The default setting will only allow recommendations to be sent as SKUs.
Download this release
Release Info
Developer | Peerius |
Extension | Peerius_Connect |
Version | 1.0.9 |
Comparing to | |
See all releases |
Code changes from version 1.0.4 to 1.0.9
- app/code/community/Peerius/Smartrecs/.DS_Store +0 -0
- app/code/community/Peerius/Smartrecs/Block/Recommendations.php +2 -2
- app/code/community/Peerius/Smartrecs/Block/Template.php +185 -127
- app/code/community/Peerius/Smartrecs/Block/Tracking.php +78 -28
- app/code/community/Peerius/Smartrecs/Helper/Data.php +13 -0
- app/code/community/Peerius/Smartrecs/Model/.DS_Store +0 -0
- app/code/community/Peerius/Smartrecs/Model/Feed/Creator.php +599 -504
- app/code/community/Peerius/Smartrecs/Model/SearchLayer.php +36 -24
- app/code/community/Peerius/Smartrecs/controllers/FeedController.php +144 -145
- app/code/community/Peerius/Smartrecs/controllers/InfoController.php +348 -193
- app/code/community/Peerius/Smartrecs/etc/config.xml +97 -97
- app/code/community/Peerius/Smartrecs/etc/system.xml +493 -484
- app/design/adminhtml/default/default/template/smartrecs/config.phtml +5 -1
- app/design/frontend/base/default/template/smartrecs/recs/basket.phtml +51 -9
- app/design/frontend/base/default/template/smartrecs/recs/category.phtml +51 -9
- app/design/frontend/base/default/template/smartrecs/recs/home.phtml +51 -9
- app/design/frontend/base/default/template/smartrecs/recs/product-1.phtml +51 -9
- app/design/frontend/base/default/template/smartrecs/recs/product-2.phtml +51 -9
- app/design/frontend/base/default/template/smartrecs/recs/search.phtml +51 -9
- app/design/frontend/base/default/template/smartrecs/render.phtml +11 -13
- app/design/frontend/base/default/template/smartrecs/smartrecs.phtml +56 -54
- package.xml +190 -22
- skin/adminhtml/default/default/peerius/smartrecs/css/config.css +30 -11
- skin/adminhtml/default/default/peerius/smartrecs/img/logo-hover.png +0 -0
- skin/adminhtml/default/default/peerius/smartrecs/img/logo-rollover.png +0 -0
- skin/adminhtml/default/default/peerius/smartrecs/img/logo.png +0 -0
- skin/adminhtml/default/default/peerius/smartrecs/img/navigation.png +0 -0
app/code/community/Peerius/Smartrecs/.DS_Store
DELETED
Binary file
|
app/code/community/Peerius/Smartrecs/Block/Recommendations.php
CHANGED
@@ -88,8 +88,8 @@ class Peerius_Smartrecs_Block_Recommendations extends Mage_Core_Block_Template i
|
|
88 |
|
89 |
if ($template) {
|
90 |
$template = (strpos($template, DS) === false) ? 'smartrecs/recs/'.$template : $template;
|
91 |
-
|
92 |
-
if ($this->getRequest()->getParam('peeriuslocalpreview') AND !array_key_exists($id, $this->_fixTemplates)) {
|
93 |
return Mage::getSingleton('core/layout')
|
94 |
->createBlock('smartrecs/template')
|
95 |
->setTemplate($template)
|
88 |
|
89 |
if ($template) {
|
90 |
$template = (strpos($template, DS) === false) ? 'smartrecs/recs/'.$template : $template;
|
91 |
+
|
92 |
+
if ($this->getRequest()->getParam('peeriuslocalpreview') AND !array_key_exists($id, $this->_fixTemplates)) {
|
93 |
return Mage::getSingleton('core/layout')
|
94 |
->createBlock('smartrecs/template')
|
95 |
->setTemplate($template)
|
app/code/community/Peerius/Smartrecs/Block/Template.php
CHANGED
@@ -1,127 +1,185 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* @category Peerius
|
5 |
-
* @package Peerius_Smartrecs
|
6 |
-
* @author Peerius Ltd
|
7 |
-
*/
|
8 |
-
class Peerius_Smartrecs_Block_Template extends Mage_Catalog_Block_Product_List {
|
9 |
-
|
10 |
-
const DEFAULT_ITEM_NUM = 3;
|
11 |
-
|
12 |
-
const MAX_ITEM_NUM = 10;
|
13 |
-
|
14 |
-
protected $_columnCount = 4;
|
15 |
-
|
16 |
-
protected $_i = 0;
|
17 |
-
|
18 |
-
protected
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
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 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
}
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
public function
|
104 |
-
{
|
105 |
-
$this->getItems();
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @category Peerius
|
5 |
+
* @package Peerius_Smartrecs
|
6 |
+
* @author Peerius Ltd
|
7 |
+
*/
|
8 |
+
class Peerius_Smartrecs_Block_Template extends Mage_Catalog_Block_Product_List {
|
9 |
+
|
10 |
+
const DEFAULT_ITEM_NUM = 3;
|
11 |
+
|
12 |
+
const MAX_ITEM_NUM = 10;
|
13 |
+
|
14 |
+
protected $_columnCount = 4;
|
15 |
+
|
16 |
+
protected $_i = 0;
|
17 |
+
|
18 |
+
protected $_debugMode;
|
19 |
+
|
20 |
+
protected function _prepareData() {
|
21 |
+
|
22 |
+
$debugMode = $this->setDebugMode();
|
23 |
+
|
24 |
+
$num = false;
|
25 |
+
$skus = false;
|
26 |
+
$max = false;
|
27 |
+
|
28 |
+
if ($this->getRequest()->getParam('skus')) {
|
29 |
+
$skus = explode(',',$this->getRequest()->getParam('skus'));
|
30 |
+
}
|
31 |
+
|
32 |
+
if ($this->getRequest()->getParam('recs')) {
|
33 |
+
$recs = json_decode($this->getRequest()->getParam('recs'));
|
34 |
+
$num = count($recs);
|
35 |
+
$skus = array();
|
36 |
+
for ($i = 0; $i < $num; $i++) {
|
37 |
+
$skus[] = $recs[$i]->refCode;
|
38 |
+
}
|
39 |
+
$dL = $this->_dLog('Template.php => RECS count is '.count($recs).' & SKUS count is '.count($skus));
|
40 |
+
$dL = $this->_dLog('Template.php ALL PARAMS => '.print_r($this->getRequest()->getParams(),1));
|
41 |
+
|
42 |
+
}
|
43 |
+
else {
|
44 |
+
$dL = $this->_dLog('Template.php => $this->getRequest()->getParam(recs) is empty');
|
45 |
+
$dL = $this->_dLog('Template.php ALL PARAMS =>'.print_r($this->getRequest()->getParams(),1));
|
46 |
+
}
|
47 |
+
|
48 |
+
$max = !$max ? (int) $this->getRequest()->getParam('max') : self::DEFAULT_ITEM_NUM;
|
49 |
+
$max = $max > self::MAX_ITEM_NUM ? self::MAX_ITEM_NUM : $max;
|
50 |
+
|
51 |
+
if($this->isRecContentRefCodeOnly())
|
52 |
+
{
|
53 |
+
|
54 |
+
//This is a possible fix for JosephJoseph
|
55 |
+
//Enable EAV for JosephJoseph
|
56 |
+
$process = Mage::helper('catalog/product_flat')->getProcess();
|
57 |
+
//get current setting
|
58 |
+
$status = $process->getStatus();
|
59 |
+
$process->setStatus(Mage_Index_Model_Process::STATUS_RUNNING);
|
60 |
+
$dL = $this->_dLog('Template.php => EAV ENABLED');
|
61 |
+
//EAV enabled
|
62 |
+
|
63 |
+
$this->_productCollection = Mage::getModel('catalog/product')
|
64 |
+
->getCollection()
|
65 |
+
->addAttributeToSelect('*');
|
66 |
+
|
67 |
+
if ($skus) {
|
68 |
+
$this->_productCollection->addAttributeToFilter('SKU', array('in'=>$skus));
|
69 |
+
$this->_productCollection->getSelect()->order("find_in_set(SKU,'".implode(',',$skus)."')");
|
70 |
+
}
|
71 |
+
|
72 |
+
$this->_productCollection->getSelect()->limit($max);
|
73 |
+
$dL = $this->_dLog($this->_productCollection->getSelect()->__toString());
|
74 |
+
|
75 |
+
$this->_productCollection->load();
|
76 |
+
|
77 |
+
//Reset to flat catalog
|
78 |
+
$process->setStatus($status);
|
79 |
+
$dL = $this->_dLog('Template.php => EAV DISABLED');
|
80 |
+
}
|
81 |
+
else
|
82 |
+
{
|
83 |
+
$dL = $this->_dLog('Template.php => RECS RETURNED WITH FULL DETAILS');
|
84 |
+
}
|
85 |
+
|
86 |
+
return $this;
|
87 |
+
}
|
88 |
+
|
89 |
+
protected function _beforeToHtml() {
|
90 |
+
$this->_prepareData();
|
91 |
+
parent::_beforeToHtml();
|
92 |
+
}
|
93 |
+
|
94 |
+
public function getItems() {
|
95 |
+
return $this->_productCollection ? $this->_productCollection : null;
|
96 |
+
}
|
97 |
+
|
98 |
+
/**
|
99 |
+
* Count items
|
100 |
+
*
|
101 |
+
* @return int
|
102 |
+
*/
|
103 |
+
public function getItemCount()
|
104 |
+
{
|
105 |
+
return count($this->getItems());
|
106 |
+
}
|
107 |
+
|
108 |
+
public function getItemCollection() {
|
109 |
+
return $this->_productCollection;
|
110 |
+
}
|
111 |
+
|
112 |
+
public function isRecContentRefCodeOnly()
|
113 |
+
{
|
114 |
+
return Mage::helper('peerius_smartrecs')->getRecsAsSKUsOnly()? true : false;
|
115 |
+
}
|
116 |
+
|
117 |
+
|
118 |
+
public function getRowCount()
|
119 |
+
{
|
120 |
+
return ceil(count($this->getItemCollection()->getItems())/$this->getColumnCount());
|
121 |
+
}
|
122 |
+
|
123 |
+
public function setColumnCount($columns)
|
124 |
+
{
|
125 |
+
if (intval($columns) > 0) {
|
126 |
+
$this->_columnCount = intval($columns);
|
127 |
+
}
|
128 |
+
return $this;
|
129 |
+
}
|
130 |
+
|
131 |
+
public function getColumnCount()
|
132 |
+
{
|
133 |
+
return $this->_columnCount;
|
134 |
+
}
|
135 |
+
|
136 |
+
public function resetItemsIterator()
|
137 |
+
{
|
138 |
+
$this->getItems();
|
139 |
+
reset($this->_productCollection);
|
140 |
+
}
|
141 |
+
|
142 |
+
public function getIterableItem()
|
143 |
+
{
|
144 |
+
if (is_array($this->_productCollection)) {
|
145 |
+
$item = current($this->_productCollection);
|
146 |
+
next($this->_productCollection);
|
147 |
+
return $item;
|
148 |
+
}
|
149 |
+
|
150 |
+
// the iterator on an object doesn't work like this
|
151 |
+
$i = 0;
|
152 |
+
foreach ($this->_productCollection as $item) {
|
153 |
+
if ($this->_i == $i++) {
|
154 |
+
$this->_i++;
|
155 |
+
return $item;
|
156 |
+
}
|
157 |
+
}
|
158 |
+
}
|
159 |
+
|
160 |
+
public function getCurrencyCode()
|
161 |
+
{
|
162 |
+
//$rates = Mage::getModel('directory/currency')->getCurrencyRates($baseCode, array_values($allowedCurrencies));
|
163 |
+
return Mage::app()->getStore()->getCurrentCurrencyCode();
|
164 |
+
}
|
165 |
+
|
166 |
+
public function getCurrencySymbol()
|
167 |
+
{
|
168 |
+
return Mage::app()->getLocale()->currency(Mage::app()->getStore()->getCurrentCurrencyCode())->getSymbol();
|
169 |
+
}
|
170 |
+
|
171 |
+
private function setDebugMode()
|
172 |
+
{
|
173 |
+
$this->_debugMode = Mage::getSingleton('core/session')->getPeeriusDebug() != null ? true : false;
|
174 |
+
if($this->_debugMode) Mage::log('PEERIUS DEBUG FOR RECS ENABLED', null, 'peerius_smartrec.log');
|
175 |
+
return $this->_debugMode;
|
176 |
+
}
|
177 |
+
|
178 |
+
private function _dLog($msg)
|
179 |
+
{
|
180 |
+
if($this->_debugMode == true) Mage::log($msg, null, 'peerius_smartrec.log');
|
181 |
+
return true;
|
182 |
+
}
|
183 |
+
|
184 |
+
}
|
185 |
+
|
app/code/community/Peerius/Smartrecs/Block/Tracking.php
CHANGED
@@ -8,6 +8,8 @@
|
|
8 |
class Peerius_Smartrecs_Block_Tracking extends Mage_Core_Block_Template {
|
9 |
|
10 |
protected $_pageType;
|
|
|
|
|
11 |
/*
|
12 |
* getter for page type
|
13 |
*/
|
@@ -21,7 +23,9 @@ class Peerius_Smartrecs_Block_Tracking extends Mage_Core_Block_Template {
|
|
21 |
*/
|
22 |
public function getTrackingPixel() {
|
23 |
$fullActionName = Mage::app()->getFrontController()->getAction()->getFullActionName();
|
24 |
-
|
|
|
|
|
25 |
switch ($fullActionName) {
|
26 |
case 'cms_index_index':
|
27 |
$routeName = Mage::app()->getRequest()->getRouteName();
|
@@ -75,7 +79,7 @@ class Peerius_Smartrecs_Block_Tracking extends Mage_Core_Block_Template {
|
|
75 |
$pixel = array(
|
76 |
'type' => 'home',
|
77 |
'lang' => $this->_getLang(),
|
78 |
-
'recContent' =>
|
79 |
);
|
80 |
$user = $this->_getUser();
|
81 |
if ($user) {
|
@@ -93,7 +97,7 @@ class Peerius_Smartrecs_Block_Tracking extends Mage_Core_Block_Template {
|
|
93 |
$pixel = array(
|
94 |
'type' => 'product',
|
95 |
'lang' => $this->_getLang(),
|
96 |
-
'recContent' =>
|
97 |
);
|
98 |
$user = $this->_getUser();
|
99 |
if ($user) {
|
@@ -116,7 +120,7 @@ class Peerius_Smartrecs_Block_Tracking extends Mage_Core_Block_Template {
|
|
116 |
$pixel = array(
|
117 |
'type' => 'category',
|
118 |
'lang' => $this->_getLang(),
|
119 |
-
'recContent' =>
|
120 |
);
|
121 |
$user = $this->_getUser();
|
122 |
if ($user) {
|
@@ -126,6 +130,7 @@ class Peerius_Smartrecs_Block_Tracking extends Mage_Core_Block_Template {
|
|
126 |
if ($category AND $category->getId()) {
|
127 |
$pixel['category'] = $this->_getCategoryBreadcrumb($category->getId());
|
128 |
}
|
|
|
129 |
return json_encode($pixel);
|
130 |
}
|
131 |
|
@@ -139,7 +144,7 @@ class Peerius_Smartrecs_Block_Tracking extends Mage_Core_Block_Template {
|
|
139 |
$pixel = array(
|
140 |
'type' => 'basket',
|
141 |
'lang' => $this->_getLang(),
|
142 |
-
'recContent' =>
|
143 |
);
|
144 |
$user = $this->_getUser();
|
145 |
if ($user) {
|
@@ -149,13 +154,23 @@ class Peerius_Smartrecs_Block_Tracking extends Mage_Core_Block_Template {
|
|
149 |
$items = $cart->getAllItems();
|
150 |
$pixel['basket']['items'] = array();
|
151 |
foreach ($items as $item) {
|
152 |
-
|
153 |
-
|
154 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
155 |
$newItem = array(
|
156 |
-
'refCode' => $item->
|
157 |
'qty' => $item->getQty(),
|
158 |
-
'price' => $
|
159 |
);
|
160 |
$pixel['basket']['items'][] = $newItem;
|
161 |
}
|
@@ -172,7 +187,7 @@ class Peerius_Smartrecs_Block_Tracking extends Mage_Core_Block_Template {
|
|
172 |
$pixel = array(
|
173 |
'type' => 'checkout',
|
174 |
'lang' => $this->_getLang(),
|
175 |
-
'recContent' =>
|
176 |
);
|
177 |
$user = $this->_getUser();
|
178 |
if ($user) {
|
@@ -181,13 +196,18 @@ class Peerius_Smartrecs_Block_Tracking extends Mage_Core_Block_Template {
|
|
181 |
$cart = Mage::getModel('checkout/cart')->getQuote();
|
182 |
$items = $cart->getAllItems();
|
183 |
foreach ($items as $item) {
|
184 |
-
|
185 |
-
|
186 |
-
|
|
|
|
|
|
|
|
|
|
|
187 |
$newItem = array(
|
188 |
-
'refCode' => $item->
|
189 |
'qty' => (int) $item->getQty(),
|
190 |
-
'price' => $
|
191 |
);
|
192 |
$pixel['checkout']['items'][] = $newItem;
|
193 |
}
|
@@ -213,7 +233,7 @@ class Peerius_Smartrecs_Block_Tracking extends Mage_Core_Block_Template {
|
|
213 |
$pixel = array(
|
214 |
'type' => 'order',
|
215 |
'lang' => $this->_getLang(),
|
216 |
-
'recContent' =>
|
217 |
);
|
218 |
$user = $this->_getUser();
|
219 |
if ($user) {
|
@@ -224,13 +244,18 @@ class Peerius_Smartrecs_Block_Tracking extends Mage_Core_Block_Template {
|
|
224 |
$pixel['order']['orderNo'] = $order->getIncrementId();
|
225 |
$items = $order->getAllItems();
|
226 |
foreach ($items as $item) {
|
227 |
-
|
228 |
-
|
229 |
-
|
|
|
|
|
|
|
|
|
|
|
230 |
$newItem = array(
|
231 |
-
'refCode' => $item->
|
232 |
'qty' => (int) $item->getQtyOrdered(),
|
233 |
-
'price' => $
|
234 |
);
|
235 |
$pixel['order']['items'][] = $newItem;
|
236 |
}
|
@@ -255,7 +280,7 @@ class Peerius_Smartrecs_Block_Tracking extends Mage_Core_Block_Template {
|
|
255 |
$pixel = array(
|
256 |
'type' => 'searchresults',
|
257 |
'lang' => $this->_getLang(),
|
258 |
-
'recContent' =>
|
259 |
);
|
260 |
$user = $this->_getUser();
|
261 |
if ($user) {
|
@@ -264,6 +289,8 @@ class Peerius_Smartrecs_Block_Tracking extends Mage_Core_Block_Template {
|
|
264 |
$term = Mage::helper('catalogsearch')->getQueryText();
|
265 |
$pixel['searchResults']['term'] = $this->escapeHtml($term);
|
266 |
$searchResult = array_slice(Mage::registry('peerius_smartrecs_searchresults'), 0, 10);
|
|
|
|
|
267 |
$pixel['searchResults']['results'] = $searchResult;
|
268 |
return json_encode($pixel);
|
269 |
}
|
@@ -277,7 +304,7 @@ class Peerius_Smartrecs_Block_Tracking extends Mage_Core_Block_Template {
|
|
277 |
$pixel = array(
|
278 |
'type' => 'wishlist',
|
279 |
'lang' => $this->_getLang(),
|
280 |
-
'recContent' =>
|
281 |
);
|
282 |
$user = $this->_getUser();
|
283 |
if ($user) {
|
@@ -330,7 +357,6 @@ class Peerius_Smartrecs_Block_Tracking extends Mage_Core_Block_Template {
|
|
330 |
|
331 |
$fullPath = array();
|
332 |
foreach ($p as $treeCat) {
|
333 |
-
// Root-Kategorie 1 überspringen
|
334 |
if ($treeCat <= 2)
|
335 |
continue;
|
336 |
$category = Mage::getModel('catalog/category')
|
@@ -393,7 +419,31 @@ class Peerius_Smartrecs_Block_Tracking extends Mage_Core_Block_Template {
|
|
393 |
}
|
394 |
return '<script type="text/JavaScript" src="//'.$this->escapeHtml(Mage::getStoreConfig('peerius/general/client_name')).'.peerius.com/tracker/peerius.page" charset="UTF-8"></script>';
|
395 |
}
|
396 |
-
|
397 |
-
|
398 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
399 |
|
|
8 |
class Peerius_Smartrecs_Block_Tracking extends Mage_Core_Block_Template {
|
9 |
|
10 |
protected $_pageType;
|
11 |
+
protected $_debugMode;
|
12 |
+
protected $_refCodeOnlyOrFull;
|
13 |
/*
|
14 |
* getter for page type
|
15 |
*/
|
23 |
*/
|
24 |
public function getTrackingPixel() {
|
25 |
$fullActionName = Mage::app()->getFrontController()->getAction()->getFullActionName();
|
26 |
+
$debugMode = $this->setDebugMode();
|
27 |
+
$this->_refCodeOnlyOrFull = Mage::helper('peerius_smartrecs')->getRecsAsSKUsOnly()? 'refCodeOnly' : 'full';
|
28 |
+
|
29 |
switch ($fullActionName) {
|
30 |
case 'cms_index_index':
|
31 |
$routeName = Mage::app()->getRequest()->getRouteName();
|
79 |
$pixel = array(
|
80 |
'type' => 'home',
|
81 |
'lang' => $this->_getLang(),
|
82 |
+
'recContent' => $this->_refCodeOnlyOrFull
|
83 |
);
|
84 |
$user = $this->_getUser();
|
85 |
if ($user) {
|
97 |
$pixel = array(
|
98 |
'type' => 'product',
|
99 |
'lang' => $this->_getLang(),
|
100 |
+
'recContent' => $this->_refCodeOnlyOrFull
|
101 |
);
|
102 |
$user = $this->_getUser();
|
103 |
if ($user) {
|
120 |
$pixel = array(
|
121 |
'type' => 'category',
|
122 |
'lang' => $this->_getLang(),
|
123 |
+
'recContent' => $this->_refCodeOnlyOrFull
|
124 |
);
|
125 |
$user = $this->_getUser();
|
126 |
if ($user) {
|
130 |
if ($category AND $category->getId()) {
|
131 |
$pixel['category'] = $this->_getCategoryBreadcrumb($category->getId());
|
132 |
}
|
133 |
+
|
134 |
return json_encode($pixel);
|
135 |
}
|
136 |
|
144 |
$pixel = array(
|
145 |
'type' => 'basket',
|
146 |
'lang' => $this->_getLang(),
|
147 |
+
'recContent' => $this->_refCodeOnlyOrFull
|
148 |
);
|
149 |
$user = $this->_getUser();
|
150 |
if ($user) {
|
154 |
$items = $cart->getAllItems();
|
155 |
$pixel['basket']['items'] = array();
|
156 |
foreach ($items as $item) {
|
157 |
+
//code pre v 1.0.8
|
158 |
+
//if ($item->getParentItem()) continue;
|
159 |
+
|
160 |
+
//if ($item->getProduct()->getData('visibility')==1) {
|
161 |
+
//Mage::log($item->getParentItem()->getProduct()->getData('sku'), null, 'peerius_smartrec.log');
|
162 |
+
//continue;
|
163 |
+
//}
|
164 |
+
|
165 |
+
// ignore skus that are not visible as product pages
|
166 |
+
if(!$item->getProduct()->isVisibleInSiteVisibility()) continue;
|
167 |
+
$dL = $this->_dLog('BASKET TRACKING: '.$item->getProduct()->getData('sku').' is '.strtoupper($item->getProductType()).' & '.($item->getProduct()->isVisibleInSiteVisibility()? "VISIBLE": "NOT VISIBLE"));
|
168 |
+
|
169 |
+
$priceIncTax = Mage::helper('tax')->getPrice($item, $item->getPrice(), true);
|
170 |
$newItem = array(
|
171 |
+
'refCode' => $item->getProduct()->getData('sku'),
|
172 |
'qty' => $item->getQty(),
|
173 |
+
'price' => $priceIncTax
|
174 |
);
|
175 |
$pixel['basket']['items'][] = $newItem;
|
176 |
}
|
187 |
$pixel = array(
|
188 |
'type' => 'checkout',
|
189 |
'lang' => $this->_getLang(),
|
190 |
+
'recContent' => $this->_refCodeOnlyOrFull
|
191 |
);
|
192 |
$user = $this->_getUser();
|
193 |
if ($user) {
|
196 |
$cart = Mage::getModel('checkout/cart')->getQuote();
|
197 |
$items = $cart->getAllItems();
|
198 |
foreach ($items as $item) {
|
199 |
+
//code pre v 1.0.8
|
200 |
+
//if ($item->getParentItem()) continue;
|
201 |
+
|
202 |
+
// ignore skus that are not visible as product pages
|
203 |
+
if(!$item->getProduct()->isVisibleInSiteVisibility()) continue;
|
204 |
+
$dL = $this->_dLog('CHECKOUT TRACKING: '.$item->getProduct()->getData('sku').' is '.strtoupper($item->getProductType()).' & '.($item->getProduct()->isVisibleInSiteVisibility()? "VISIBLE": "NOT VISIBLE"));
|
205 |
+
|
206 |
+
$priceIncTax = Mage::helper('tax')->getPrice($item, $item->getPrice(), true);
|
207 |
$newItem = array(
|
208 |
+
'refCode' => $item->getProduct()->getData('sku'),
|
209 |
'qty' => (int) $item->getQty(),
|
210 |
+
'price' => $priceIncTax
|
211 |
);
|
212 |
$pixel['checkout']['items'][] = $newItem;
|
213 |
}
|
233 |
$pixel = array(
|
234 |
'type' => 'order',
|
235 |
'lang' => $this->_getLang(),
|
236 |
+
'recContent' => $this->_refCodeOnlyOrFull
|
237 |
);
|
238 |
$user = $this->_getUser();
|
239 |
if ($user) {
|
244 |
$pixel['order']['orderNo'] = $order->getIncrementId();
|
245 |
$items = $order->getAllItems();
|
246 |
foreach ($items as $item) {
|
247 |
+
//code pre v 1.0.8
|
248 |
+
//if ($item->getParentItem()) continue;
|
249 |
+
|
250 |
+
// ignore skus that are not visible as product pages
|
251 |
+
if(!$item->getProduct()->isVisibleInSiteVisibility()) continue;
|
252 |
+
$dL = $this->_dLog('ORDER TRACKING: '.$item->getProduct()->getData('sku').' is '.strtoupper($item->getProductType()).' & '.($item->getProduct()->isVisibleInSiteVisibility()? "VISIBLE": "NOT VISIBLE"));
|
253 |
+
|
254 |
+
$priceIncTax = Mage::helper('tax')->getPrice($item, $item->getPrice(), true);
|
255 |
$newItem = array(
|
256 |
+
'refCode' => $item->getProduct()->getData('sku'),
|
257 |
'qty' => (int) $item->getQtyOrdered(),
|
258 |
+
'price' => $priceIncTax
|
259 |
);
|
260 |
$pixel['order']['items'][] = $newItem;
|
261 |
}
|
280 |
$pixel = array(
|
281 |
'type' => 'searchresults',
|
282 |
'lang' => $this->_getLang(),
|
283 |
+
'recContent' => $this->_refCodeOnlyOrFull
|
284 |
);
|
285 |
$user = $this->_getUser();
|
286 |
if ($user) {
|
289 |
$term = Mage::helper('catalogsearch')->getQueryText();
|
290 |
$pixel['searchResults']['term'] = $this->escapeHtml($term);
|
291 |
$searchResult = array_slice(Mage::registry('peerius_smartrecs_searchresults'), 0, 10);
|
292 |
+
$dL = $this->_dLog('SEARCH TRACKING: '.print_r($searchResult,1));
|
293 |
+
|
294 |
$pixel['searchResults']['results'] = $searchResult;
|
295 |
return json_encode($pixel);
|
296 |
}
|
304 |
$pixel = array(
|
305 |
'type' => 'wishlist',
|
306 |
'lang' => $this->_getLang(),
|
307 |
+
'recContent' => $this->_refCodeOnlyOrFull
|
308 |
);
|
309 |
$user = $this->_getUser();
|
310 |
if ($user) {
|
357 |
|
358 |
$fullPath = array();
|
359 |
foreach ($p as $treeCat) {
|
|
|
360 |
if ($treeCat <= 2)
|
361 |
continue;
|
362 |
$category = Mage::getModel('catalog/category')
|
419 |
}
|
420 |
return '<script type="text/JavaScript" src="//'.$this->escapeHtml(Mage::getStoreConfig('peerius/general/client_name')).'.peerius.com/tracker/peerius.page" charset="UTF-8"></script>';
|
421 |
}
|
422 |
+
|
423 |
+
private function setDebugMode()
|
424 |
+
{
|
425 |
+
$this->_debugMode = false;
|
426 |
+
if(Mage::app()->getRequest()->getParam('pbug') == 1 && Mage::getSingleton('core/session')->getPeeriusDebug()== null)
|
427 |
+
{
|
428 |
+
Mage::getSingleton('core/session')->setPeeriusDebug(true);
|
429 |
+
}
|
430 |
+
$this->_debugMode = Mage::getSingleton('core/session')->getPeeriusDebug() != null ? true : false;
|
431 |
+
|
432 |
+
if(Mage::app()->getRequest()->getParam('pbug') != null && Mage::app()->getRequest()->getParam('pbug') == 0 && Mage::getSingleton('core/session')->getPeeriusDebug()!= null)
|
433 |
+
{
|
434 |
+
Mage::getSingleton('core/session')->unsPeeriusDebug();
|
435 |
+
$this->_debugMode = false;
|
436 |
+
}
|
437 |
+
if(Mage::app()->getRequest()->getParam('pbug') != null)
|
438 |
+
Mage::log('PEERIUS DEBUG '.( Mage::app()->getRequest()->getParam('pbug')==1 ? 'EN' : 'DIS').'ABLED', null, 'peerius_smartrec.log');
|
439 |
+
return $this->_debugMode;
|
440 |
+
}
|
441 |
+
|
442 |
+
private function _dLog($msg)
|
443 |
+
{
|
444 |
+
|
445 |
+
if($this->_debugMode == true) Mage::log($msg, null, 'peerius_smartrec.log');
|
446 |
+
return true;
|
447 |
+
}
|
448 |
|
449 |
+
}
|
app/code/community/Peerius/Smartrecs/Helper/Data.php
CHANGED
@@ -133,4 +133,17 @@ class Peerius_Smartrecs_Helper_Data extends Mage_Core_Helper_Abstract {
|
|
133 |
return false;
|
134 |
|
135 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
136 |
}
|
133 |
return false;
|
134 |
|
135 |
}
|
136 |
+
|
137 |
+
/*
|
138 |
+
* read the plugin settings to see if recommendations are disabled
|
139 |
+
* @return bool
|
140 |
+
*/
|
141 |
+
public function getRecsAsSKUsOnly() {
|
142 |
+
|
143 |
+
if (Mage::getStoreConfig('peerius/general/enableall') == 1 && Mage::getStoreConfig('peerius/general/getrecsasskusonly') == 1) {
|
144 |
+
return true;
|
145 |
+
}
|
146 |
+
return false;
|
147 |
+
}
|
148 |
+
|
149 |
}
|
app/code/community/Peerius/Smartrecs/Model/.DS_Store
DELETED
Binary file
|
app/code/community/Peerius/Smartrecs/Model/Feed/Creator.php
CHANGED
@@ -1,505 +1,600 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* @category Peerius
|
5 |
-
* @package Peerius_Smartrecs
|
6 |
-
* @author Peerius Ltd
|
7 |
-
*/
|
8 |
-
class Peerius_Smartrecs_Model_Feed_Creator {
|
9 |
-
|
10 |
-
protected $fileName;
|
11 |
-
protected $secretKey;
|
12 |
-
protected $clientName;
|
13 |
-
protected $token;
|
14 |
-
|
15 |
-
/**
|
16 |
-
* method to create the feed
|
17 |
-
* */
|
18 |
-
public function process(Mage_Core_Model_Website $website) {
|
19 |
-
|
20 |
-
|
21 |
-
$clientName = Mage::getStoreConfig('peerius/general/client_name');
|
22 |
-
$this->secretKey = Mage::getStoreConfig('peerius/general/secret_key');
|
23 |
-
$this->clientName = Mage::getStoreConfig('peerius/general/client_name');
|
24 |
-
$this->token = Mage::getStoreConfig('peerius/general/token');
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
* @
|
39 |
-
|
40 |
-
|
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 |
-
//
|
66 |
-
//
|
67 |
-
//
|
68 |
-
//
|
69 |
-
//
|
70 |
-
// $
|
71 |
-
//
|
72 |
-
//
|
73 |
-
//
|
74 |
-
//
|
75 |
-
//
|
76 |
-
//
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
*
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
$
|
88 |
-
$rss = '
|
89 |
-
$rss .= '
|
90 |
-
$rss .= '<
|
91 |
-
$rss .= '<
|
92 |
-
$rss .= '<
|
93 |
-
$rss
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
$rss
|
104 |
-
$rss
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
*
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
*
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
$
|
127 |
-
$
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
->
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
//
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
//
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
if
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
$
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
}
|
240 |
-
|
241 |
-
|
242 |
-
$
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
$
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
$
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
$
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
$
|
479 |
-
|
480 |
-
return
|
481 |
-
}
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
505 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @category Peerius
|
5 |
+
* @package Peerius_Smartrecs
|
6 |
+
* @author Peerius Ltd
|
7 |
+
*/
|
8 |
+
class Peerius_Smartrecs_Model_Feed_Creator {
|
9 |
+
|
10 |
+
protected $fileName;
|
11 |
+
protected $secretKey;
|
12 |
+
protected $clientName;
|
13 |
+
protected $token;
|
14 |
+
|
15 |
+
/**
|
16 |
+
* method to create the feed
|
17 |
+
* */
|
18 |
+
public function process(Mage_Core_Model_Website $website) {
|
19 |
+
//$this->fileName = Mage::getBaseDir('tmp') . DS . str_replace(' ', '_', $website->getName()) . "_PeeriusFeed" . ".xml";
|
20 |
+
|
21 |
+
$clientName = Mage::getStoreConfig('peerius/general/client_name');
|
22 |
+
$this->secretKey = Mage::getStoreConfig('peerius/general/secret_key');
|
23 |
+
$this->clientName = Mage::getStoreConfig('peerius/general/client_name');
|
24 |
+
$this->token = Mage::getStoreConfig('peerius/general/token');
|
25 |
+
$this->fileName = $clientName . "_PeeriusFeed" . ".xml";
|
26 |
+
|
27 |
+
if ($this->_createFile()) {
|
28 |
+
if (!$this->_writeFeed($website)) {
|
29 |
+
return false;
|
30 |
+
}
|
31 |
+
} else {
|
32 |
+
return false;
|
33 |
+
}
|
34 |
+
return true;
|
35 |
+
}
|
36 |
+
|
37 |
+
/**
|
38 |
+
* @param Mage_Core_Model_Website $website
|
39 |
+
* @return bool
|
40 |
+
*/
|
41 |
+
protected function _writeFeed(Mage_Core_Model_Website $website) {
|
42 |
+
try {
|
43 |
+
$f = new Varien_Io_File();
|
44 |
+
$f->write($this->fileName, $this->_getHeader($website) . $this->_getProducts($website) . $this->_getFooter());
|
45 |
+
$f->close();
|
46 |
+
return true;
|
47 |
+
} catch (Exception $ex) {
|
48 |
+
$this->log("error writing the feed");
|
49 |
+
$this->log($ex->getMessage());
|
50 |
+
return false;
|
51 |
+
}
|
52 |
+
}
|
53 |
+
|
54 |
+
/**
|
55 |
+
* @param $file
|
56 |
+
* @return bool
|
57 |
+
*/
|
58 |
+
protected function _createFile() {
|
59 |
+
return true;
|
60 |
+
// try {
|
61 |
+
// $f = new Varien_Io_File();
|
62 |
+
// $validator = new Zend_Validate_File_Exists();
|
63 |
+
//
|
64 |
+
// if (!$validator->isValid($this->fileName)) {
|
65 |
+
// $this->log("could not create the smartrec file");
|
66 |
+
// return false;
|
67 |
+
// }
|
68 |
+
// $this->log("SMART-recs file created");
|
69 |
+
//
|
70 |
+
// fclose($f);
|
71 |
+
// return true;
|
72 |
+
// } catch (Exception $ex) {
|
73 |
+
// $this->log("error during file creation");
|
74 |
+
// $this->log($ex->getMessage());
|
75 |
+
// return false;
|
76 |
+
// }
|
77 |
+
}
|
78 |
+
|
79 |
+
/**
|
80 |
+
* generate the rss file header
|
81 |
+
* @param Mage_Core_Model_Website $website
|
82 |
+
* @return string
|
83 |
+
*/
|
84 |
+
protected function _getHeader(Mage_Core_Model_Website $website) {
|
85 |
+
$clientName = $this->_getClientName();
|
86 |
+
$rss = '';
|
87 |
+
$rss .= '<?xml version="1.0" encoding="UTF-8"?>';
|
88 |
+
$rss .= '<rss version="2.0" xmlns:p="http://www.peerius.com/feeds/PeeriusRSS20.xsd">';
|
89 |
+
$rss .= '<channel>';
|
90 |
+
$rss .= '<title><![CDATA[Rss 2.0 ' . $clientName . ' product catalogue feed]]></title>';
|
91 |
+
$rss .= '<link>' . Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB) . '</link>';
|
92 |
+
$rss .= '<description><![CDATA[The latest product catalogue feed of ' . $clientName . '.]]></description>';
|
93 |
+
return $rss;
|
94 |
+
}
|
95 |
+
|
96 |
+
/**
|
97 |
+
* generate the rss file footer
|
98 |
+
* @return string
|
99 |
+
*/
|
100 |
+
protected function _getFooter() {
|
101 |
+
$rss = '';
|
102 |
+
$rss .= '</channel>';
|
103 |
+
$rss .= '</rss>';
|
104 |
+
return $rss;
|
105 |
+
}
|
106 |
+
|
107 |
+
/**
|
108 |
+
* sets the layout
|
109 |
+
* @param string $packageName
|
110 |
+
* @param string $themeName
|
111 |
+
*/
|
112 |
+
protected function _changeTheme($packageName, $themeName) {
|
113 |
+
Mage::getDesign()->setArea('frontend')
|
114 |
+
->setPackageName($packageName)
|
115 |
+
->setTheme($themeName);
|
116 |
+
}
|
117 |
+
|
118 |
+
/**
|
119 |
+
* write the products
|
120 |
+
* @param Mage_Core_Model_Website $website
|
121 |
+
* @return string
|
122 |
+
*/
|
123 |
+
protected function _getProducts(Mage_Core_Model_Website $website) {
|
124 |
+
$profilingStart = microtime(true);
|
125 |
+
$adapter = Mage::getSingleton("core/resource");
|
126 |
+
$visiblityCondition = array('in' => array(2, 3, 4));
|
127 |
+
$_catalogInventoryTable = method_exists($adapter, 'getTableName') ? $adapter->getTableName('cataloginventory_stock_item') : 'catalog_category_product_index';
|
128 |
+
|
129 |
+
//###################### DEBUG CODE :MG #####################
|
130 |
+
$debugMode = Mage::app()->getRequest()->getParam('debug') == 1 ? true : false;
|
131 |
+
$debugProducts = Mage::app()->getRequest()->getParam('items') ? Mage::app()->getRequest()->getParam('items') : 10;
|
132 |
+
$this->log('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');
|
133 |
+
$this->log('DEBUG MODE : '.($debugMode == true ? 'enabled. Creating feed for '. $debugProducts. ' products.' :'disabled'));
|
134 |
+
|
135 |
+
// Read Attributes to exclude from query string of feed url - Quick hack as some attribute names may cause issues.
|
136 |
+
$attribsToExclude = Mage::app()->getRequest()->getParam('attribsToExclude') ? Mage::app()->getRequest()->getParam('attribsToExclude') : "" ;
|
137 |
+
if($attribsToExclude && $attribsToExclude!="") $this->log('Attributes to exclude: '.$attribsToExclude, null, 'peerius_smartrec.log');
|
138 |
+
//###################### DEBUG CODE :MG #####################
|
139 |
+
|
140 |
+
$this->log('Feed creation STARTED');
|
141 |
+
$this->_changeTheme(Mage::getStoreConfig('design/package/name', $website->getDefaultStore()->getCode()), Mage::getStoreConfig('design/package/theme', $website->getDefaultStore()->getCode()));
|
142 |
+
|
143 |
+
$rss = '';
|
144 |
+
|
145 |
+
$productCollection = Mage::getModel('catalog/product')
|
146 |
+
->getCollection()
|
147 |
+
->addWebsiteFilter($website->getWebsiteId())
|
148 |
+
->joinField("qty", $_catalogInventoryTable, 'qty', 'product_id=entity_id', null, 'left')
|
149 |
+
->addAttributeToSelect('*')
|
150 |
+
->addCategoryIds()
|
151 |
+
//->addAttributeToFilter('type_id', array('eq' => 'configurable'))
|
152 |
+
->addAttributeToFilter('visibility', $visiblityCondition)
|
153 |
+
// ->joinTable('catalog/product_relation', 'child_id=entity_id', array('parent_id' => 'parent_id'), null, 'left')
|
154 |
+
->addPriceData(Mage_Customer_Model_Group::NOT_LOGGED_IN_ID, $website->getWebsiteId());
|
155 |
+
// ->load();
|
156 |
+
|
157 |
+
$productsCount = $productCollection->getSize();
|
158 |
+
$this->log('Total products found : ' . $productsCount);
|
159 |
+
|
160 |
+
$ctr = 0;
|
161 |
+
$perc = 0;
|
162 |
+
$ind = 1;
|
163 |
+
|
164 |
+
// check if site has prices in multiple currencies - if so, store the currency conversion rates.
|
165 |
+
$baseCode = Mage::app()->getBaseCurrencyCode();
|
166 |
+
$allowedCurrencies = Mage::getModel('directory/currency')->getConfigAllowCurrencies();
|
167 |
+
$rates = Mage::getModel('directory/currency')->getCurrencyRates($baseCode, array_values($allowedCurrencies));
|
168 |
+
$this->log('CURRENCY RATES : '.($rates ? http_build_query($rates) : 'NO RATES - SINGLE CURRENCY'), null, 'peerius_smartrec.log');
|
169 |
+
|
170 |
+
try {
|
171 |
+
|
172 |
+
foreach ($productCollection as $product) {
|
173 |
+
|
174 |
+
//###################### DEBUG CODE :MG #####################
|
175 |
+
if ($debugMode && $ctr > $debugProducts) break;
|
176 |
+
//###################### DEBUG CODE :MG #####################
|
177 |
+
|
178 |
+
$categoryIds = $product->getCategoryIds();
|
179 |
+
$parentCategoryBreadcrumbs = false;
|
180 |
+
$parent = false;
|
181 |
+
|
182 |
+
// don't export unavailable products
|
183 |
+
if (!$product->isAvailable()) {
|
184 |
+
$productsCount--;
|
185 |
+
continue;
|
186 |
+
}
|
187 |
+
|
188 |
+
// if a product is not in a category skip it also
|
189 |
+
if ($product->getTypeId() == Mage_Catalog_Model_Product_Type::TYPE_SIMPLE) {
|
190 |
+
$parent = $this->_getParent($product);
|
191 |
+
if ($parent) {
|
192 |
+
$parentCategoryBreadcrumbs = $this->_getParentCategoryBreadcrumbs($product);
|
193 |
+
$categoryBreadcrumbs = $parentCategoryBreadcrumbs;
|
194 |
+
} else {
|
195 |
+
$categoryBreadcrumbs = $this->_getCategoryBreadcrumbs($product->getCategoryIds());
|
196 |
+
}
|
197 |
+
}
|
198 |
+
|
199 |
+
// is the product or it's product in any category? If not, skip it
|
200 |
+
if (!$categoryIds AND !$parentCategoryBreadcrumbs) {
|
201 |
+
$productsCount--;
|
202 |
+
continue;
|
203 |
+
}
|
204 |
+
|
205 |
+
$rss .= '<item>';
|
206 |
+
$rss .= '<title><![CDATA[' . $product->getName() . ']]></title>';
|
207 |
+
$rss .= '<link>' . $product->getProductUrl() . '</link>';
|
208 |
+
$rss .= '<guid><![CDATA[' . $product->getSku() . ']]></guid>';
|
209 |
+
if ($product->getThumbnail())
|
210 |
+
$rss .= '<p:imageLink>' . Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) . 'catalog/product' . $product->getThumbnail() . '</p:imageLink>';
|
211 |
+
|
212 |
+
// if site has prices in multiple currencies
|
213 |
+
if($rates) {
|
214 |
+
foreach ($rates as $cur => $rate) {
|
215 |
+
$unitPrice = number_format($product->getPrice(), 2, '.', '') * $rate;
|
216 |
+
$salePrice = number_format($product->getFinalPrice(), 2, '.', '') * $rate;
|
217 |
+
$rss .= '<p:price><p:unitPrice>' . number_format($unitPrice, 2, '.', '') . '</p:unitPrice>
|
218 |
+
<p:salePrice>' . number_format($salePrice, 2, '.', '') . '</p:salePrice>
|
219 |
+
<p:currency>' . $cur . '</p:currency></p:price>';
|
220 |
+
}
|
221 |
+
}else{ // single currency site
|
222 |
+
$rss .= '<p:price><p:unitPrice>' . number_format($product->getPrice(), 2, '.', '') . '</p:unitPrice>
|
223 |
+
<p:salePrice>' . number_format($product->getFinalPrice(), 2, '.', '') . '</p:salePrice>
|
224 |
+
<p:currency>' . Mage::app()->getStore($website->getDefaultStore())->getCurrentCurrencyCode() . '</p:currency></p:price>';
|
225 |
+
}
|
226 |
+
|
227 |
+
if ($product->getTypeId() == Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE) {
|
228 |
+
$rss .= $this->_getCategoryBreadcrumbs($categoryIds);
|
229 |
+
$rss .= '<p:attribute name="minimal_price">' . number_format($product->getMinimalPrice(), 2, '.', '') . '</p:attribute>';
|
230 |
+
|
231 |
+
$attrArr = Mage::getModel('catalog/product_type_configurable')->getConfigurableAttributesAsArray($product);
|
232 |
+
|
233 |
+
$childProducts = Mage::getModel('catalog/product_type_configurable')->getUsedProductCollection($product)
|
234 |
+
->addAttributeToSelect('thumbnail')
|
235 |
+
->addAttributeToSelect('name')
|
236 |
+
->joinAttribute('visibility', 'catalog_product/visibility', 'entity_id', null, 'inner', 1);
|
237 |
+
foreach ($attrArr as $attr) {
|
238 |
+
$childProducts->addAttributeToSelect($attr['attribute_code']);
|
239 |
+
}
|
240 |
+
|
241 |
+
foreach ($childProducts as $childProduct) {
|
242 |
+
if ($childProduct->getData('visibility') == Mage_Catalog_Model_Product_Visibility::VISIBILITY_NOT_VISIBLE) {
|
243 |
+
//$p = Mage::getModel('catalog/product')->load($childProduct->getId());
|
244 |
+
$rss .= '<p:variant>';
|
245 |
+
//$rss .= '<p:title><![CDATA[' . $childProduct->getName() . ']]></p:title>';
|
246 |
+
foreach ($attrArr as $attr) {
|
247 |
+
$rss .= '<p:attribute name="' . $attr['attribute_code'] . '"><![CDATA[' . $childProduct->getAttributeText($attr['attribute_code']) . ']]></p:attribute>';
|
248 |
+
}
|
249 |
+
$rss .= '<p:attribute name="link">' . $childProduct->getProductUrl() . '</p:attribute>';
|
250 |
+
$rss .= '<p:attribute name="guid"><![CDATA[' . $childProduct->getSku() . ']]></p:attribute>';
|
251 |
+
$rss .= '<p:attribute name="magento_id">' . $childProduct->getId() . '</p:attribute>';
|
252 |
+
if ($product->getThumbnail())
|
253 |
+
$rss .= '<p:imageLink>' . Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) . 'catalog/product' . $childProduct->getThumbnail() . '</p:imageLink>';
|
254 |
+
$stockItem = $childProduct->getStockItem();
|
255 |
+
$stockQty = ($stockItem instanceof Mage_CatalogInventory_Model_Stock_Item) ?
|
256 |
+
((int) $stockItem->getQty() > 0 ? (int) $stockItem->getQty() : 0) : 0;
|
257 |
+
$rss .= '<p:stock>' . $stockQty . '</p:stock>';
|
258 |
+
$rss .= '</p:variant>';
|
259 |
+
}
|
260 |
+
}
|
261 |
+
} else {
|
262 |
+
if ($parent) {
|
263 |
+
$rss .= $parent;
|
264 |
+
$rss .= $categoryBreadcrumbs;
|
265 |
+
} else {
|
266 |
+
$rss .= $categoryBreadcrumbs;
|
267 |
+
}
|
268 |
+
}
|
269 |
+
|
270 |
+
$rss .= '<pubDate>' . $product->getcreated_at() . '</pubDate>';
|
271 |
+
$rss .= '<description><![CDATA[' . $product->getShortDescription() . ']]></description>';
|
272 |
+
|
273 |
+
if ($product->getAttribute('manufacturer') instanceof Mage_Eav_Model_Entity_Attribute_Abstract) {
|
274 |
+
$rss .= '<p:brand><![CDATA[' . $product->getAttributeText('manufacturer') . ']]></p:brand>';
|
275 |
+
}
|
276 |
+
$rss .= '<p:inStock>' . $this->_getStockStatus($product) . '</p:inStock>';
|
277 |
+
$rss .= '<p:stock>' . ((int) $product->getQty() > 0 ? (int) $product->getQty() : 0) . '</p:stock>';
|
278 |
+
$rss .= '<p:recommend>Y</p:recommend>';
|
279 |
+
$rss .= '<p:recommended><![CDATA[' . $this->_getRecommended($product) . ']]></p:recommended>';
|
280 |
+
$rss .= '<p:attribute name="magento_id">' . $product->getId() . '</p:attribute>';
|
281 |
+
$rss .= $this->_getAttributes($product,$attribsToExclude);
|
282 |
+
$rss .= $this->_getTags($product);
|
283 |
+
$rss .= '</item>';
|
284 |
+
|
285 |
+
$iperc = round($productsCount/10) ;
|
286 |
+
$perc = $perc == 0 ? $iperc : $perc;
|
287 |
+
if($ctr == $perc) {
|
288 |
+
$this->log('Processed ' . $ind++ * 10 . '% of the products...' . $ctr);
|
289 |
+
$perc = $iperc * $ind;
|
290 |
+
//Mage::throwException('Some Message');
|
291 |
+
}
|
292 |
+
$ctr++;
|
293 |
+
}
|
294 |
+
|
295 |
+
$this->log('Total entries created : ' . ($ctr - 1) );
|
296 |
+
} catch (Exception $e) {
|
297 |
+
//echo $this->getPrettyDebugBacktrace();
|
298 |
+
$this->log("### ERROR ### : " . $e->getMessage());
|
299 |
+
}
|
300 |
+
|
301 |
+
|
302 |
+
if ($productsCount == 0) {
|
303 |
+
$this->log("no products found");
|
304 |
+
throw new Exception("### ERROR ### : NO products found");
|
305 |
+
}
|
306 |
+
|
307 |
+
$now = microtime(true);
|
308 |
+
$this->log("Feed creation COMPLETED in " . date("H:i:s", ($now - $profilingStart)));
|
309 |
+
$this->log('Memory used : ' . round(memory_get_peak_usage() / 1048576) . 'MB');
|
310 |
+
$this->log('===================================================');
|
311 |
+
return $rss;
|
312 |
+
}
|
313 |
+
|
314 |
+
/**
|
315 |
+
* generate breadcrumb style categories
|
316 |
+
* @param array $currentCatIds
|
317 |
+
* @return string
|
318 |
+
*/
|
319 |
+
protected function _getCategoryBreadcrumbs($currentCatIds) {
|
320 |
+
$rss = '';
|
321 |
+
|
322 |
+
if ($currentCatIds) {
|
323 |
+
$categoryCollection = Mage::getResourceModel('catalog/category_collection')
|
324 |
+
->addAttributeToSelect('path')
|
325 |
+
->addAttributeToFilter('entity_id', $currentCatIds)
|
326 |
+
->addIsActiveFilter();
|
327 |
+
|
328 |
+
foreach ($categoryCollection as $cat) {
|
329 |
+
$p = explode('/', $cat->getPath());
|
330 |
+
|
331 |
+
$fullPath = array();
|
332 |
+
foreach ($p as $treeCat) {
|
333 |
+
// Root-Kategorie
|
334 |
+
if ($treeCat <= 2)
|
335 |
+
continue;
|
336 |
+
$category = Mage::getModel('catalog/category')
|
337 |
+
->setStoreId(Mage::app()->getStore()->getId())
|
338 |
+
->load($treeCat);
|
339 |
+
$fullPath[] = $category->getName();
|
340 |
+
}
|
341 |
+
$rss .= '<category><![CDATA[' . implode('>', $fullPath) . ']]></category>';
|
342 |
+
}
|
343 |
+
}
|
344 |
+
return $rss;
|
345 |
+
}
|
346 |
+
|
347 |
+
/**
|
348 |
+
* generate breadcrumb style categories
|
349 |
+
* @param product $product
|
350 |
+
* @return string
|
351 |
+
*/
|
352 |
+
protected function _getParentCategoryBreadcrumbs($product) {
|
353 |
+
$rss = '';
|
354 |
+
$parentIds = $this->_getParent($product, true);
|
355 |
+
$categoryIds = array();
|
356 |
+
|
357 |
+
foreach ($parentIds as $parentId) {
|
358 |
+
$product = Mage::getModel('catalog/product')->load($parentId);
|
359 |
+
$categoryIds = array_merge($categoryIds, $product->getCategoryIds());
|
360 |
+
}
|
361 |
+
|
362 |
+
$rss = $this->_getCategoryBreadcrumbs($categoryIds);
|
363 |
+
return $rss;
|
364 |
+
}
|
365 |
+
|
366 |
+
/**
|
367 |
+
* retreive the product stock statuss
|
368 |
+
* @param Mage_Core_Catalog_Product $product
|
369 |
+
* @return string
|
370 |
+
*/
|
371 |
+
protected function _getStockStatus($product) {
|
372 |
+
$stockStatus = Mage::getModel('cataloginventory/stock_item')
|
373 |
+
->getCollection()
|
374 |
+
->addFieldToFilter('product_id', $product->getId())
|
375 |
+
->getFirstItem();
|
376 |
+
|
377 |
+
return $stockStatus ? 'Y' : 'N';
|
378 |
+
}
|
379 |
+
|
380 |
+
/**
|
381 |
+
* write the products
|
382 |
+
* @param Mage_Core_Catalog_Product $product
|
383 |
+
* @return string
|
384 |
+
*/
|
385 |
+
protected function _getRecommended($product) {
|
386 |
+
$all = array();
|
387 |
+
$related = $product->getRelatedProductIds();
|
388 |
+
foreach ($related as $id) {
|
389 |
+
$all[$id] = Mage::getModel('catalog/product')->load($id)->getSku();
|
390 |
+
//$this->log("Related Product is :".$all[$id]);
|
391 |
+
}
|
392 |
+
|
393 |
+
$crosssell = $product->getCrossSellProducts();
|
394 |
+
foreach ($crosssell as $_item) {
|
395 |
+
$all[$_item->getId()] = $_item->getSku();
|
396 |
+
//$this->log("Cross Selling Product is :".$all[$_item->getId()]);
|
397 |
+
}
|
398 |
+
$upsell = $product->getUpSellProductCollection();
|
399 |
+
foreach ($upsell as $_item) {
|
400 |
+
$all[$_item->getId()] = $_item->getSku();
|
401 |
+
//$this->log("Up Selling Product is :".$all[$_item->getId()]);
|
402 |
+
}
|
403 |
+
return implode(',', $all);
|
404 |
+
}
|
405 |
+
|
406 |
+
/**
|
407 |
+
* generate comma-separated list of product tags
|
408 |
+
* @param Mage_Core_Catalog_Product $product
|
409 |
+
* @return string
|
410 |
+
*/
|
411 |
+
protected function _getTags($product) {
|
412 |
+
$tag_model = Mage::getModel('tag/tag');
|
413 |
+
$tag_collection = $tag_model->getResourceCollection()
|
414 |
+
->addPopularity()
|
415 |
+
// ->addStatusFilter($model->getApprovedStatus())
|
416 |
+
->addProductFilter($product->getId())
|
417 |
+
->setFlag('relation', true)
|
418 |
+
->addStoreFilter(Mage::app()->getStore()->getId())
|
419 |
+
->setActiveFilter()
|
420 |
+
->load();
|
421 |
+
|
422 |
+
$mytags = $tag_collection->getItems();
|
423 |
+
|
424 |
+
$tagArr = array();
|
425 |
+
if (!$tag_collection->getSize()) {
|
426 |
+
return '';
|
427 |
+
}
|
428 |
+
|
429 |
+
foreach ($mytags as $tag) {
|
430 |
+
$tagArr[] = $tag->getName();
|
431 |
+
}
|
432 |
+
return '<p:tags>' . implode(',', $tagArr) . '</p:tags>';
|
433 |
+
}
|
434 |
+
|
435 |
+
/**
|
436 |
+
* crate front-end attributes rss string
|
437 |
+
* @param Mage_Core_Catalog_Product $product
|
438 |
+
* @return string
|
439 |
+
*/
|
440 |
+
protected function _getAttributes($product, $attribsToExclude) {
|
441 |
+
$attributes = $product->getAttributes();
|
442 |
+
$rss = '';
|
443 |
+
$attribsToExcludeArray = explode('|',$attribsToExclude);
|
444 |
+
foreach ($attributes as $attribute) {
|
445 |
+
if ($attribute->getIsVisibleOnFront()) {
|
446 |
+
$attributeCode = $attribute->getAttributeCode();
|
447 |
+
if (in_array($attributeCode,$attribsToExcludeArray))
|
448 |
+
continue;
|
449 |
+
else
|
450 |
+
{
|
451 |
+
$label = $attribute->getFrontend()->getLabel($product);
|
452 |
+
$value = $attribute->getFrontend()->getValue($product);
|
453 |
+
$rss .= '<p:attribute name="' . $attributeCode . '"><![CDATA[' . $value . ']]></p:attribute>';
|
454 |
+
}
|
455 |
+
}
|
456 |
+
}
|
457 |
+
return $rss;
|
458 |
+
}
|
459 |
+
|
460 |
+
/**
|
461 |
+
* returns parent product ID if available
|
462 |
+
* @param Mage_Core_Catalog_Product $product
|
463 |
+
* @param bool return the ids
|
464 |
+
* @return int
|
465 |
+
*/
|
466 |
+
protected function _getParent($product, $ids = false) {
|
467 |
+
$rss = '';
|
468 |
+
$parentIds = false;
|
469 |
+
if ($product->getTypeId() == "simple") {
|
470 |
+
$parentIds = Mage::getModel('catalog/product_type_grouped')->getParentIdsByChild($product->getId()); // check for grouped product
|
471 |
+
if (!$parentIds)
|
472 |
+
$parentIds = Mage::getModel('catalog/product_type_configurable')->getParentIdsByChild($product->getId()); //check for config product
|
473 |
+
}
|
474 |
+
if ($ids) {
|
475 |
+
return $parentIds;
|
476 |
+
}
|
477 |
+
if ($parentIds) {
|
478 |
+
$rss = '<p:attribute name="parent_magento_id">' . implode(',', $parentIds) . '</p:attribute>';
|
479 |
+
} else {
|
480 |
+
return false;
|
481 |
+
}
|
482 |
+
return $rss;
|
483 |
+
}
|
484 |
+
|
485 |
+
/**
|
486 |
+
* the client name used in the rss feed
|
487 |
+
* @return string
|
488 |
+
*/
|
489 |
+
protected function _getClientName() {
|
490 |
+
return Mage::getStoreConfig('peerius/general/client_name');
|
491 |
+
}
|
492 |
+
|
493 |
+
/**
|
494 |
+
* @param $content
|
495 |
+
* @return bool
|
496 |
+
*/
|
497 |
+
protected function _appendToFile($content) {
|
498 |
+
try {
|
499 |
+
$f = new Varien_Io_File();
|
500 |
+
$validator = new Zend_Validate_File_Exists();
|
501 |
+
|
502 |
+
if (!$validator->isValid($this->fileName)) {
|
503 |
+
$this->log("could not create the smartrec file");
|
504 |
+
return false;
|
505 |
+
}
|
506 |
+
$this->log("SMART-recs file created");
|
507 |
+
|
508 |
+
fclose($f);
|
509 |
+
return true;
|
510 |
+
} catch (Exception $ex) {
|
511 |
+
$this->log("error during file creation");
|
512 |
+
$this->log($ex->getMessage());
|
513 |
+
return false;
|
514 |
+
}
|
515 |
+
try {
|
516 |
+
$f = new Varien_Io_File();
|
517 |
+
$f->write($this->fileName, $content);
|
518 |
+
//if (file_put_contents($this->fileName, $content, FILE_APPEND)) {
|
519 |
+
return true;
|
520 |
+
} catch (Exception $ex) {
|
521 |
+
$this->log("error while writing to the feed file");
|
522 |
+
$this->log($ex->getMessage());
|
523 |
+
return false;
|
524 |
+
}
|
525 |
+
}
|
526 |
+
|
527 |
+
public function checkToken() {
|
528 |
+
$token = Mage::getStoreConfig('peerius/general/token');
|
529 |
+
|
530 |
+
if (!$token OR !Mage::app()->getRequest()->getParam('token') OR (Mage::app()->getRequest()->getParam('token') != sha1($token))) {
|
531 |
+
$this->log("token error");
|
532 |
+
return false;
|
533 |
+
}
|
534 |
+
return true;
|
535 |
+
}
|
536 |
+
|
537 |
+
/**
|
538 |
+
* @param string $message
|
539 |
+
*/
|
540 |
+
protected function log($message) {
|
541 |
+
Mage::helper('peerius_smartrecs')->log(Zend_Log::DEBUG, $message);
|
542 |
+
}
|
543 |
+
|
544 |
+
protected function getPrettyDebugBacktrace()
|
545 |
+
{
|
546 |
+
$d = debug_backtrace();
|
547 |
+
array_shift($d);
|
548 |
+
$siteName = Mage::getStoreConfig('peerius/general/client_name',Mage::app()->getStore());
|
549 |
+
$response = '';
|
550 |
+
$response .= '<!doctype html><html lang=\'en-gb\'><head><meta charset=\'utf-8\'><title> CONFIG: '.$siteName.'</title>'.$this->getCSS().'</head><body style="font-family:Arial;">';
|
551 |
+
$response .= '<section><h1>Peerius Connect Debug : '. $siteName . '</h1>';
|
552 |
+
$c1width = strlen(count($d) + 1);
|
553 |
+
$c2width = 0;
|
554 |
+
foreach ($d as &$f) {
|
555 |
+
if (!isset($f['file'])) $f['file'] = '';
|
556 |
+
if (!isset($f['line'])) $f['line'] = '';
|
557 |
+
if (!isset($f['class'])) $f['class'] = '';
|
558 |
+
if (!isset($f['type'])) $f['type'] = '';
|
559 |
+
$f['file_rel'] = str_replace(BP . DS, '', $f['file']);
|
560 |
+
$thisLen = strlen($f['file_rel'] . ':' . $f['line']);
|
561 |
+
if ($c2width < $thisLen) $c2width = $thisLen;
|
562 |
+
}
|
563 |
+
foreach ($d as $i => $f) {
|
564 |
+
$args = '';
|
565 |
+
if (isset($f['args'])) {
|
566 |
+
$args = array();
|
567 |
+
foreach ($f['args'] as $arg) {
|
568 |
+
if (is_object($arg)) {
|
569 |
+
$str = get_class($arg);
|
570 |
+
} elseif (is_array($arg)) {
|
571 |
+
$str = 'Array';
|
572 |
+
} elseif (is_numeric($arg)) {
|
573 |
+
$str = $arg;
|
574 |
+
} else {
|
575 |
+
$str = "'$arg'";
|
576 |
+
}
|
577 |
+
$args[] = $str;
|
578 |
+
}
|
579 |
+
$args = implode(', ', $args);
|
580 |
+
}
|
581 |
+
$response .= "<div class='boxA'>".$i."</div><div class='boxB'>".$f['file_rel']." : <span class='lnText'>".$f['line'] . "</span></div><div class='boxC'> ". $f['class'].$f['type'].$f['function']." </div><div class='boxB'> ".$args."</div>";
|
582 |
+
|
583 |
+
}
|
584 |
+
$response .= '</section></body></html>';
|
585 |
+
return $response;
|
586 |
+
}
|
587 |
+
|
588 |
+
/**
|
589 |
+
* return CSS
|
590 |
+
*/
|
591 |
+
protected function getCSS() {
|
592 |
+
return "<style type='text/css'>
|
593 |
+
.secTitle {clear:both;display:block;float:left;padding:5px;margin:10px 2px 5px 0;width:100%;color:#808080;font-weight:bold; font-size:20px;}
|
594 |
+
.boxA { clear:left;display:block;float:left;padding:2px 2px 0 4px;margin:1px;background-color: #60b346 ; width:20px; height:22px; }
|
595 |
+
.boxB { float:left;display:in-line;padding:2px 2px 0 4px;margin:1px;background-color: #A9Ae99; width:60%px; height:22px;color:#000; }
|
596 |
+
.boxC { float:left;display:in-line;padding:2px 0 0 4px;margin:1px;background-color: #A0b3A6; width:30%px; height:22px;color:#000; }
|
597 |
+
.lnText { background-color: #A9Ae99; font-weight:bold; color:#FF0; }
|
598 |
+
</style>";
|
599 |
+
}
|
600 |
}
|
app/code/community/Peerius/Smartrecs/Model/SearchLayer.php
CHANGED
@@ -1,25 +1,37 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* @category Peerius
|
5 |
-
* @package Peerius_Smartrecs
|
6 |
-
* @author Peerius Ltd
|
7 |
-
*/
|
8 |
-
class Peerius_Smartrecs_Model_SearchLayer extends Mage_CatalogSearch_Model_Layer {
|
9 |
-
|
10 |
-
/**
|
11 |
-
* get the found product for the tracking
|
12 |
-
* @return $this
|
13 |
-
*/
|
14 |
-
public function prepareProductCollection($collection) {
|
15 |
-
parent::prepareProductCollection($collection);
|
16 |
-
$sku = array();
|
17 |
-
$coll = clone $collection;
|
18 |
-
|
19 |
-
|
20 |
-
$
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @category Peerius
|
5 |
+
* @package Peerius_Smartrecs
|
6 |
+
* @author Peerius Ltd
|
7 |
+
*/
|
8 |
+
class Peerius_Smartrecs_Model_SearchLayer extends Mage_CatalogSearch_Model_Layer {
|
9 |
+
|
10 |
+
/**
|
11 |
+
* get the found product for the tracking
|
12 |
+
* @return $this
|
13 |
+
*/
|
14 |
+
public function prepareProductCollection($collection) {
|
15 |
+
parent::prepareProductCollection($collection);
|
16 |
+
$sku = array();
|
17 |
+
$coll = clone $collection;
|
18 |
+
$cnt = 1;
|
19 |
+
foreach ($coll as $item) {
|
20 |
+
$data = $item->getData();
|
21 |
+
$sku[] = array('refCode' => $data['sku']);
|
22 |
+
if($cnt++==1) break;
|
23 |
+
}
|
24 |
+
Mage::unregister('peerius_smartrecs_searchresults');
|
25 |
+
if(Mage::registry('peerius_smartrecs_searchresults') == null) Mage::register('peerius_smartrecs_searchresults', $sku);
|
26 |
+
//Mage::log('==========================SEARCH DEBUG=========================', null, 'peerius_smartrec.log');
|
27 |
+
//Mage::log(print_r(Mage::registry('peerius_smartrecs_searchresults'), 1), null, 'peerius_smartrec.log');
|
28 |
+
//Mage::log('==========================SEARCH DEBUG END=========================', null, 'peerius_smartrec.log');
|
29 |
+
//$c = Mage::registry('peerius_smartrecs_searchresults');
|
30 |
+
//foreach ($c as $itm => $value) {
|
31 |
+
// foreach ($value as $vi => $vv) {
|
32 |
+
// Mage::log('peerius_smartrecs_searchresults registry value is '.$vi.'::'.$vv);
|
33 |
+
// }
|
34 |
+
//}
|
35 |
+
return $this;
|
36 |
+
}
|
37 |
}
|
app/code/community/Peerius/Smartrecs/controllers/FeedController.php
CHANGED
@@ -1,145 +1,144 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* create the product feed
|
5 |
-
* @category Peerius
|
6 |
-
* @package Peerius_Smartrecs
|
7 |
-
* @author Peerius Ltd
|
8 |
-
*/
|
9 |
-
class Peerius_Smartrecs_FeedController extends Mage_Core_Controller_Front_Action {
|
10 |
-
|
11 |
-
/**
|
12 |
-
* Smartrecs helper
|
13 |
-
* @return Peerius_Smartrecs_Helper_Confighelper
|
14 |
-
*/
|
15 |
-
protected function _helper() {
|
16 |
-
return Mage::helper("peerius_smartrecs/feedhelper");
|
17 |
-
}
|
18 |
-
|
19 |
-
/**
|
20 |
-
* create the product feed
|
21 |
-
* @return null
|
22 |
-
*/
|
23 |
-
public function createAction() {
|
24 |
-
if (Mage::app()->getRequest()->getParam('version') AND Mage::app()->getRequest()->getParam('version') == 3) {
|
25 |
-
$creator = Mage::getSingleton('peerius_smartrecs/feed_creatorsql');
|
26 |
-
} else {
|
27 |
-
$creator = Mage::getSingleton('peerius_smartrecs/feed_creator');
|
28 |
-
}
|
29 |
-
|
30 |
-
if ($creator->checkToken()) {
|
31 |
-
$website = $this->_checkSite();
|
32 |
-
if (is_null($website)) {
|
33 |
-
$website = Mage::app()->getWebsite(1);
|
34 |
-
}
|
35 |
-
set_time_limit(0);
|
36 |
-
ignore_user_abort(true);
|
37 |
-
if ($this->getRequest()->getParam('debug')==1) {
|
38 |
-
error_reporting(E_ALL);
|
39 |
-
ini_set('display_errors','on');
|
40 |
-
}
|
41 |
-
|
42 |
-
$creator->process($website);
|
43 |
-
}
|
44 |
-
}
|
45 |
-
|
46 |
-
/**
|
47 |
-
* return the product feed
|
48 |
-
* @return null
|
49 |
-
*/
|
50 |
-
public function showAction() {
|
51 |
-
if (Mage::app()->getRequest()->getParam('version') AND Mage::app()->getRequest()->getParam('version') == 3) {
|
52 |
-
$creator = Mage::getSingleton('peerius_smartrecs/feed_creatorsql');
|
53 |
-
} else {
|
54 |
-
$creator = Mage::getSingleton('peerius_smartrecs/feed_creator');
|
55 |
-
}
|
56 |
-
|
57 |
-
if ($creator->checkToken()) {
|
58 |
-
$website = $this->_checkSite();
|
59 |
-
if (is_null($website)) {
|
60 |
-
$website = Mage::app()->getWebsite(1);
|
61 |
-
}
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
$this->getResponse()->setHeader('
|
67 |
-
$this->getResponse()->setHeader('
|
68 |
-
|
69 |
-
|
70 |
-
$
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
*
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
$this->fileName =
|
102 |
-
|
103 |
-
|
104 |
-
$this->getResponse()->setHeader('
|
105 |
-
$this->getResponse()->setHeader('
|
106 |
-
|
107 |
-
|
108 |
-
$file
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
* @
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
->
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
*
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
$creator
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* create the product feed
|
5 |
+
* @category Peerius
|
6 |
+
* @package Peerius_Smartrecs
|
7 |
+
* @author Peerius Ltd
|
8 |
+
*/
|
9 |
+
class Peerius_Smartrecs_FeedController extends Mage_Core_Controller_Front_Action {
|
10 |
+
|
11 |
+
/**
|
12 |
+
* Smartrecs helper
|
13 |
+
* @return Peerius_Smartrecs_Helper_Confighelper
|
14 |
+
*/
|
15 |
+
protected function _helper() {
|
16 |
+
return Mage::helper("peerius_smartrecs/feedhelper");
|
17 |
+
}
|
18 |
+
|
19 |
+
/**
|
20 |
+
* create the product feed
|
21 |
+
* @return null
|
22 |
+
*/
|
23 |
+
public function createAction() {
|
24 |
+
if (Mage::app()->getRequest()->getParam('version') AND Mage::app()->getRequest()->getParam('version') == 3) {
|
25 |
+
$creator = Mage::getSingleton('peerius_smartrecs/feed_creatorsql');
|
26 |
+
} else {
|
27 |
+
$creator = Mage::getSingleton('peerius_smartrecs/feed_creator');
|
28 |
+
}
|
29 |
+
|
30 |
+
if ($creator->checkToken()) {
|
31 |
+
$website = $this->_checkSite();
|
32 |
+
if (is_null($website)) {
|
33 |
+
$website = Mage::app()->getWebsite(1);
|
34 |
+
}
|
35 |
+
set_time_limit(0);
|
36 |
+
ignore_user_abort(true);
|
37 |
+
if ($this->getRequest()->getParam('debug')==1) {
|
38 |
+
error_reporting(E_ALL);
|
39 |
+
ini_set('display_errors','on');
|
40 |
+
}
|
41 |
+
|
42 |
+
$creator->process($website);
|
43 |
+
}
|
44 |
+
}
|
45 |
+
|
46 |
+
/**
|
47 |
+
* return the product feed
|
48 |
+
* @return null
|
49 |
+
*/
|
50 |
+
public function showAction() {
|
51 |
+
if (Mage::app()->getRequest()->getParam('version') AND Mage::app()->getRequest()->getParam('version') == 3) {
|
52 |
+
$creator = Mage::getSingleton('peerius_smartrecs/feed_creatorsql');
|
53 |
+
} else {
|
54 |
+
$creator = Mage::getSingleton('peerius_smartrecs/feed_creator');
|
55 |
+
}
|
56 |
+
|
57 |
+
if ($creator->checkToken()) {
|
58 |
+
$website = $this->_checkSite();
|
59 |
+
if (is_null($website)) {
|
60 |
+
$website = Mage::app()->getWebsite(1);
|
61 |
+
}
|
62 |
+
//$this->fileName = Mage::getBaseDir('tmp') . DS . str_replace(' ', '_', $website->getName()) . "_PeeriusFeed" . ".xml";
|
63 |
+
$clientName = Mage::getStoreConfig('peerius/general/client_name');
|
64 |
+
$this->fileName = $clientName . "_PeeriusFeed" . ".xml";
|
65 |
+
|
66 |
+
$this->getResponse()->setHeader('Cache-Control', 'no-cache, must-revalidate');
|
67 |
+
$this->getResponse()->setHeader('Expires', 'Mon, 26 Jul 1997 05:00:00 GMT');
|
68 |
+
$this->getResponse()->setHeader('Content-Type', 'application/rss+xml; charset=UTF-8');
|
69 |
+
|
70 |
+
$file = new Varien_Io_File();
|
71 |
+
$this->_prepareDownloadResponse($this->fileName, $file->read($this->fileName), 'application/rss+xml');
|
72 |
+
}
|
73 |
+
}
|
74 |
+
|
75 |
+
/**
|
76 |
+
* create and show the product feed
|
77 |
+
* @return null
|
78 |
+
*/
|
79 |
+
public function createAndShowAction() {
|
80 |
+
$website = $this->_checkSite();
|
81 |
+
if (is_null($website)) {
|
82 |
+
$website = Mage::app()->getWebsite(1);
|
83 |
+
}
|
84 |
+
set_time_limit(0);
|
85 |
+
ignore_user_abort(true);
|
86 |
+
if ($this->getRequest()->getParam('debug')==1) {
|
87 |
+
error_log(E_ALL);
|
88 |
+
ini_set('display_errors','on');
|
89 |
+
}
|
90 |
+
if (Mage::app()->getRequest()->getParam('version') AND Mage::app()->getRequest()->getParam('version') == 3) {
|
91 |
+
$creator = Mage::getSingleton('peerius_smartrecs/feed_creatorsql');
|
92 |
+
} else {
|
93 |
+
$creator = Mage::getSingleton('peerius_smartrecs/feed_creator');
|
94 |
+
}
|
95 |
+
|
96 |
+
if ($creator->checkToken()) {
|
97 |
+
$creator->process($website);
|
98 |
+
|
99 |
+
//$this->fileName = Mage::getBaseDir('tmp') . DS . str_replace(' ', '_', $website->getName()) . "_PeeriusFeed" . ".xml";
|
100 |
+
$clientName = Mage::getStoreConfig('peerius/general/client_name');
|
101 |
+
$this->fileName = $clientName . "_PeeriusFeed" . ".xml";
|
102 |
+
|
103 |
+
$this->getResponse()->setHeader('Cache-Control', 'no-cache, must-revalidate');
|
104 |
+
$this->getResponse()->setHeader('Expires', 'Mon, 26 Jul 1997 05:00:00 GMT');
|
105 |
+
$this->getResponse()->setHeader('Content-Type', 'application/rss+xml; charset=UTF-8');
|
106 |
+
|
107 |
+
$file = new Varien_Io_File();
|
108 |
+
$this->_prepareDownloadResponse($this->fileName, $file->read($this->fileName), 'application/rss+xml');
|
109 |
+
}
|
110 |
+
}
|
111 |
+
|
112 |
+
/**
|
113 |
+
* @param $websiteName
|
114 |
+
* @return mixed
|
115 |
+
*/
|
116 |
+
protected function _getWebsiteByName($websiteName) {
|
117 |
+
return Mage::getResourceModel('core/website_collection')
|
118 |
+
->addFieldToFilter('name', $websiteName)
|
119 |
+
->getFirstItem();
|
120 |
+
}
|
121 |
+
|
122 |
+
/**
|
123 |
+
* the website to create the feed for, e.g. Main Website
|
124 |
+
* @return Mage_Core_Model_Website
|
125 |
+
*/
|
126 |
+
protected function _checkSite() {
|
127 |
+
if ($this->getRequest()->getParam('site')) {
|
128 |
+
$website = $this->_getWebsiteByName($this->getRequest()->getParam('site'));
|
129 |
+
}
|
130 |
+
|
131 |
+
if (!isset($website) || !$website->hasData("website_id")) {
|
132 |
+
return null;
|
133 |
+
}
|
134 |
+
return $website;
|
135 |
+
}
|
136 |
+
|
137 |
+
public function unlockAction() {
|
138 |
+
$creator = Mage::getSingleton('peerius_smartrecs/feed_creator');
|
139 |
+
if ($creator->checkToken()) {
|
140 |
+
Mage::getModel('core/config')->saveConfig('peerius/general/creatingfeed', 0);
|
141 |
+
}
|
142 |
+
}
|
143 |
+
|
144 |
+
}
|
|
app/code/community/Peerius/Smartrecs/controllers/InfoController.php
CHANGED
@@ -1,193 +1,348 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* syncing the products to the peerius server
|
5 |
-
* @category Peerius
|
6 |
-
* @package Peerius_Smartrecs
|
7 |
-
* @author Peerius Ltd
|
8 |
-
*/
|
9 |
-
class Peerius_Smartrecs_InfoController extends Mage_Core_Controller_Front_Action {
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
*
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
$
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
$
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
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 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
$collection
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* syncing the products to the peerius server
|
5 |
+
* @category Peerius
|
6 |
+
* @package Peerius_Smartrecs
|
7 |
+
* @author Peerius Ltd
|
8 |
+
*/
|
9 |
+
class Peerius_Smartrecs_InfoController extends Mage_Core_Controller_Front_Action {
|
10 |
+
|
11 |
+
|
12 |
+
/*
|
13 |
+
* returns the parameters of the created peerius SMARTrecs widgets
|
14 |
+
* @return string
|
15 |
+
*/
|
16 |
+
public function allconfigAction() {
|
17 |
+
if ($this->checkToken()) {
|
18 |
+
|
19 |
+
$modules = Mage::getConfig()->getNode('modules')->children();
|
20 |
+
$modulesArray = (array)$modules;
|
21 |
+
$connectVersion = 'unknown';
|
22 |
+
//foreach ($modulesArray as $module) {
|
23 |
+
// $this->log($module->getName()." is on version ".$module->version);
|
24 |
+
//}
|
25 |
+
|
26 |
+
if($modulesArray['Peerius_Smartrecs']->is('active')) {
|
27 |
+
$connectVersion = $modulesArray['Peerius_Smartrecs']->version;
|
28 |
+
$this->log("Peerius_Connect version is ".$connectVersion);
|
29 |
+
} else {
|
30 |
+
$this->log("Peerius_Connect is not available");
|
31 |
+
}
|
32 |
+
|
33 |
+
$configs = Mage::getModel('core/config_data')->getCollection()->addFieldToFilter('path',array('like'=>'peerius%'))->setOrder('path',Varien_Data_Collection::SORT_ORDER_ASC);
|
34 |
+
$response = '<!doctype html><html lang=\'en-gb\'><head><meta charset=\'utf-8\'><title> CONFIG: '.$siteName.'</title>'.$this->getCSS().'</head><body style="font-family:Arial;">';
|
35 |
+
$response .= '<section><h1>Peerius Connect Configuration : '. $siteName . '</h1> (v ' .$connectVersion. ')';
|
36 |
+
|
37 |
+
$sec1 = "";
|
38 |
+
$sec2 = "";
|
39 |
+
foreach ($configs as $config) {
|
40 |
+
$this->log($config->getPath());
|
41 |
+
$path = str_replace('max','number_of_products', $config->getPath());
|
42 |
+
|
43 |
+
$name_arr = explode ("/", $path);
|
44 |
+
$sec1 = $name_arr[1];
|
45 |
+
$secName = ($sec1 != $sec2) ? $sec1 : "";
|
46 |
+
$sec2 = $sec1;
|
47 |
+
if($secName!="") {
|
48 |
+
$response .= '<div class=\'secTitle\'>'.ucfirst($secName). ' Config: </div>';
|
49 |
+
}
|
50 |
+
$paramName = $name_arr[2];
|
51 |
+
$paramValue = $config->getValue();
|
52 |
+
$dispName = $paramName;
|
53 |
+
$dispValue = $paramValue;
|
54 |
+
|
55 |
+
switch ($paramName) {
|
56 |
+
case "token":
|
57 |
+
$dispValue = $dispValue.' (ENCODED: '.sha1($dispValue).')';
|
58 |
+
break;
|
59 |
+
case "enableall":
|
60 |
+
$dispName = 'Are Recs enabled for site?';
|
61 |
+
$dispValue = ($dispValue == 1) ? 'Yes' : 'No';
|
62 |
+
break;
|
63 |
+
case "getrecsasskusonly":
|
64 |
+
$dispName = 'Return recs as :';
|
65 |
+
$dispValue = ($dispValue == 1) ? 'refCodeOnly (only refCodes)' : 'full (includes refCode, title, product url, image url, prices)';
|
66 |
+
break;
|
67 |
+
case "disable":
|
68 |
+
$dispName = 'Are Recs enabled for page?';
|
69 |
+
$dispValue = ($dispValue == 0) ? 'Yes' : 'No';
|
70 |
+
break;
|
71 |
+
case "cronjob":
|
72 |
+
$dispName = 'Feed scheduled at?';
|
73 |
+
break;
|
74 |
+
case "testmode":
|
75 |
+
$dispName = 'Is test mode enabled?';
|
76 |
+
$dispValue = ($dispValue == 1) ? 'Yes' : 'No';
|
77 |
+
break;
|
78 |
+
case "registrationstatus":
|
79 |
+
$dispName = 'Registration status?';
|
80 |
+
$dispValue = ($dispValue == 1) ? 'Registered' : 'Something happend that shouldn\'t have!';
|
81 |
+
break;
|
82 |
+
case "headline":
|
83 |
+
$dispName = 'Widget title';
|
84 |
+
break;
|
85 |
+
case "number_of_products":
|
86 |
+
$dispName = 'Number of recs';
|
87 |
+
break;
|
88 |
+
case "success":
|
89 |
+
$dispName = 'Show recs for all search?';
|
90 |
+
$dispValue = ($dispValue == 0) ? 'No, only for zero search' : 'Yes';
|
91 |
+
break;
|
92 |
+
default:
|
93 |
+
break;
|
94 |
+
}
|
95 |
+
|
96 |
+
$response .= '<div class=\'boxA\'>'.ucfirst($dispName).' </div><div class=\'boxB\'> '.$dispValue . "</div><br />";
|
97 |
+
}
|
98 |
+
|
99 |
+
$collection = Mage::getModel('widget/widget_instance')->getCollection();
|
100 |
+
$collection->addFieldToFilter('instance_type', 'smartrecs/recommendations');
|
101 |
+
|
102 |
+
if($collection->getSize()>0)
|
103 |
+
{
|
104 |
+
//$response .= '<div class=\'secTitle\'>Widget Instances</div>';
|
105 |
+
foreach($collection as $item)
|
106 |
+
{
|
107 |
+
$response .= '<div class=\'secTitle\'>Widget Instance: '.$item->title.'</div>';
|
108 |
+
$v = $item->widget_parameters;
|
109 |
+
$v = str_replace('{','',str_replace('}','',substr($v,5,strlen($v))));
|
110 |
+
$w = explode(';',$v);
|
111 |
+
//Mage::log('wid params: '.print_r($w,1), null, 'peerius_smartrec.log');
|
112 |
+
//Mage::log('widget count : '.count($w), null, 'peerius_smartrec.log');
|
113 |
+
for ($x = 0; $x < count($w) ; $x = $x+2)
|
114 |
+
{
|
115 |
+
$v1 = explode(':',$w[$x]);
|
116 |
+
$v2 = explode(':',$w[$x+1]);
|
117 |
+
if(str_replace('"','',$v1[2]) != "") {
|
118 |
+
$parName = str_replace('"','',$v1[2]);
|
119 |
+
$parValue = str_replace('"','',$v2[2]);
|
120 |
+
switch ($parName) {
|
121 |
+
case "rectype":
|
122 |
+
$parName = 'Widget name';
|
123 |
+
break;
|
124 |
+
case "wtemplate":
|
125 |
+
$parName = 'Template';
|
126 |
+
break;
|
127 |
+
case "headline":
|
128 |
+
$parName = 'Widget title';
|
129 |
+
break;
|
130 |
+
case "max":
|
131 |
+
$parName = 'Number of recs';
|
132 |
+
break;
|
133 |
+
default:
|
134 |
+
break;
|
135 |
+
}
|
136 |
+
$response .= '<div class=\'boxA\'> '.$parName. '</div><div class=\'boxB\'> '.$parValue.' </div><br />';
|
137 |
+
}
|
138 |
+
}
|
139 |
+
}
|
140 |
+
}
|
141 |
+
|
142 |
+
$response .= '<div class=\'secTitle\'></div></section></body></html>';
|
143 |
+
$this->getResponse()->setHeader('Content-Type', 'text/html')->setBody($response);
|
144 |
+
|
145 |
+
}
|
146 |
+
}
|
147 |
+
|
148 |
+
/**
|
149 |
+
* when is the cron executed?
|
150 |
+
* @return int
|
151 |
+
*/
|
152 |
+
public function createtimeAction() {
|
153 |
+
if ($this->checkToken()) {
|
154 |
+
$response = (int) Mage::getStoreConfig('peerius/general/cronjob');
|
155 |
+
|
156 |
+
$this->getResponse()
|
157 |
+
->setHeader('Content-Type', 'text/html')
|
158 |
+
->setBody($response);
|
159 |
+
}
|
160 |
+
}
|
161 |
+
|
162 |
+
/**
|
163 |
+
* what registration status has the shop
|
164 |
+
* @return int
|
165 |
+
*/
|
166 |
+
public function registrationstatusAction() {
|
167 |
+
if ($this->checkToken()) {
|
168 |
+
$response = (int) Mage::getStoreConfig('peerius/general/registrationstatus');
|
169 |
+
|
170 |
+
$this->getResponse()
|
171 |
+
->setHeader('Content-Type', 'text/html')
|
172 |
+
->setBody($response);
|
173 |
+
}
|
174 |
+
}
|
175 |
+
|
176 |
+
/**
|
177 |
+
* what registration status has the shop
|
178 |
+
* @return int
|
179 |
+
*/
|
180 |
+
public function registrationerrorAction() {
|
181 |
+
if ($this->checkToken()) {
|
182 |
+
$response = (int) Mage::getStoreConfig('peerius/general/registrationerror');
|
183 |
+
|
184 |
+
$this->getResponse()
|
185 |
+
->setHeader('Content-Type', 'text/html')
|
186 |
+
->setBody($response);
|
187 |
+
}
|
188 |
+
}
|
189 |
+
|
190 |
+
/*
|
191 |
+
* returns the parameters of the created peerius SMARTrecs widgets
|
192 |
+
* @return string
|
193 |
+
*/
|
194 |
+
public function widgetsAction() {
|
195 |
+
if ($this->checkToken()) {
|
196 |
+
$response = '';
|
197 |
+
$collection = Mage::getModel('widget/widget_instance')->getCollection();
|
198 |
+
$collection->addFieldToFilter('instance_type', 'smartrecs/recommendations');
|
199 |
+
|
200 |
+
foreach($collection as $item)
|
201 |
+
{
|
202 |
+
$response .= $item->title.'<hr>';
|
203 |
+
$response .= $item->widget_parameters;
|
204 |
+
$response .= '<br><br><br>';
|
205 |
+
}
|
206 |
+
|
207 |
+
$this->getResponse()
|
208 |
+
->setHeader('Content-Type', 'text/html')
|
209 |
+
->setBody($response);
|
210 |
+
}
|
211 |
+
}
|
212 |
+
|
213 |
+
/*
|
214 |
+
* resets the registration status
|
215 |
+
* @return string
|
216 |
+
*/
|
217 |
+
public function registrationstatusresetAction() {
|
218 |
+
if ($this->checkToken()) {
|
219 |
+
Mage::getModel('core/config')->saveConfig('peerius/general/registrationstatus', '0');
|
220 |
+
Mage::getModel('core/config')->saveConfig('peerius/general/registrationerror', '0');
|
221 |
+
}
|
222 |
+
}
|
223 |
+
|
224 |
+
/*
|
225 |
+
* deletes the configuration
|
226 |
+
* @return string
|
227 |
+
*/
|
228 |
+
public function resetconfigAction() {
|
229 |
+
if ($this->checkToken()) {
|
230 |
+
$configs = Mage::getModel('core/config_data')->getCollection()->addFieldToFilter('path',array('like'=>'peerius%'));
|
231 |
+
|
232 |
+
foreach ($configs as $config) {
|
233 |
+
$config->delete($config);
|
234 |
+
}
|
235 |
+
$response = count($configs) . ' entries deleted';
|
236 |
+
|
237 |
+
$this->getResponse()
|
238 |
+
->setHeader('Content-Type', 'text/html')
|
239 |
+
->setBody($response);
|
240 |
+
}
|
241 |
+
}
|
242 |
+
|
243 |
+
/*
|
244 |
+
* sets the admin IP to preview recommendations in test mode
|
245 |
+
* @return string
|
246 |
+
*/
|
247 |
+
public function adminipAction() {
|
248 |
+
if ($this->checkToken()) {
|
249 |
+
if (!filter_var($this->getRequest()->getParam('ip'), FILTER_VALIDATE_IP) === false) {
|
250 |
+
Mage::getModel('core/config')->saveConfig('peerius/general/adminip', $this->getRequest()->getParam('ip'));
|
251 |
+
}
|
252 |
+
}
|
253 |
+
}
|
254 |
+
|
255 |
+
/*
|
256 |
+
* reads the admin IP
|
257 |
+
* @return string
|
258 |
+
*/
|
259 |
+
public function adminipreadAction() {
|
260 |
+
if ($this->checkToken()) {
|
261 |
+
$response = Mage::getStoreConfig('peerius/general/adminip');
|
262 |
+
|
263 |
+
$this->getResponse()
|
264 |
+
->setHeader('Content-Type', 'text/html')
|
265 |
+
->setBody($response);
|
266 |
+
}
|
267 |
+
}
|
268 |
+
|
269 |
+
/*
|
270 |
+
* checks for the valid token to prevent URL manipulation
|
271 |
+
* @return bool
|
272 |
+
*/
|
273 |
+
public function checkToken() {
|
274 |
+
$token = Mage::getStoreConfig('peerius/general/token');
|
275 |
+
|
276 |
+
if (!$token OR !$this->getRequest()->getParam('token') OR ($this->getRequest()->getParam('token') != sha1($token))) {
|
277 |
+
$this->log("token error");
|
278 |
+
return false;
|
279 |
+
}
|
280 |
+
return true;
|
281 |
+
}
|
282 |
+
|
283 |
+
/**
|
284 |
+
* @param string $message
|
285 |
+
*/
|
286 |
+
protected function log($message) {
|
287 |
+
Mage::helper('peerius_smartrecs')->log(Zend_Log::DEBUG, $message);
|
288 |
+
}
|
289 |
+
|
290 |
+
/**
|
291 |
+
* return CSS
|
292 |
+
*/
|
293 |
+
protected function getCSS() {
|
294 |
+
return "<style type='text/css'>
|
295 |
+
.secTitle {clear:both;display:block;float:left;padding:5px;margin:10px 0 5px 0;width:100%;color:#808080;font-weight:bold; font-size:20px;}
|
296 |
+
.boxA { clear:left;display:block;float:left;padding:2px 0 0 4px;margin:1px;background-color: #60b346 ; width:200px; height:22px; }
|
297 |
+
.boxB { float:left;display:in-line;padding:2px 0 0 4px;margin:1px;background-color: #A9Ae99; width:650px; height:22px;color:#000; }
|
298 |
+
</style>";
|
299 |
+
}
|
300 |
+
|
301 |
+
|
302 |
+
/**
|
303 |
+
* return peerius log file
|
304 |
+
*/
|
305 |
+
public function peeriusLogAction() {
|
306 |
+
//if ($this->checkToken()) {
|
307 |
+
$this->fileName = Mage::getBaseDir('var') . DS . 'log' . DS . Mage::getStoreConfig($this->CONFIG_LOG_FILE_PATH).'peerius_smartrec.log';
|
308 |
+
$this->getResponse()->setHeader('Cache-Control', 'no-cache, must-revalidate');
|
309 |
+
$this->getResponse()->setHeader('Expires', 'Mon, 26 Jul 1997 05:00:00 GMT');
|
310 |
+
$this->getResponse()->setHeader('Content-Type', 'application/text; charset=UTF-8');
|
311 |
+
|
312 |
+
$file = new Varien_Io_File();
|
313 |
+
$this->_prepareDownloadResponse($this->fileName, $file->read($this->fileName), 'application/text');
|
314 |
+
//}
|
315 |
+
}
|
316 |
+
|
317 |
+
/**
|
318 |
+
* return magento log file
|
319 |
+
*/
|
320 |
+
public function magentoLogAction() {
|
321 |
+
//if ($this->checkToken()) {
|
322 |
+
$this->fileName = Mage::getBaseDir('var') . DS . 'log' . DS . Mage::getStoreConfig($this->CONFIG_LOG_FILE_PATH).'magento.log';
|
323 |
+
$this->getResponse()->setHeader('Cache-Control', 'no-cache, must-revalidate');
|
324 |
+
$this->getResponse()->setHeader('Expires', 'Mon, 26 Jul 1997 05:00:00 GMT');
|
325 |
+
$this->getResponse()->setHeader('Content-Type', 'application/text; charset=UTF-8');
|
326 |
+
|
327 |
+
$file = new Varien_Io_File();
|
328 |
+
$this->_prepareDownloadResponse($this->fileName, $file->read($this->fileName), 'application/text');
|
329 |
+
//}
|
330 |
+
}
|
331 |
+
|
332 |
+
/**
|
333 |
+
* return exception log file
|
334 |
+
*/
|
335 |
+
public function exceptionLogAction() {
|
336 |
+
//if ($this->checkToken()) {
|
337 |
+
$this->fileName = Mage::getBaseDir('var') . DS . 'log' . DS . Mage::getStoreConfig($this->CONFIG_LOG_FILE_PATH).'exception.log';
|
338 |
+
$this->getResponse()->setHeader('Cache-Control', 'no-cache, must-revalidate');
|
339 |
+
$this->getResponse()->setHeader('Expires', 'Mon, 26 Jul 1997 05:00:00 GMT');
|
340 |
+
$this->getResponse()->setHeader('Content-Type', 'application/text; charset=UTF-8');
|
341 |
+
|
342 |
+
$file = new Varien_Io_File();
|
343 |
+
$this->_prepareDownloadResponse($this->fileName, $file->read($this->fileName), 'application/text');
|
344 |
+
//}
|
345 |
+
}
|
346 |
+
|
347 |
+
}
|
348 |
+
|
app/code/community/Peerius/Smartrecs/etc/config.xml
CHANGED
@@ -1,97 +1,97 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<config>
|
3 |
-
<modules>
|
4 |
-
<Peerius_Smartrecs>
|
5 |
-
<version>1.0.
|
6 |
-
</Peerius_Smartrecs>
|
7 |
-
</modules>
|
8 |
-
<frontend>
|
9 |
-
<routers>
|
10 |
-
<peerius_smartrecs>
|
11 |
-
<use>standard</use>
|
12 |
-
<args>
|
13 |
-
<module>Peerius_Smartrecs</module>
|
14 |
-
<frontName>peerius</frontName>
|
15 |
-
</args>
|
16 |
-
</peerius_smartrecs>
|
17 |
-
</routers>
|
18 |
-
<layout>
|
19 |
-
<updates>
|
20 |
-
<peerius_smartrecs>
|
21 |
-
<file>smartrecs.xml</file>
|
22 |
-
</peerius_smartrecs>
|
23 |
-
</updates>
|
24 |
-
</layout>
|
25 |
-
</frontend>
|
26 |
-
<global>
|
27 |
-
<models>
|
28 |
-
<peerius_smartrecs>
|
29 |
-
<class>Peerius_Smartrecs_Model</class>
|
30 |
-
</peerius_smartrecs>
|
31 |
-
<catalogsearch>
|
32 |
-
<rewrite>
|
33 |
-
<layer>Peerius_Smartrecs_Model_SearchLayer</layer>
|
34 |
-
</rewrite>
|
35 |
-
</catalogsearch>
|
36 |
-
</models>
|
37 |
-
<blocks>
|
38 |
-
<smartrecs>
|
39 |
-
<class>Peerius_Smartrecs_Block</class>
|
40 |
-
</smartrecs>
|
41 |
-
</blocks>
|
42 |
-
<helpers>
|
43 |
-
<peerius_smartrecs>
|
44 |
-
<class>Peerius_Smartrecs_Helper</class>
|
45 |
-
</peerius_smartrecs>
|
46 |
-
</helpers>
|
47 |
-
</global>
|
48 |
-
<adminhtml>
|
49 |
-
<layout>
|
50 |
-
<updates>
|
51 |
-
<peerius_smartrecs>
|
52 |
-
<file>smartrecs.xml</file>
|
53 |
-
</peerius_smartrecs>
|
54 |
-
</updates>
|
55 |
-
</layout>
|
56 |
-
</adminhtml>
|
57 |
-
<admin>
|
58 |
-
<routers>
|
59 |
-
<adminhtml>
|
60 |
-
<args>
|
61 |
-
<modules>
|
62 |
-
<peerius_smartrecs after="Mage_Adminhtml">Peerius_Smartrecs_Adminhtml</peerius_smartrecs>
|
63 |
-
</modules>
|
64 |
-
</args>
|
65 |
-
</adminhtml>
|
66 |
-
</routers>
|
67 |
-
</admin>
|
68 |
-
<default>
|
69 |
-
<peerius>
|
70 |
-
<general>
|
71 |
-
<client_name></client_name>
|
72 |
-
<cronjob>4</cronjob>
|
73 |
-
<testmode>1</testmode>
|
74 |
-
<registrationstatus>0</registrationstatus>
|
75 |
-
<registrationerror>0</registrationerror>
|
76 |
-
</general>
|
77 |
-
<home>
|
78 |
-
<max>3</max>
|
79 |
-
</home>
|
80 |
-
<category>
|
81 |
-
<max>3</max>
|
82 |
-
</category>
|
83 |
-
<product>
|
84 |
-
<max>3</max>
|
85 |
-
</product>
|
86 |
-
<product2>
|
87 |
-
<max>3</max>
|
88 |
-
</product2>
|
89 |
-
<search>
|
90 |
-
<max>3</max>
|
91 |
-
</search>
|
92 |
-
<basket>
|
93 |
-
<max>3</max>
|
94 |
-
</basket>
|
95 |
-
</peerius>
|
96 |
-
</default>
|
97 |
-
</config>
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Peerius_Smartrecs>
|
5 |
+
<version>1.0.9</version>
|
6 |
+
</Peerius_Smartrecs>
|
7 |
+
</modules>
|
8 |
+
<frontend>
|
9 |
+
<routers>
|
10 |
+
<peerius_smartrecs>
|
11 |
+
<use>standard</use>
|
12 |
+
<args>
|
13 |
+
<module>Peerius_Smartrecs</module>
|
14 |
+
<frontName>peerius</frontName>
|
15 |
+
</args>
|
16 |
+
</peerius_smartrecs>
|
17 |
+
</routers>
|
18 |
+
<layout>
|
19 |
+
<updates>
|
20 |
+
<peerius_smartrecs>
|
21 |
+
<file>smartrecs.xml</file>
|
22 |
+
</peerius_smartrecs>
|
23 |
+
</updates>
|
24 |
+
</layout>
|
25 |
+
</frontend>
|
26 |
+
<global>
|
27 |
+
<models>
|
28 |
+
<peerius_smartrecs>
|
29 |
+
<class>Peerius_Smartrecs_Model</class>
|
30 |
+
</peerius_smartrecs>
|
31 |
+
<catalogsearch>
|
32 |
+
<rewrite>
|
33 |
+
<layer>Peerius_Smartrecs_Model_SearchLayer</layer>
|
34 |
+
</rewrite>
|
35 |
+
</catalogsearch>
|
36 |
+
</models>
|
37 |
+
<blocks>
|
38 |
+
<smartrecs>
|
39 |
+
<class>Peerius_Smartrecs_Block</class>
|
40 |
+
</smartrecs>
|
41 |
+
</blocks>
|
42 |
+
<helpers>
|
43 |
+
<peerius_smartrecs>
|
44 |
+
<class>Peerius_Smartrecs_Helper</class>
|
45 |
+
</peerius_smartrecs>
|
46 |
+
</helpers>
|
47 |
+
</global>
|
48 |
+
<adminhtml>
|
49 |
+
<layout>
|
50 |
+
<updates>
|
51 |
+
<peerius_smartrecs>
|
52 |
+
<file>smartrecs.xml</file>
|
53 |
+
</peerius_smartrecs>
|
54 |
+
</updates>
|
55 |
+
</layout>
|
56 |
+
</adminhtml>
|
57 |
+
<admin>
|
58 |
+
<routers>
|
59 |
+
<adminhtml>
|
60 |
+
<args>
|
61 |
+
<modules>
|
62 |
+
<peerius_smartrecs after="Mage_Adminhtml">Peerius_Smartrecs_Adminhtml</peerius_smartrecs>
|
63 |
+
</modules>
|
64 |
+
</args>
|
65 |
+
</adminhtml>
|
66 |
+
</routers>
|
67 |
+
</admin>
|
68 |
+
<default>
|
69 |
+
<peerius>
|
70 |
+
<general>
|
71 |
+
<client_name></client_name>
|
72 |
+
<cronjob>4</cronjob>
|
73 |
+
<testmode>1</testmode>
|
74 |
+
<registrationstatus>0</registrationstatus>
|
75 |
+
<registrationerror>0</registrationerror>
|
76 |
+
</general>
|
77 |
+
<home>
|
78 |
+
<max>3</max>
|
79 |
+
</home>
|
80 |
+
<category>
|
81 |
+
<max>3</max>
|
82 |
+
</category>
|
83 |
+
<product>
|
84 |
+
<max>3</max>
|
85 |
+
</product>
|
86 |
+
<product2>
|
87 |
+
<max>3</max>
|
88 |
+
</product2>
|
89 |
+
<search>
|
90 |
+
<max>3</max>
|
91 |
+
</search>
|
92 |
+
<basket>
|
93 |
+
<max>3</max>
|
94 |
+
</basket>
|
95 |
+
</peerius>
|
96 |
+
</default>
|
97 |
+
</config>
|
app/code/community/Peerius/Smartrecs/etc/system.xml
CHANGED
@@ -1,357 +1,366 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<config>
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
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 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
355 |
<label>Wishlist</label>
|
356 |
<sort_order>110</sort_order>
|
357 |
<show_in_default>1</show_in_default>
|
@@ -396,76 +405,76 @@
|
|
396 |
</disable>
|
397 |
</fields>
|
398 |
</wishlist>-->
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
<label>Checkout</label>
|
470 |
<sort_order>130</sort_order>
|
471 |
<show_in_default>1</show_in_default>
|
@@ -507,63 +516,63 @@
|
|
507 |
</disable>
|
508 |
</fields>
|
509 |
</checkout>-->
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
<label>Order</label>
|
568 |
<sort_order>150</sort_order>
|
569 |
<show_in_default>1</show_in_default>
|
@@ -605,7 +614,7 @@
|
|
605 |
</disable>
|
606 |
</fields>
|
607 |
</order>-->
|
608 |
-
|
609 |
<label>Other</label>
|
610 |
<sort_order>160</sort_order>
|
611 |
<show_in_default>1</show_in_default>
|
@@ -647,7 +656,7 @@
|
|
647 |
</disable>
|
648 |
</fields>
|
649 |
</other>-->
|
650 |
-
|
651 |
-
|
652 |
-
|
653 |
-
</config>
|
1 |
<?xml version="1.0"?>
|
2 |
<config>
|
3 |
+
<tabs>
|
4 |
+
<peerius translate="label">
|
5 |
+
<label>Peerius</label>
|
6 |
+
<sort_order>15</sort_order>
|
7 |
+
</peerius>
|
8 |
+
</tabs>
|
9 |
+
<sections>
|
10 |
+
<peerius translate="Peerius" module="adminhtml">
|
11 |
+
<label>Peerius Connect Admin</label>
|
12 |
+
<tab>peerius</tab>
|
13 |
+
<sort_order>10</sort_order>
|
14 |
+
<show_in_default>1</show_in_default>
|
15 |
+
<show_in_website>1</show_in_website>
|
16 |
+
<show_in_store>1</show_in_store>
|
17 |
+
<groups>
|
18 |
+
<general translate="General">
|
19 |
+
<label>General</label>
|
20 |
+
<sort_order>50</sort_order>
|
21 |
+
<show_in_default>1</show_in_default>
|
22 |
+
<show_in_website>1</show_in_website>
|
23 |
+
<show_in_store>1</show_in_store>
|
24 |
+
<fields>
|
25 |
+
<client_name translate="Client Name">
|
26 |
+
<label>Client Name</label>
|
27 |
+
<comment>The Peerius client name</comment>
|
28 |
+
<frontend_type>text</frontend_type>
|
29 |
+
<sort_order>51</sort_order>
|
30 |
+
<show_in_default>1</show_in_default>
|
31 |
+
<show_in_website>1</show_in_website>
|
32 |
+
<show_in_store>1</show_in_store>
|
33 |
+
</client_name>
|
34 |
+
<token translate="Client Token">
|
35 |
+
<backend_model>peerius_smartrecs/token</backend_model>
|
36 |
+
<label>Client Token</label>
|
37 |
+
<comment>The Peerius client token</comment>
|
38 |
+
<frontend_type>text</frontend_type>
|
39 |
+
<sort_order>52</sort_order>
|
40 |
+
<show_in_default>1</show_in_default>
|
41 |
+
<show_in_website>1</show_in_website>
|
42 |
+
<show_in_store>1</show_in_store>
|
43 |
+
</token>
|
44 |
+
<testmode translate="Test Mode">
|
45 |
+
<label>Test Mode</label>
|
46 |
+
<frontend_type>select</frontend_type>
|
47 |
+
<sort_order>53</sort_order>
|
48 |
+
<source_model>adminhtml/system_config_source_enabledisable</source_model>
|
49 |
+
<show_in_default>1</show_in_default>
|
50 |
+
<show_in_website>1</show_in_website>
|
51 |
+
<show_in_store>1</show_in_store>
|
52 |
+
<tooltip><![CDATA[Enable Test Mode if you would like to test recommendations from the IP address of the PC or laptop that you are currently logged on. If you would like to test from a different machine, please use the 'peeriuspreview' parameter as shown:, e.g. www.yourshop.com/?peeriuspreview.<br><br>Only Disable Test Mode if you are ready to go live with Peerius SMART-recs.]]></tooltip>
|
53 |
+
</testmode>
|
54 |
+
<cronjob translate="Feed generation">
|
55 |
+
<label>Feed generation</label>
|
56 |
+
<tooltip>Specify the time when Peerius should create and import the feed</tooltip>
|
57 |
+
<frontend_type>select</frontend_type>
|
58 |
+
<source_model>peerius_smartrecs/system_config_source_dropdown_values</source_model>
|
59 |
+
<sort_order>54</sort_order>
|
60 |
+
<show_in_default>1</show_in_default>
|
61 |
+
<show_in_website>1</show_in_website>
|
62 |
+
<show_in_store>1</show_in_store>
|
63 |
+
</cronjob>
|
64 |
+
<widgetheight translate="Recommendation widget heights">
|
65 |
+
<label>Recommendation widget heights</label>
|
66 |
+
<comment>The heights of each individual recommendation widget</comment>
|
67 |
+
<frontend_type>text</frontend_type>
|
68 |
+
<depends>
|
69 |
+
<field_name>1</field_name>
|
70 |
+
</depends>
|
71 |
+
<sort_order>55</sort_order>
|
72 |
+
<show_in_default>1</show_in_default>
|
73 |
+
<show_in_website>1</show_in_website>
|
74 |
+
<show_in_store>1</show_in_store>
|
75 |
+
</widgetheight>
|
76 |
+
<registrationstatus translate="registrationstatus">
|
77 |
+
<frontend_type>text</frontend_type>
|
78 |
+
<sort_order>56</sort_order>
|
79 |
+
<depends>
|
80 |
+
<field_name>1</field_name>
|
81 |
+
</depends>
|
82 |
+
<show_in_default>1</show_in_default>
|
83 |
+
<show_in_website>1</show_in_website>
|
84 |
+
<show_in_store>1</show_in_store>
|
85 |
+
</registrationstatus>
|
86 |
+
<registrationerror translate="registrationerror">
|
87 |
+
<frontend_type>text</frontend_type>
|
88 |
+
<sort_order>56</sort_order>
|
89 |
+
<depends>
|
90 |
+
<field_name>1</field_name>
|
91 |
+
</depends>
|
92 |
+
<show_in_default>1</show_in_default>
|
93 |
+
<show_in_website>1</show_in_website>
|
94 |
+
<show_in_store>1</show_in_store>
|
95 |
+
</registrationerror>
|
96 |
+
<enableall translate="Disable All">
|
97 |
+
<label>Enable recommendations</label>
|
98 |
+
<frontend_type>select</frontend_type>
|
99 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
100 |
+
<sort_order>57</sort_order>
|
101 |
+
<show_in_default>1</show_in_default>
|
102 |
+
<show_in_website>1</show_in_website>
|
103 |
+
<show_in_store>1</show_in_store>
|
104 |
+
</enableall>
|
105 |
+
<getrecsasskusonly translate="Get Recommendations as SKUs">
|
106 |
+
<label>Get Recommendations as SKUs</label>
|
107 |
+
<frontend_type>select</frontend_type>
|
108 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
109 |
+
<sort_order>58</sort_order>
|
110 |
+
<show_in_default>1</show_in_default>
|
111 |
+
<show_in_website>1</show_in_website>
|
112 |
+
<show_in_store>1</show_in_store>
|
113 |
+
<tooltip><![CDATA[If you do not want Peerius to return recommendations as SKUs that are used to retrieve product details from Magento. Instead, you want to display the product details returned by Peerius, please change this to 'No'.]]></tooltip>
|
114 |
+
</getrecsasskusonly>
|
115 |
+
<adminip translate="adminip">
|
116 |
+
<frontend_type>text</frontend_type>
|
117 |
+
<depends>
|
118 |
+
<field_name>1</field_name>
|
119 |
+
</depends>
|
120 |
+
<sort_order>59</sort_order>
|
121 |
+
<show_in_default>1</show_in_default>
|
122 |
+
<show_in_website>1</show_in_website>
|
123 |
+
<show_in_store>1</show_in_store>
|
124 |
+
</adminip>
|
125 |
+
<creatingfeed translate="creatingfeed">
|
126 |
+
<frontend_type>text</frontend_type>
|
127 |
+
<sort_order>60</sort_order>
|
128 |
+
<depends>
|
129 |
+
<field_name>1</field_name>
|
130 |
+
</depends>
|
131 |
+
<show_in_default>1</show_in_default>
|
132 |
+
<show_in_website>1</show_in_website>
|
133 |
+
<show_in_store>1</show_in_store>
|
134 |
+
</creatingfeed>
|
135 |
+
</fields>
|
136 |
+
</general>
|
137 |
+
<home translate="Home">
|
138 |
+
<label>Home</label>
|
139 |
+
<sort_order>80</sort_order>
|
140 |
+
<show_in_default>1</show_in_default>
|
141 |
+
<show_in_website>1</show_in_website>
|
142 |
+
<show_in_store>1</show_in_store>
|
143 |
+
<fields>
|
144 |
+
<template>
|
145 |
+
<label>Template</label>
|
146 |
+
<frontend_type>select</frontend_type>
|
147 |
+
<sort_order>81</sort_order>
|
148 |
+
<show_in_default>1</show_in_default>
|
149 |
+
<show_in_website>1</show_in_website>
|
150 |
+
<show_in_store>1</show_in_store>
|
151 |
+
<source_model>peerius_smartrecs/templates_home</source_model>
|
152 |
+
<tooltip>Edit template files in /frontend/base/default/template/smartrecs/recs/</tooltip>
|
153 |
+
<depends>
|
154 |
+
<disable>0</disable>
|
155 |
+
</depends>
|
156 |
+
</template>
|
157 |
+
<headline translate="Headline">
|
158 |
+
<label>Title</label>
|
159 |
+
<frontend_type>text</frontend_type>
|
160 |
+
<sort_order>82</sort_order>
|
161 |
+
<show_in_default>1</show_in_default>
|
162 |
+
<show_in_website>1</show_in_website>
|
163 |
+
<show_in_store>1</show_in_store>
|
164 |
+
<tooltip>This will be used as the title of your widget</tooltip>
|
165 |
+
<depends>
|
166 |
+
<disable>0</disable>
|
167 |
+
</depends>
|
168 |
+
</headline>
|
169 |
+
<max translate="Max number of products">
|
170 |
+
<label>Number of products</label>
|
171 |
+
<frontend_type>select</frontend_type>
|
172 |
+
<sort_order>83</sort_order>
|
173 |
+
<show_in_default>1</show_in_default>
|
174 |
+
<show_in_website>1</show_in_website>
|
175 |
+
<show_in_store>1</show_in_store>
|
176 |
+
<source_model>peerius_smartrecs/max</source_model>
|
177 |
+
<tooltip>Number of products that should be displayed</tooltip>
|
178 |
+
<depends>
|
179 |
+
<disable>0</disable>
|
180 |
+
</depends>
|
181 |
+
</max>
|
182 |
+
<disable translate="Enable recommendations">
|
183 |
+
<label>Enable recommendations</label>
|
184 |
+
<frontend_type>select</frontend_type>
|
185 |
+
<source_model>peerius_smartrecs/system_config_source_yesno</source_model>
|
186 |
+
<sort_order>84</sort_order>
|
187 |
+
<show_in_default>1</show_in_default>
|
188 |
+
<show_in_website>1</show_in_website>
|
189 |
+
<show_in_store>1</show_in_store>
|
190 |
+
</disable>
|
191 |
+
</fields>
|
192 |
+
</home>
|
193 |
+
<category translate="Category">
|
194 |
+
<label>Category</label>
|
195 |
+
<sort_order>90</sort_order>
|
196 |
+
<show_in_default>1</show_in_default>
|
197 |
+
<show_in_website>1</show_in_website>
|
198 |
+
<show_in_store>1</show_in_store>
|
199 |
+
<fields>
|
200 |
+
<template>
|
201 |
+
<label>Template</label>
|
202 |
+
<frontend_type>select</frontend_type>
|
203 |
+
<sort_order>91</sort_order>
|
204 |
+
<show_in_default>1</show_in_default>
|
205 |
+
<show_in_website>1</show_in_website>
|
206 |
+
<show_in_store>1</show_in_store>
|
207 |
+
<source_model>peerius_smartrecs/templates_category</source_model>
|
208 |
+
<tooltip>Edit template files in /frontend/base/default/template/smartrecs/recs/</tooltip>
|
209 |
+
<depends>
|
210 |
+
<disable>0</disable>
|
211 |
+
</depends>
|
212 |
+
</template>
|
213 |
+
<headline translate="Headline">
|
214 |
+
<label>Title</label>
|
215 |
+
<frontend_type>text</frontend_type>
|
216 |
+
<sort_order>92</sort_order>
|
217 |
+
<show_in_default>1</show_in_default>
|
218 |
+
<show_in_website>1</show_in_website>
|
219 |
+
<show_in_store>1</show_in_store>
|
220 |
+
<tooltip>This will be used as the title of your widget</tooltip>
|
221 |
+
<depends>
|
222 |
+
<disable>0</disable>
|
223 |
+
</depends>
|
224 |
+
</headline>
|
225 |
+
<max translate="Number of products">
|
226 |
+
<label>Number of products</label>
|
227 |
+
<frontend_type>select</frontend_type>
|
228 |
+
<sort_order>93</sort_order>
|
229 |
+
<show_in_default>1</show_in_default>
|
230 |
+
<show_in_website>1</show_in_website>
|
231 |
+
<show_in_store>1</show_in_store>
|
232 |
+
<source_model>peerius_smartrecs/max</source_model>
|
233 |
+
<tooltip>Number of products that should be displayed</tooltip>
|
234 |
+
<depends>
|
235 |
+
<disable>0</disable>
|
236 |
+
</depends>
|
237 |
+
</max>
|
238 |
+
<disable translate="Enable recommendations">
|
239 |
+
<label>Enable recommendations</label>
|
240 |
+
<frontend_type>select</frontend_type>
|
241 |
+
<source_model>peerius_smartrecs/system_config_source_yesno</source_model>
|
242 |
+
<sort_order>94</sort_order>
|
243 |
+
<show_in_default>1</show_in_default>
|
244 |
+
<show_in_website>1</show_in_website>
|
245 |
+
<show_in_store>1</show_in_store>
|
246 |
+
</disable>
|
247 |
+
</fields>
|
248 |
+
</category>
|
249 |
+
<product>
|
250 |
+
<label>Product Widget 1</label>
|
251 |
+
<sort_order>101</sort_order>
|
252 |
+
<show_in_default>1</show_in_default>
|
253 |
+
<show_in_website>1</show_in_website>
|
254 |
+
<show_in_store>1</show_in_store>
|
255 |
+
<!--<comment><![CDATA[<a href="/index.php/?peeriuspreview" target="_blank"><em>Preview</em></a>]]></comment>-->
|
256 |
+
<fields>
|
257 |
+
<template>
|
258 |
+
<label>Template</label>
|
259 |
+
<frontend_type>select</frontend_type>
|
260 |
+
<sort_order>102</sort_order>
|
261 |
+
<show_in_default>1</show_in_default>
|
262 |
+
<show_in_website>1</show_in_website>
|
263 |
+
<show_in_store>1</show_in_store>
|
264 |
+
<source_model>peerius_smartrecs/templates_product1</source_model>
|
265 |
+
<tooltip>Edit template files in /frontend/base/default/template/smartrecs/recs/</tooltip>
|
266 |
+
<depends>
|
267 |
+
<disable>0</disable>
|
268 |
+
</depends>
|
269 |
+
</template>
|
270 |
+
<headline translate="Headline">
|
271 |
+
<label>Title</label>
|
272 |
+
<frontend_type>text</frontend_type>
|
273 |
+
<sort_order>103</sort_order>
|
274 |
+
<show_in_default>1</show_in_default>
|
275 |
+
<show_in_website>1</show_in_website>
|
276 |
+
<show_in_store>1</show_in_store>
|
277 |
+
<tooltip>This will be used as the title of your widget</tooltip>
|
278 |
+
<depends>
|
279 |
+
<disable>0</disable>
|
280 |
+
</depends>
|
281 |
+
</headline>
|
282 |
+
<max translate="Number of products">
|
283 |
+
<label>Number of products</label>
|
284 |
+
<frontend_type>select</frontend_type>
|
285 |
+
<sort_order>104</sort_order>
|
286 |
+
<show_in_default>1</show_in_default>
|
287 |
+
<show_in_website>1</show_in_website>
|
288 |
+
<show_in_store>1</show_in_store>
|
289 |
+
<source_model>peerius_smartrecs/max</source_model>
|
290 |
+
<tooltip>Number of products that should be displayed</tooltip>
|
291 |
+
<depends>
|
292 |
+
<disable>0</disable>
|
293 |
+
</depends>
|
294 |
+
</max>
|
295 |
+
<disable translate="Enable recommendations">
|
296 |
+
<label>Enable recommendations</label>
|
297 |
+
<frontend_type>select</frontend_type>
|
298 |
+
<source_model>peerius_smartrecs/system_config_source_yesno</source_model>
|
299 |
+
<sort_order>105</sort_order>
|
300 |
+
<show_in_default>1</show_in_default>
|
301 |
+
<show_in_website>1</show_in_website>
|
302 |
+
<show_in_store>1</show_in_store>
|
303 |
+
</disable>
|
304 |
+
</fields>
|
305 |
+
</product>
|
306 |
+
<product2>
|
307 |
+
<label>Product Widget 2</label>
|
308 |
+
<sort_order>110</sort_order>
|
309 |
+
<show_in_default>1</show_in_default>
|
310 |
+
<show_in_website>1</show_in_website>
|
311 |
+
<show_in_store>1</show_in_store>
|
312 |
+
<!--<comment><![CDATA[<a href="/index.php/?peeriuspreview" target="_blank"><em>Preview</em></a>]]></comment>-->
|
313 |
+
<fields>
|
314 |
+
<template>
|
315 |
+
<label>Template</label>
|
316 |
+
<frontend_type>select</frontend_type>
|
317 |
+
<sort_order>113</sort_order>
|
318 |
+
<show_in_default>1</show_in_default>
|
319 |
+
<show_in_website>1</show_in_website>
|
320 |
+
<show_in_store>1</show_in_store>
|
321 |
+
<source_model>peerius_smartrecs/templates_product2</source_model>
|
322 |
+
<tooltip>Edit template files in /frontend/base/default/template/smartrecs/recs/</tooltip>
|
323 |
+
<depends>
|
324 |
+
<disable>0</disable>
|
325 |
+
</depends>
|
326 |
+
</template>
|
327 |
+
<headline translate="Headline">
|
328 |
+
<label>Title</label>
|
329 |
+
<frontend_type>text</frontend_type>
|
330 |
+
<sort_order>114</sort_order>
|
331 |
+
<show_in_default>1</show_in_default>
|
332 |
+
<show_in_website>1</show_in_website>
|
333 |
+
<show_in_store>1</show_in_store>
|
334 |
+
<tooltip>This will be used as the title of your widget</tooltip>
|
335 |
+
<depends>
|
336 |
+
<disable>0</disable>
|
337 |
+
</depends>
|
338 |
+
</headline>
|
339 |
+
<max translate="Number of products">
|
340 |
+
<label>Number of products</label>
|
341 |
+
<frontend_type>select</frontend_type>
|
342 |
+
<sort_order>115</sort_order>
|
343 |
+
<show_in_default>1</show_in_default>
|
344 |
+
<show_in_website>1</show_in_website>
|
345 |
+
<show_in_store>1</show_in_store>
|
346 |
+
<source_model>peerius_smartrecs/max</source_model>
|
347 |
+
<tooltip>Number of products that should be displayed</tooltip>
|
348 |
+
<depends>
|
349 |
+
<disable>0</disable>
|
350 |
+
</depends>
|
351 |
+
</max>
|
352 |
+
<disable translate="Enable recommendations">
|
353 |
+
<label>Enable recommendations</label>
|
354 |
+
<frontend_type>select</frontend_type>
|
355 |
+
<source_model>peerius_smartrecs/system_config_source_yesno</source_model>
|
356 |
+
<sort_order>116</sort_order>
|
357 |
+
<show_in_default>1</show_in_default>
|
358 |
+
<show_in_website>1</show_in_website>
|
359 |
+
<show_in_store>1</show_in_store>
|
360 |
+
</disable>
|
361 |
+
</fields>
|
362 |
+
</product2>
|
363 |
+
<!--<wishlist>
|
364 |
<label>Wishlist</label>
|
365 |
<sort_order>110</sort_order>
|
366 |
<show_in_default>1</show_in_default>
|
405 |
</disable>
|
406 |
</fields>
|
407 |
</wishlist>-->
|
408 |
+
<search>
|
409 |
+
<label>Search</label>
|
410 |
+
<sort_order>120</sort_order>
|
411 |
+
<show_in_default>1</show_in_default>
|
412 |
+
<show_in_website>1</show_in_website>
|
413 |
+
<show_in_store>1</show_in_store>
|
414 |
+
<fields>
|
415 |
+
<template>
|
416 |
+
<label>Template</label>
|
417 |
+
<frontend_type>select</frontend_type>
|
418 |
+
<sort_order>121</sort_order>
|
419 |
+
<show_in_default>1</show_in_default>
|
420 |
+
<show_in_website>1</show_in_website>
|
421 |
+
<show_in_store>1</show_in_store>
|
422 |
+
<source_model>peerius_smartrecs/templates_search</source_model>
|
423 |
+
<tooltip>Edit template files in /frontend/base/default/template/smartrecs/recs/</tooltip>
|
424 |
+
<depends>
|
425 |
+
<disable>0</disable>
|
426 |
+
</depends>
|
427 |
+
</template>
|
428 |
+
<headline translate="Headline">
|
429 |
+
<label>Title</label>
|
430 |
+
<frontend_type>text</frontend_type>
|
431 |
+
<sort_order>122</sort_order>
|
432 |
+
<show_in_default>1</show_in_default>
|
433 |
+
<show_in_website>1</show_in_website>
|
434 |
+
<show_in_store>1</show_in_store>
|
435 |
+
<tooltip>This will be used as title of your widget</tooltip>
|
436 |
+
<depends>
|
437 |
+
<disable>0</disable>
|
438 |
+
</depends>
|
439 |
+
</headline>
|
440 |
+
<max translate="Number of products">
|
441 |
+
<label>Number of products</label>
|
442 |
+
<frontend_type>select</frontend_type>
|
443 |
+
<sort_order>123</sort_order>
|
444 |
+
<show_in_default>1</show_in_default>
|
445 |
+
<show_in_website>1</show_in_website>
|
446 |
+
<show_in_store>1</show_in_store>
|
447 |
+
<source_model>peerius_smartrecs/max</source_model>
|
448 |
+
<tooltip>Number of products that should be displayed</tooltip>
|
449 |
+
<depends>
|
450 |
+
<disable>0</disable>
|
451 |
+
</depends>
|
452 |
+
</max>
|
453 |
+
<success translate="Show for successful search results">
|
454 |
+
<label>Show for successful search results</label>
|
455 |
+
<frontend_type>select</frontend_type>
|
456 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
457 |
+
<sort_order>124</sort_order>
|
458 |
+
<show_in_default>1</show_in_default>
|
459 |
+
<show_in_website>1</show_in_website>
|
460 |
+
<show_in_store>1</show_in_store>
|
461 |
+
<tooltip>If this is set to "Yes", the search widget will be displayed on the search page. Default is "No", which displays the search widget only if the search results are empty</tooltip>
|
462 |
+
<depends>
|
463 |
+
<disable>0</disable>
|
464 |
+
</depends>
|
465 |
+
</success>
|
466 |
+
<disable translate="Enable recommendations">
|
467 |
+
<label>Enable recommendations</label>
|
468 |
+
<frontend_type>select</frontend_type>
|
469 |
+
<source_model>peerius_smartrecs/system_config_source_yesno</source_model>
|
470 |
+
<sort_order>125</sort_order>
|
471 |
+
<show_in_default>1</show_in_default>
|
472 |
+
<show_in_website>1</show_in_website>
|
473 |
+
<show_in_store>1</show_in_store>
|
474 |
+
</disable>
|
475 |
+
</fields>
|
476 |
+
</search>
|
477 |
+
<!--<checkout>
|
478 |
<label>Checkout</label>
|
479 |
<sort_order>130</sort_order>
|
480 |
<show_in_default>1</show_in_default>
|
516 |
</disable>
|
517 |
</fields>
|
518 |
</checkout>-->
|
519 |
+
<basket>
|
520 |
+
<label>Basket</label>
|
521 |
+
<sort_order>140</sort_order>
|
522 |
+
<show_in_default>1</show_in_default>
|
523 |
+
<show_in_website>1</show_in_website>
|
524 |
+
<show_in_store>1</show_in_store>
|
525 |
+
<fields>
|
526 |
+
<template>
|
527 |
+
<label>Template</label>
|
528 |
+
<frontend_type>select</frontend_type>
|
529 |
+
<sort_order>141</sort_order>
|
530 |
+
<show_in_default>1</show_in_default>
|
531 |
+
<show_in_website>1</show_in_website>
|
532 |
+
<show_in_store>1</show_in_store>
|
533 |
+
<source_model>peerius_smartrecs/templates_basket</source_model>
|
534 |
+
<tooltip>Edit template files in /frontend/base/default/template/smartrecs/recs/</tooltip>
|
535 |
+
<depends>
|
536 |
+
<disable>0</disable>
|
537 |
+
</depends>
|
538 |
+
</template>
|
539 |
+
<headline translate="Headline">
|
540 |
+
<label>Title</label>
|
541 |
+
<frontend_type>text</frontend_type>
|
542 |
+
<sort_order>142</sort_order>
|
543 |
+
<show_in_default>1</show_in_default>
|
544 |
+
<show_in_website>1</show_in_website>
|
545 |
+
<show_in_store>1</show_in_store>
|
546 |
+
<tooltip>This will be used as title of your widget</tooltip>
|
547 |
+
<depends>
|
548 |
+
<disable>0</disable>
|
549 |
+
</depends>
|
550 |
+
</headline>
|
551 |
+
<max translate="Number of products">
|
552 |
+
<label>Number of products</label>
|
553 |
+
<frontend_type>select</frontend_type>
|
554 |
+
<sort_order>143</sort_order>
|
555 |
+
<show_in_default>1</show_in_default>
|
556 |
+
<show_in_website>1</show_in_website>
|
557 |
+
<show_in_store>1</show_in_store>
|
558 |
+
<source_model>peerius_smartrecs/max</source_model>
|
559 |
+
<tooltip>Number of products that should be displayed</tooltip>
|
560 |
+
<depends>
|
561 |
+
<disable>0</disable>
|
562 |
+
</depends>
|
563 |
+
</max>
|
564 |
+
<disable translate="Enable recommendations">
|
565 |
+
<label>Enable recommendations</label>
|
566 |
+
<frontend_type>select</frontend_type>
|
567 |
+
<source_model>peerius_smartrecs/system_config_source_yesno</source_model>
|
568 |
+
<sort_order>144</sort_order>
|
569 |
+
<show_in_default>1</show_in_default>
|
570 |
+
<show_in_website>1</show_in_website>
|
571 |
+
<show_in_store>1</show_in_store>
|
572 |
+
</disable>
|
573 |
+
</fields>
|
574 |
+
</basket>
|
575 |
+
<!--<order>
|
576 |
<label>Order</label>
|
577 |
<sort_order>150</sort_order>
|
578 |
<show_in_default>1</show_in_default>
|
614 |
</disable>
|
615 |
</fields>
|
616 |
</order>-->
|
617 |
+
<!--<other>
|
618 |
<label>Other</label>
|
619 |
<sort_order>160</sort_order>
|
620 |
<show_in_default>1</show_in_default>
|
656 |
</disable>
|
657 |
</fields>
|
658 |
</other>-->
|
659 |
+
</groups>
|
660 |
+
</peerius>
|
661 |
+
</sections>
|
662 |
+
</config>
|
app/design/adminhtml/default/default/template/smartrecs/config.phtml
CHANGED
@@ -22,18 +22,21 @@
|
|
22 |
|
23 |
function togglePeeriusSections(show) {
|
24 |
var sections = $$('.section-config');
|
|
|
25 |
var sectionCnt = sections.length;
|
26 |
if (!show)
|
27 |
{
|
28 |
for (i = 1; i < sectionCnt; i++) {
|
29 |
sections[i].hide();
|
30 |
}
|
|
|
31 |
}
|
32 |
else
|
33 |
{
|
34 |
for (i = 1; i < sectionCnt; i++) {
|
35 |
sections[i].show();
|
36 |
}
|
|
|
37 |
}
|
38 |
}
|
39 |
|
@@ -58,7 +61,8 @@ if (!Mage::registry('peerius_404')) {
|
|
58 |
media="all">
|
59 |
|
60 |
<div style="background: #e9eaeb none repeat scroll 0 0;box-shadow:0 0 50px 0 #fff inset">
|
61 |
-
<div class="navbar-inner"><a class="
|
|
|
62 |
<br style="clear:both"><br><p>
|
63 |
|
64 |
<?php if (Mage::getStoreConfig('peerius/general/registrationstatus') < 1) { ?>
|
22 |
|
23 |
function togglePeeriusSections(show) {
|
24 |
var sections = $$('.section-config');
|
25 |
+
var recsAsSKUsList = $$('#row_peerius_general_getrecsasskusonly');
|
26 |
var sectionCnt = sections.length;
|
27 |
if (!show)
|
28 |
{
|
29 |
for (i = 1; i < sectionCnt; i++) {
|
30 |
sections[i].hide();
|
31 |
}
|
32 |
+
recsAsSKUsList[0].hide();
|
33 |
}
|
34 |
else
|
35 |
{
|
36 |
for (i = 1; i < sectionCnt; i++) {
|
37 |
sections[i].show();
|
38 |
}
|
39 |
+
recsAsSKUsList[0].show();
|
40 |
}
|
41 |
}
|
42 |
|
61 |
media="all">
|
62 |
|
63 |
<div style="background: #e9eaeb none repeat scroll 0 0;box-shadow:0 0 50px 0 #fff inset">
|
64 |
+
<div class="navbar-inner"><a class="peeriusBrand" style="" href="https://www.peerius.com/">
|
65 |
+
<span class="peeriusBrandText">Peerius Connect Admin</span></a></div></div>
|
66 |
<br style="clear:both"><br><p>
|
67 |
|
68 |
<?php if (Mage::getStoreConfig('peerius/general/registrationstatus') < 1) { ?>
|
app/design/frontend/base/default/template/smartrecs/recs/basket.phtml
CHANGED
@@ -7,13 +7,16 @@ if ($this->getRequest()->getParam('recs')) {
|
|
7 |
for ($i = 0; $i < $num; $i++) {
|
8 |
$refCodeArr[] = $recs[$i]->refCode;
|
9 |
$idArr[] = $recs[$i]->id;
|
10 |
-
$
|
11 |
}
|
12 |
}
|
13 |
-
|
14 |
$title = $this->getRequest()->getParam('title') ?: $this->__('Recommended Products');
|
|
|
|
|
15 |
?>
|
16 |
-
<?php
|
|
|
|
|
17 |
<div class="block block-recommendations">
|
18 |
<div class="block-title">
|
19 |
<strong><span><?php echo $this->escapeHtml($title) ?></span></strong>
|
@@ -22,14 +25,10 @@ $title = $this->getRequest()->getParam('title') ?: $this->__('Recommended Produc
|
|
22 |
<ul class="peerius-products-grid">
|
23 |
<?php foreach($this->getItems() as $_item): ?>
|
24 |
<li class="peerius-item">
|
25 |
-
<a onClick="Peerius.smartRecsClick(<?php echo $
|
26 |
-
<h2 class="product-name"><p class="product-name"><a onClick="Peerius.smartRecsClick(<?php echo $
|
27 |
<div class="product-details">
|
28 |
-
</p>
|
29 |
<?php echo $this->getPriceHtml($_item, true, '-recommendations') ?>
|
30 |
-
<!--<?php if ($this->helper('wishlist')->isAllow()) : ?>
|
31 |
-
<a onClick="Peerius.smartRecsClick(<?php echo $refCode2id[$_item->getSku()]?>)" href="<?php echo $this->getAddToWishlistUrl($_item) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a>-->
|
32 |
-
<?php endif; ?>
|
33 |
</div>
|
34 |
</li>
|
35 |
<?php endforeach ?>
|
@@ -37,4 +36,47 @@ $title = $this->getRequest()->getParam('title') ?: $this->__('Recommended Produc
|
|
37 |
<script type="text/javascript">decorateList('block-recommendations', 'none-recursive')</script>
|
38 |
</div>
|
39 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
<?php endif ?>
|
7 |
for ($i = 0; $i < $num; $i++) {
|
8 |
$refCodeArr[] = $recs[$i]->refCode;
|
9 |
$idArr[] = $recs[$i]->id;
|
10 |
+
$clickId[$recs[$i]->refCode] = $recs[$i]->id;
|
11 |
}
|
12 |
}
|
|
|
13 |
$title = $this->getRequest()->getParam('title') ?: $this->__('Recommended Products');
|
14 |
+
$curSymbol = $this->getCurrencySymbol();
|
15 |
+
$curCode = $this->getCurrencyCode();
|
16 |
?>
|
17 |
+
<?php
|
18 |
+
/*Only Edit this block if you are rendering Peerius Recommendations after retrieving the product details from magento */
|
19 |
+
if($this->isRecContentRefCodeOnly()): ?>
|
20 |
<div class="block block-recommendations">
|
21 |
<div class="block-title">
|
22 |
<strong><span><?php echo $this->escapeHtml($title) ?></span></strong>
|
25 |
<ul class="peerius-products-grid">
|
26 |
<?php foreach($this->getItems() as $_item): ?>
|
27 |
<li class="peerius-item">
|
28 |
+
<a onClick="Peerius.smartRecsClick(<?php echo $clickId[$_item->getSku()]?>)" href="<?php echo $_item->getProductUrl() ?>" title="<?php echo $this->escapeHtml($_item->getName()) ?>" class="peerius-product-image"><img src="<?php echo $this->helper('catalog/image')->init($_item, 'thumbnail')->resize(135) ?>" width="135" height="135" alt="<?php echo $this->escapeHtml($_item->getName()) ?>" /></a>
|
29 |
+
<h2 class="product-name"><p class="product-name"><a onClick="Peerius.smartRecsClick(<?php echo $clickId[$_item->getSku()]?>)" href="<?php echo $_item->getProductUrl() ?>"><?php echo $this->escapeHtml($_item->getName()) ?></a></h2>
|
30 |
<div class="product-details">
|
|
|
31 |
<?php echo $this->getPriceHtml($_item, true, '-recommendations') ?>
|
|
|
|
|
|
|
32 |
</div>
|
33 |
</li>
|
34 |
<?php endforeach ?>
|
36 |
<script type="text/javascript">decorateList('block-recommendations', 'none-recursive')</script>
|
37 |
</div>
|
38 |
</div>
|
39 |
+
<?php
|
40 |
+
/*Only Edit this block if you are rendering all product details as sent by Peerius Recommendations .i.e., no Magento lookup done here */
|
41 |
+
else: ?>
|
42 |
+
<div class="block block-recommendations">
|
43 |
+
<div class="block-title">
|
44 |
+
<strong><span><?php echo $this->escapeHtml($title) ?></span></strong>
|
45 |
+
</div>
|
46 |
+
<div class="block-content">
|
47 |
+
<ul class="peerius-products-grid">
|
48 |
+
<?php $json_recs = json_decode($this->getRequest()->getParam('recs'));
|
49 |
+
$maxRecs = $this->getRequest()->getParam('max');
|
50 |
+
$ctr = 1;
|
51 |
+
foreach($json_recs as $_item): ?>
|
52 |
+
<?php $cId = $clickId[$_item->refCode]?>
|
53 |
+
<li class="peerius-item">
|
54 |
+
<a onClick="Peerius.smartRecsClick(<?php echo $cId?>)" href="<?php echo $_item->url ?>" title="<?php echo $this->escapeHtml($_item->title) ?>" class="peerius-product-image">
|
55 |
+
<img src="<?php echo $_item->img ?>" width="135" alt="<?php echo $this->escapeHtml($_item->title) ?>" />
|
56 |
+
</a>
|
57 |
+
<h2 class="product-name"><p class="product-name"><a onClick="Peerius.smartRecsClick(<?php echo $cId?>)" href="<?php echo $_item->url ?>"><?php echo $this->escapeHtml($_item->title) ?></a></h2>
|
58 |
+
<div class="product-details">
|
59 |
+
<div class="price-box">
|
60 |
+
<?php if($_item->prices->$curCode->unitPrice != $_item->prices->$curCode->salePrice): ?>
|
61 |
+
<p class="old-price">
|
62 |
+
<span class="price-label">Regular Price:</span>
|
63 |
+
<span class="price" id="old-price-<?php echo $cId?>"><?php echo $curSymbol.$_item->prices->$curCode->unitPrice ?></span>
|
64 |
+
</p>
|
65 |
+
<?php endif ?>
|
66 |
+
<p class="special-price">
|
67 |
+
<span class="price-label"><?php echo ($_item->prices->$curCode->unitPrice != $_item->prices->$curCode->salePrice ? 'Special ': '') ?>Price:</span>
|
68 |
+
<span class="price-including-tax">
|
69 |
+
<span class="label">Incl. Tax:</span>
|
70 |
+
<span class="price" id="price-including-tax-<?php echo $cId?>"><?php echo $curSymbol.$_item->prices->$curCode->salePrice ?></span>
|
71 |
+
</span>
|
72 |
+
</p>
|
73 |
+
</div>
|
74 |
+
</div>
|
75 |
+
</li>
|
76 |
+
<?php if($ctr++ == $maxRecs) break;
|
77 |
+
endforeach ?>
|
78 |
+
</ul>
|
79 |
+
<script type="text/javascript">decorateList('block-recommendations', 'none-recursive')</script>
|
80 |
+
</div>
|
81 |
+
</div>
|
82 |
<?php endif ?>
|
app/design/frontend/base/default/template/smartrecs/recs/category.phtml
CHANGED
@@ -7,13 +7,16 @@ if ($this->getRequest()->getParam('recs')) {
|
|
7 |
for ($i = 0; $i < $num; $i++) {
|
8 |
$refCodeArr[] = $recs[$i]->refCode;
|
9 |
$idArr[] = $recs[$i]->id;
|
10 |
-
$
|
11 |
}
|
12 |
}
|
13 |
-
|
14 |
$title = $this->getRequest()->getParam('title') ?: $this->__('Recommended Products');
|
|
|
|
|
15 |
?>
|
16 |
-
<?php
|
|
|
|
|
17 |
<div class="block block-recommendations">
|
18 |
<div class="block-title">
|
19 |
<strong><span><?php echo $this->escapeHtml($title) ?></span></strong>
|
@@ -22,14 +25,10 @@ $title = $this->getRequest()->getParam('title') ?: $this->__('Recommended Produc
|
|
22 |
<ul class="peerius-products-grid">
|
23 |
<?php foreach($this->getItems() as $_item): ?>
|
24 |
<li class="peerius-item">
|
25 |
-
<a onClick="Peerius.smartRecsClick(<?php echo $
|
26 |
-
<h2 class="product-name"><p class="product-name"><a onClick="Peerius.smartRecsClick(<?php echo $
|
27 |
<div class="product-details">
|
28 |
-
</p>
|
29 |
<?php echo $this->getPriceHtml($_item, true, '-recommendations') ?>
|
30 |
-
<!--<?php if ($this->helper('wishlist')->isAllow()) : ?>
|
31 |
-
<a onClick="Peerius.smartRecsClick(<?php echo $refCode2id[$_item->getSku()]?>)" href="<?php echo $this->getAddToWishlistUrl($_item) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a>-->
|
32 |
-
<?php endif; ?>
|
33 |
</div>
|
34 |
</li>
|
35 |
<?php endforeach ?>
|
@@ -37,4 +36,47 @@ $title = $this->getRequest()->getParam('title') ?: $this->__('Recommended Produc
|
|
37 |
<script type="text/javascript">decorateList('block-recommendations', 'none-recursive')</script>
|
38 |
</div>
|
39 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
<?php endif ?>
|
7 |
for ($i = 0; $i < $num; $i++) {
|
8 |
$refCodeArr[] = $recs[$i]->refCode;
|
9 |
$idArr[] = $recs[$i]->id;
|
10 |
+
$clickId[$recs[$i]->refCode] = $recs[$i]->id;
|
11 |
}
|
12 |
}
|
|
|
13 |
$title = $this->getRequest()->getParam('title') ?: $this->__('Recommended Products');
|
14 |
+
$curSymbol = $this->getCurrencySymbol();
|
15 |
+
$curCode = $this->getCurrencyCode();
|
16 |
?>
|
17 |
+
<?php
|
18 |
+
/*Only Edit this block if you are rendering Peerius Recommendations after retrieving the product details from magento */
|
19 |
+
if($this->isRecContentRefCodeOnly()): ?>
|
20 |
<div class="block block-recommendations">
|
21 |
<div class="block-title">
|
22 |
<strong><span><?php echo $this->escapeHtml($title) ?></span></strong>
|
25 |
<ul class="peerius-products-grid">
|
26 |
<?php foreach($this->getItems() as $_item): ?>
|
27 |
<li class="peerius-item">
|
28 |
+
<a onClick="Peerius.smartRecsClick(<?php echo $clickId[$_item->getSku()]?>)" href="<?php echo $_item->getProductUrl() ?>" title="<?php echo $this->escapeHtml($_item->getName()) ?>" class="peerius-product-image"><img src="<?php echo $this->helper('catalog/image')->init($_item, 'thumbnail')->resize(135) ?>" width="135" height="135" alt="<?php echo $this->escapeHtml($_item->getName()) ?>" /></a>
|
29 |
+
<h2 class="product-name"><p class="product-name"><a onClick="Peerius.smartRecsClick(<?php echo $clickId[$_item->getSku()]?>)" href="<?php echo $_item->getProductUrl() ?>"><?php echo $this->escapeHtml($_item->getName()) ?></a></h2>
|
30 |
<div class="product-details">
|
|
|
31 |
<?php echo $this->getPriceHtml($_item, true, '-recommendations') ?>
|
|
|
|
|
|
|
32 |
</div>
|
33 |
</li>
|
34 |
<?php endforeach ?>
|
36 |
<script type="text/javascript">decorateList('block-recommendations', 'none-recursive')</script>
|
37 |
</div>
|
38 |
</div>
|
39 |
+
<?php
|
40 |
+
/*Only Edit this block if you are rendering all product details as sent by Peerius Recommendations .i.e., no Magento lookup done here */
|
41 |
+
else: ?>
|
42 |
+
<div class="block block-recommendations">
|
43 |
+
<div class="block-title">
|
44 |
+
<strong><span><?php echo $this->escapeHtml($title) ?></span></strong>
|
45 |
+
</div>
|
46 |
+
<div class="block-content">
|
47 |
+
<ul class="peerius-products-grid">
|
48 |
+
<?php $json_recs = json_decode($this->getRequest()->getParam('recs'));
|
49 |
+
$maxRecs = $this->getRequest()->getParam('max');
|
50 |
+
$ctr = 1;
|
51 |
+
foreach($json_recs as $_item): ?>
|
52 |
+
<?php $cId = $clickId[$_item->refCode]?>
|
53 |
+
<li class="peerius-item">
|
54 |
+
<a onClick="Peerius.smartRecsClick(<?php echo $cId?>)" href="<?php echo $_item->url ?>" title="<?php echo $this->escapeHtml($_item->title) ?>" class="peerius-product-image">
|
55 |
+
<img src="<?php echo $_item->img ?>" width="135" alt="<?php echo $this->escapeHtml($_item->title) ?>" />
|
56 |
+
</a>
|
57 |
+
<h2 class="product-name"><p class="product-name"><a onClick="Peerius.smartRecsClick(<?php echo $cId?>)" href="<?php echo $_item->url ?>"><?php echo $this->escapeHtml($_item->title) ?></a></h2>
|
58 |
+
<div class="product-details">
|
59 |
+
<div class="price-box">
|
60 |
+
<?php if($_item->prices->$curCode->unitPrice != $_item->prices->$curCode->salePrice): ?>
|
61 |
+
<p class="old-price">
|
62 |
+
<span class="price-label">Regular Price:</span>
|
63 |
+
<span class="price" id="old-price-<?php echo $cId?>"><?php echo $curSymbol.$_item->prices->$curCode->unitPrice ?></span>
|
64 |
+
</p>
|
65 |
+
<?php endif ?>
|
66 |
+
<p class="special-price">
|
67 |
+
<span class="price-label"><?php echo ($_item->prices->$curCode->unitPrice != $_item->prices->$curCode->salePrice ? 'Special ': '') ?>Price:</span>
|
68 |
+
<span class="price-including-tax">
|
69 |
+
<span class="label">Incl. Tax:</span>
|
70 |
+
<span class="price" id="price-including-tax-<?php echo $cId?>"><?php echo $curSymbol.$_item->prices->$curCode->salePrice ?></span>
|
71 |
+
</span>
|
72 |
+
</p>
|
73 |
+
</div>
|
74 |
+
</div>
|
75 |
+
</li>
|
76 |
+
<?php if($ctr++ == $maxRecs) break;
|
77 |
+
endforeach ?>
|
78 |
+
</ul>
|
79 |
+
<script type="text/javascript">decorateList('block-recommendations', 'none-recursive')</script>
|
80 |
+
</div>
|
81 |
+
</div>
|
82 |
<?php endif ?>
|
app/design/frontend/base/default/template/smartrecs/recs/home.phtml
CHANGED
@@ -7,13 +7,16 @@ if ($this->getRequest()->getParam('recs')) {
|
|
7 |
for ($i = 0; $i < $num; $i++) {
|
8 |
$refCodeArr[] = $recs[$i]->refCode;
|
9 |
$idArr[] = $recs[$i]->id;
|
10 |
-
$
|
11 |
}
|
12 |
}
|
13 |
-
|
14 |
$title = $this->getRequest()->getParam('title') ?: $this->__('Recommended Products');
|
|
|
|
|
15 |
?>
|
16 |
-
<?php
|
|
|
|
|
17 |
<div class="block block-recommendations">
|
18 |
<div class="block-title">
|
19 |
<strong><span><?php echo $this->escapeHtml($title) ?></span></strong>
|
@@ -22,14 +25,10 @@ $title = $this->getRequest()->getParam('title') ?: $this->__('Recommended Produc
|
|
22 |
<ul class="peerius-products-grid">
|
23 |
<?php foreach($this->getItems() as $_item): ?>
|
24 |
<li class="peerius-item">
|
25 |
-
<a onClick="Peerius.smartRecsClick(<?php echo $
|
26 |
-
<h2 class="product-name"><p class="product-name"><a onClick="Peerius.smartRecsClick(<?php echo $
|
27 |
<div class="product-details">
|
28 |
-
</p>
|
29 |
<?php echo $this->getPriceHtml($_item, true, '-recommendations') ?>
|
30 |
-
<!--<?php if ($this->helper('wishlist')->isAllow()) : ?>
|
31 |
-
<a onClick="Peerius.smartRecsClick(<?php echo $refCode2id[$_item->getSku()]?>)" href="<?php echo $this->getAddToWishlistUrl($_item) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a>-->
|
32 |
-
<?php endif; ?>
|
33 |
</div>
|
34 |
</li>
|
35 |
<?php endforeach ?>
|
@@ -37,4 +36,47 @@ $title = $this->getRequest()->getParam('title') ?: $this->__('Recommended Produc
|
|
37 |
<script type="text/javascript">decorateList('block-recommendations', 'none-recursive')</script>
|
38 |
</div>
|
39 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
<?php endif ?>
|
7 |
for ($i = 0; $i < $num; $i++) {
|
8 |
$refCodeArr[] = $recs[$i]->refCode;
|
9 |
$idArr[] = $recs[$i]->id;
|
10 |
+
$clickId[$recs[$i]->refCode] = $recs[$i]->id;
|
11 |
}
|
12 |
}
|
|
|
13 |
$title = $this->getRequest()->getParam('title') ?: $this->__('Recommended Products');
|
14 |
+
$curSymbol = $this->getCurrencySymbol();
|
15 |
+
$curCode = $this->getCurrencyCode();
|
16 |
?>
|
17 |
+
<?php
|
18 |
+
/*Only Edit this block if you are rendering Peerius Recommendations after retrieving the product details from magento */
|
19 |
+
if($this->isRecContentRefCodeOnly()): ?>
|
20 |
<div class="block block-recommendations">
|
21 |
<div class="block-title">
|
22 |
<strong><span><?php echo $this->escapeHtml($title) ?></span></strong>
|
25 |
<ul class="peerius-products-grid">
|
26 |
<?php foreach($this->getItems() as $_item): ?>
|
27 |
<li class="peerius-item">
|
28 |
+
<a onClick="Peerius.smartRecsClick(<?php echo $clickId[$_item->getSku()]?>)" href="<?php echo $_item->getProductUrl() ?>" title="<?php echo $this->escapeHtml($_item->getName()) ?>" class="peerius-product-image"><img src="<?php echo $this->helper('catalog/image')->init($_item, 'thumbnail')->resize(135) ?>" width="135" height="135" alt="<?php echo $this->escapeHtml($_item->getName()) ?>" /></a>
|
29 |
+
<h2 class="product-name"><p class="product-name"><a onClick="Peerius.smartRecsClick(<?php echo $clickId[$_item->getSku()]?>)" href="<?php echo $_item->getProductUrl() ?>"><?php echo $this->escapeHtml($_item->getName()) ?></a></h2>
|
30 |
<div class="product-details">
|
|
|
31 |
<?php echo $this->getPriceHtml($_item, true, '-recommendations') ?>
|
|
|
|
|
|
|
32 |
</div>
|
33 |
</li>
|
34 |
<?php endforeach ?>
|
36 |
<script type="text/javascript">decorateList('block-recommendations', 'none-recursive')</script>
|
37 |
</div>
|
38 |
</div>
|
39 |
+
<?php
|
40 |
+
/*Only Edit this block if you are rendering all product details as sent by Peerius Recommendations .i.e., no Magento lookup done here */
|
41 |
+
else: ?>
|
42 |
+
<div class="block block-recommendations">
|
43 |
+
<div class="block-title">
|
44 |
+
<strong><span><?php echo $this->escapeHtml($title) ?></span></strong>
|
45 |
+
</div>
|
46 |
+
<div class="block-content">
|
47 |
+
<ul class="peerius-products-grid">
|
48 |
+
<?php $json_recs = json_decode($this->getRequest()->getParam('recs'));
|
49 |
+
$maxRecs = $this->getRequest()->getParam('max');
|
50 |
+
$ctr = 1;
|
51 |
+
foreach($json_recs as $_item): ?>
|
52 |
+
<?php $cId = $clickId[$_item->refCode]?>
|
53 |
+
<li class="peerius-item">
|
54 |
+
<a onClick="Peerius.smartRecsClick(<?php echo $cId?>)" href="<?php echo $_item->url ?>" title="<?php echo $this->escapeHtml($_item->title) ?>" class="peerius-product-image">
|
55 |
+
<img src="<?php echo $_item->img ?>" width="135" alt="<?php echo $this->escapeHtml($_item->title) ?>" />
|
56 |
+
</a>
|
57 |
+
<h2 class="product-name"><p class="product-name"><a onClick="Peerius.smartRecsClick(<?php echo $cId?>)" href="<?php echo $_item->url ?>"><?php echo $this->escapeHtml($_item->title) ?></a></h2>
|
58 |
+
<div class="product-details">
|
59 |
+
<div class="price-box">
|
60 |
+
<?php if($_item->prices->$curCode->unitPrice != $_item->prices->$curCode->salePrice): ?>
|
61 |
+
<p class="old-price">
|
62 |
+
<span class="price-label">Regular Price:</span>
|
63 |
+
<span class="price" id="old-price-<?php echo $cId?>"><?php echo $curSymbol.$_item->prices->$curCode->unitPrice ?></span>
|
64 |
+
</p>
|
65 |
+
<?php endif ?>
|
66 |
+
<p class="special-price">
|
67 |
+
<span class="price-label"><?php echo ($_item->prices->$curCode->unitPrice != $_item->prices->$curCode->salePrice ? 'Special ': '') ?>Price:</span>
|
68 |
+
<span class="price-including-tax">
|
69 |
+
<span class="label">Incl. Tax:</span>
|
70 |
+
<span class="price" id="price-including-tax-<?php echo $cId?>"><?php echo $curSymbol.$_item->prices->$curCode->salePrice ?></span>
|
71 |
+
</span>
|
72 |
+
</p>
|
73 |
+
</div>
|
74 |
+
</div>
|
75 |
+
</li>
|
76 |
+
<?php if($ctr++ == $maxRecs) break;
|
77 |
+
endforeach ?>
|
78 |
+
</ul>
|
79 |
+
<script type="text/javascript">decorateList('block-recommendations', 'none-recursive')</script>
|
80 |
+
</div>
|
81 |
+
</div>
|
82 |
<?php endif ?>
|
app/design/frontend/base/default/template/smartrecs/recs/product-1.phtml
CHANGED
@@ -7,13 +7,16 @@ if ($this->getRequest()->getParam('recs')) {
|
|
7 |
for ($i = 0; $i < $num; $i++) {
|
8 |
$refCodeArr[] = $recs[$i]->refCode;
|
9 |
$idArr[] = $recs[$i]->id;
|
10 |
-
$
|
11 |
}
|
12 |
}
|
13 |
-
|
14 |
$title = $this->getRequest()->getParam('title') ?: $this->__('Recommended Products');
|
|
|
|
|
15 |
?>
|
16 |
-
<?php
|
|
|
|
|
17 |
<div class="block block-recommendations">
|
18 |
<div class="block-title">
|
19 |
<strong><span><?php echo $this->escapeHtml($title) ?></span></strong>
|
@@ -22,14 +25,10 @@ $title = $this->getRequest()->getParam('title') ?: $this->__('Recommended Produc
|
|
22 |
<ul class="peerius-products-grid">
|
23 |
<?php foreach($this->getItems() as $_item): ?>
|
24 |
<li class="peerius-item">
|
25 |
-
<a onClick="Peerius.smartRecsClick(<?php echo $
|
26 |
-
<h2 class="product-name"><p class="product-name"><a onClick="Peerius.smartRecsClick(<?php echo $
|
27 |
<div class="product-details">
|
28 |
-
</p>
|
29 |
<?php echo $this->getPriceHtml($_item, true, '-recommendations') ?>
|
30 |
-
<!--<?php if ($this->helper('wishlist')->isAllow()) : ?>
|
31 |
-
<a onClick="Peerius.smartRecsClick(<?php echo $refCode2id[$_item->getSku()]?>)" href="<?php echo $this->getAddToWishlistUrl($_item) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a>-->
|
32 |
-
<?php endif; ?>
|
33 |
</div>
|
34 |
</li>
|
35 |
<?php endforeach ?>
|
@@ -37,4 +36,47 @@ $title = $this->getRequest()->getParam('title') ?: $this->__('Recommended Produc
|
|
37 |
<script type="text/javascript">decorateList('block-recommendations', 'none-recursive')</script>
|
38 |
</div>
|
39 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
<?php endif ?>
|
7 |
for ($i = 0; $i < $num; $i++) {
|
8 |
$refCodeArr[] = $recs[$i]->refCode;
|
9 |
$idArr[] = $recs[$i]->id;
|
10 |
+
$clickId[$recs[$i]->refCode] = $recs[$i]->id;
|
11 |
}
|
12 |
}
|
|
|
13 |
$title = $this->getRequest()->getParam('title') ?: $this->__('Recommended Products');
|
14 |
+
$curSymbol = $this->getCurrencySymbol();
|
15 |
+
$curCode = $this->getCurrencyCode();
|
16 |
?>
|
17 |
+
<?php
|
18 |
+
/*Only Edit this block if you are rendering Peerius Recommendations after retrieving the product details from magento */
|
19 |
+
if($this->isRecContentRefCodeOnly()): ?>
|
20 |
<div class="block block-recommendations">
|
21 |
<div class="block-title">
|
22 |
<strong><span><?php echo $this->escapeHtml($title) ?></span></strong>
|
25 |
<ul class="peerius-products-grid">
|
26 |
<?php foreach($this->getItems() as $_item): ?>
|
27 |
<li class="peerius-item">
|
28 |
+
<a onClick="Peerius.smartRecsClick(<?php echo $clickId[$_item->getSku()]?>)" href="<?php echo $_item->getProductUrl() ?>" title="<?php echo $this->escapeHtml($_item->getName()) ?>" class="peerius-product-image"><img src="<?php echo $this->helper('catalog/image')->init($_item, 'thumbnail')->resize(135) ?>" width="135" height="135" alt="<?php echo $this->escapeHtml($_item->getName()) ?>" /></a>
|
29 |
+
<h2 class="product-name"><p class="product-name"><a onClick="Peerius.smartRecsClick(<?php echo $clickId[$_item->getSku()]?>)" href="<?php echo $_item->getProductUrl() ?>"><?php echo $this->escapeHtml($_item->getName()) ?></a></h2>
|
30 |
<div class="product-details">
|
|
|
31 |
<?php echo $this->getPriceHtml($_item, true, '-recommendations') ?>
|
|
|
|
|
|
|
32 |
</div>
|
33 |
</li>
|
34 |
<?php endforeach ?>
|
36 |
<script type="text/javascript">decorateList('block-recommendations', 'none-recursive')</script>
|
37 |
</div>
|
38 |
</div>
|
39 |
+
<?php
|
40 |
+
/*Only Edit this block if you are rendering all product details as sent by Peerius Recommendations .i.e., no Magento lookup done here */
|
41 |
+
else: ?>
|
42 |
+
<div class="block block-recommendations">
|
43 |
+
<div class="block-title">
|
44 |
+
<strong><span><?php echo $this->escapeHtml($title) ?></span></strong>
|
45 |
+
</div>
|
46 |
+
<div class="block-content">
|
47 |
+
<ul class="peerius-products-grid">
|
48 |
+
<?php $json_recs = json_decode($this->getRequest()->getParam('recs'));
|
49 |
+
$maxRecs = $this->getRequest()->getParam('max');
|
50 |
+
$ctr = 1;
|
51 |
+
foreach($json_recs as $_item): ?>
|
52 |
+
<?php $cId = $clickId[$_item->refCode]?>
|
53 |
+
<li class="peerius-item">
|
54 |
+
<a onClick="Peerius.smartRecsClick(<?php echo $cId?>)" href="<?php echo $_item->url ?>" title="<?php echo $this->escapeHtml($_item->title) ?>" class="peerius-product-image">
|
55 |
+
<img src="<?php echo $_item->img ?>" width="135" alt="<?php echo $this->escapeHtml($_item->title) ?>" />
|
56 |
+
</a>
|
57 |
+
<h2 class="product-name"><p class="product-name"><a onClick="Peerius.smartRecsClick(<?php echo $cId?>)" href="<?php echo $_item->url ?>"><?php echo $this->escapeHtml($_item->title) ?></a></h2>
|
58 |
+
<div class="product-details">
|
59 |
+
<div class="price-box">
|
60 |
+
<?php if($_item->prices->$curCode->unitPrice != $_item->prices->$curCode->salePrice): ?>
|
61 |
+
<p class="old-price">
|
62 |
+
<span class="price-label">Regular Price:</span>
|
63 |
+
<span class="price" id="old-price-<?php echo $cId?>"><?php echo $curSymbol.$_item->prices->$curCode->unitPrice ?></span>
|
64 |
+
</p>
|
65 |
+
<?php endif ?>
|
66 |
+
<p class="special-price">
|
67 |
+
<span class="price-label"><?php echo ($_item->prices->$curCode->unitPrice != $_item->prices->$curCode->salePrice ? 'Special ': '') ?>Price:</span>
|
68 |
+
<span class="price-including-tax">
|
69 |
+
<span class="label">Incl. Tax:</span>
|
70 |
+
<span class="price" id="price-including-tax-<?php echo $cId?>"><?php echo $curSymbol.$_item->prices->$curCode->salePrice ?></span>
|
71 |
+
</span>
|
72 |
+
</p>
|
73 |
+
</div>
|
74 |
+
</div>
|
75 |
+
</li>
|
76 |
+
<?php if($ctr++ == $maxRecs) break;
|
77 |
+
endforeach ?>
|
78 |
+
</ul>
|
79 |
+
<script type="text/javascript">decorateList('block-recommendations', 'none-recursive')</script>
|
80 |
+
</div>
|
81 |
+
</div>
|
82 |
<?php endif ?>
|
app/design/frontend/base/default/template/smartrecs/recs/product-2.phtml
CHANGED
@@ -7,13 +7,16 @@ if ($this->getRequest()->getParam('recs')) {
|
|
7 |
for ($i = 0; $i < $num; $i++) {
|
8 |
$refCodeArr[] = $recs[$i]->refCode;
|
9 |
$idArr[] = $recs[$i]->id;
|
10 |
-
$
|
11 |
}
|
12 |
}
|
13 |
-
|
14 |
$title = $this->getRequest()->getParam('title') ?: $this->__('Recommended Products');
|
|
|
|
|
15 |
?>
|
16 |
-
<?php
|
|
|
|
|
17 |
<div class="block block-recommendations">
|
18 |
<div class="block-title">
|
19 |
<strong><span><?php echo $this->escapeHtml($title) ?></span></strong>
|
@@ -22,14 +25,10 @@ $title = $this->getRequest()->getParam('title') ?: $this->__('Recommended Produc
|
|
22 |
<ul class="peerius-products-grid">
|
23 |
<?php foreach($this->getItems() as $_item): ?>
|
24 |
<li class="peerius-item">
|
25 |
-
<a onClick="Peerius.smartRecsClick(<?php echo $
|
26 |
-
<h2 class="product-name"><p class="product-name"><a onClick="Peerius.smartRecsClick(<?php echo $
|
27 |
<div class="product-details">
|
28 |
-
</p>
|
29 |
<?php echo $this->getPriceHtml($_item, true, '-recommendations') ?>
|
30 |
-
<!--<?php if ($this->helper('wishlist')->isAllow()) : ?>
|
31 |
-
<a onClick="Peerius.smartRecsClick(<?php echo $refCode2id[$_item->getSku()]?>)" href="<?php echo $this->getAddToWishlistUrl($_item) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a>-->
|
32 |
-
<?php endif; ?>
|
33 |
</div>
|
34 |
</li>
|
35 |
<?php endforeach ?>
|
@@ -37,4 +36,47 @@ $title = $this->getRequest()->getParam('title') ?: $this->__('Recommended Produc
|
|
37 |
<script type="text/javascript">decorateList('block-recommendations', 'none-recursive')</script>
|
38 |
</div>
|
39 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
<?php endif ?>
|
7 |
for ($i = 0; $i < $num; $i++) {
|
8 |
$refCodeArr[] = $recs[$i]->refCode;
|
9 |
$idArr[] = $recs[$i]->id;
|
10 |
+
$clickId[$recs[$i]->refCode] = $recs[$i]->id;
|
11 |
}
|
12 |
}
|
|
|
13 |
$title = $this->getRequest()->getParam('title') ?: $this->__('Recommended Products');
|
14 |
+
$curSymbol = $this->getCurrencySymbol();
|
15 |
+
$curCode = $this->getCurrencyCode();
|
16 |
?>
|
17 |
+
<?php
|
18 |
+
/*Only Edit this block if you are rendering Peerius Recommendations after retrieving the product details from magento */
|
19 |
+
if($this->isRecContentRefCodeOnly()): ?>
|
20 |
<div class="block block-recommendations">
|
21 |
<div class="block-title">
|
22 |
<strong><span><?php echo $this->escapeHtml($title) ?></span></strong>
|
25 |
<ul class="peerius-products-grid">
|
26 |
<?php foreach($this->getItems() as $_item): ?>
|
27 |
<li class="peerius-item">
|
28 |
+
<a onClick="Peerius.smartRecsClick(<?php echo $clickId[$_item->getSku()]?>)" href="<?php echo $_item->getProductUrl() ?>" title="<?php echo $this->escapeHtml($_item->getName()) ?>" class="peerius-product-image"><img src="<?php echo $this->helper('catalog/image')->init($_item, 'thumbnail')->resize(135) ?>" width="135" height="135" alt="<?php echo $this->escapeHtml($_item->getName()) ?>" /></a>
|
29 |
+
<h2 class="product-name"><p class="product-name"><a onClick="Peerius.smartRecsClick(<?php echo $clickId[$_item->getSku()]?>)" href="<?php echo $_item->getProductUrl() ?>"><?php echo $this->escapeHtml($_item->getName()) ?></a></h2>
|
30 |
<div class="product-details">
|
|
|
31 |
<?php echo $this->getPriceHtml($_item, true, '-recommendations') ?>
|
|
|
|
|
|
|
32 |
</div>
|
33 |
</li>
|
34 |
<?php endforeach ?>
|
36 |
<script type="text/javascript">decorateList('block-recommendations', 'none-recursive')</script>
|
37 |
</div>
|
38 |
</div>
|
39 |
+
<?php
|
40 |
+
/*Only Edit this block if you are rendering all product details as sent by Peerius Recommendations .i.e., no Magento lookup done here */
|
41 |
+
else: ?>
|
42 |
+
<div class="block block-recommendations">
|
43 |
+
<div class="block-title">
|
44 |
+
<strong><span><?php echo $this->escapeHtml($title) ?></span></strong>
|
45 |
+
</div>
|
46 |
+
<div class="block-content">
|
47 |
+
<ul class="peerius-products-grid">
|
48 |
+
<?php $json_recs = json_decode($this->getRequest()->getParam('recs'));
|
49 |
+
$maxRecs = $this->getRequest()->getParam('max');
|
50 |
+
$ctr = 1;
|
51 |
+
foreach($json_recs as $_item): ?>
|
52 |
+
<?php $cId = $clickId[$_item->refCode]?>
|
53 |
+
<li class="peerius-item">
|
54 |
+
<a onClick="Peerius.smartRecsClick(<?php echo $cId?>)" href="<?php echo $_item->url ?>" title="<?php echo $this->escapeHtml($_item->title) ?>" class="peerius-product-image">
|
55 |
+
<img src="<?php echo $_item->img ?>" width="135" alt="<?php echo $this->escapeHtml($_item->title) ?>" />
|
56 |
+
</a>
|
57 |
+
<h2 class="product-name"><p class="product-name"><a onClick="Peerius.smartRecsClick(<?php echo $cId?>)" href="<?php echo $_item->url ?>"><?php echo $this->escapeHtml($_item->title) ?></a></h2>
|
58 |
+
<div class="product-details">
|
59 |
+
<div class="price-box">
|
60 |
+
<?php if($_item->prices->$curCode->unitPrice != $_item->prices->$curCode->salePrice): ?>
|
61 |
+
<p class="old-price">
|
62 |
+
<span class="price-label">Regular Price:</span>
|
63 |
+
<span class="price" id="old-price-<?php echo $cId?>"><?php echo $curSymbol.$_item->prices->$curCode->unitPrice ?></span>
|
64 |
+
</p>
|
65 |
+
<?php endif ?>
|
66 |
+
<p class="special-price">
|
67 |
+
<span class="price-label"><?php echo ($_item->prices->$curCode->unitPrice != $_item->prices->$curCode->salePrice ? 'Special ': '') ?>Price:</span>
|
68 |
+
<span class="price-including-tax">
|
69 |
+
<span class="label">Incl. Tax:</span>
|
70 |
+
<span class="price" id="price-including-tax-<?php echo $cId?>"><?php echo $curSymbol.$_item->prices->$curCode->salePrice ?></span>
|
71 |
+
</span>
|
72 |
+
</p>
|
73 |
+
</div>
|
74 |
+
</div>
|
75 |
+
</li>
|
76 |
+
<?php if($ctr++ == $maxRecs) break;
|
77 |
+
endforeach ?>
|
78 |
+
</ul>
|
79 |
+
<script type="text/javascript">decorateList('block-recommendations', 'none-recursive')</script>
|
80 |
+
</div>
|
81 |
+
</div>
|
82 |
<?php endif ?>
|
app/design/frontend/base/default/template/smartrecs/recs/search.phtml
CHANGED
@@ -7,13 +7,16 @@ if ($this->getRequest()->getParam('recs')) {
|
|
7 |
for ($i = 0; $i < $num; $i++) {
|
8 |
$refCodeArr[] = $recs[$i]->refCode;
|
9 |
$idArr[] = $recs[$i]->id;
|
10 |
-
$
|
11 |
}
|
12 |
}
|
13 |
-
|
14 |
$title = $this->getRequest()->getParam('title') ?: $this->__('Recommended Products');
|
|
|
|
|
15 |
?>
|
16 |
-
<?php
|
|
|
|
|
17 |
<div class="block block-recommendations">
|
18 |
<div class="block-title">
|
19 |
<strong><span><?php echo $this->escapeHtml($title) ?></span></strong>
|
@@ -22,14 +25,10 @@ $title = $this->getRequest()->getParam('title') ?: $this->__('Recommended Produc
|
|
22 |
<ul class="peerius-products-grid">
|
23 |
<?php foreach($this->getItems() as $_item): ?>
|
24 |
<li class="peerius-item">
|
25 |
-
<a onClick="Peerius.smartRecsClick(<?php echo $
|
26 |
-
<h2 class="product-name"><p class="product-name"><a onClick="Peerius.smartRecsClick(<?php echo $
|
27 |
<div class="product-details">
|
28 |
-
</p>
|
29 |
<?php echo $this->getPriceHtml($_item, true, '-recommendations') ?>
|
30 |
-
<!--<?php if ($this->helper('wishlist')->isAllow()) : ?>
|
31 |
-
<a onClick="Peerius.smartRecsClick(<?php echo $refCode2id[$_item->getSku()]?>)" href="<?php echo $this->getAddToWishlistUrl($_item) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a>-->
|
32 |
-
<?php endif; ?>
|
33 |
</div>
|
34 |
</li>
|
35 |
<?php endforeach ?>
|
@@ -37,4 +36,47 @@ $title = $this->getRequest()->getParam('title') ?: $this->__('Recommended Produc
|
|
37 |
<script type="text/javascript">decorateList('block-recommendations', 'none-recursive')</script>
|
38 |
</div>
|
39 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
<?php endif ?>
|
7 |
for ($i = 0; $i < $num; $i++) {
|
8 |
$refCodeArr[] = $recs[$i]->refCode;
|
9 |
$idArr[] = $recs[$i]->id;
|
10 |
+
$clickId[$recs[$i]->refCode] = $recs[$i]->id;
|
11 |
}
|
12 |
}
|
|
|
13 |
$title = $this->getRequest()->getParam('title') ?: $this->__('Recommended Products');
|
14 |
+
$curSymbol = $this->getCurrencySymbol();
|
15 |
+
$curCode = $this->getCurrencyCode();
|
16 |
?>
|
17 |
+
<?php
|
18 |
+
/*Only Edit this block if you are rendering Peerius Recommendations after retrieving the product details from magento */
|
19 |
+
if($this->isRecContentRefCodeOnly()): ?>
|
20 |
<div class="block block-recommendations">
|
21 |
<div class="block-title">
|
22 |
<strong><span><?php echo $this->escapeHtml($title) ?></span></strong>
|
25 |
<ul class="peerius-products-grid">
|
26 |
<?php foreach($this->getItems() as $_item): ?>
|
27 |
<li class="peerius-item">
|
28 |
+
<a onClick="Peerius.smartRecsClick(<?php echo $clickId[$_item->getSku()]?>)" href="<?php echo $_item->getProductUrl() ?>" title="<?php echo $this->escapeHtml($_item->getName()) ?>" class="peerius-product-image"><img src="<?php echo $this->helper('catalog/image')->init($_item, 'thumbnail')->resize(135) ?>" width="135" height="135" alt="<?php echo $this->escapeHtml($_item->getName()) ?>" /></a>
|
29 |
+
<h2 class="product-name"><p class="product-name"><a onClick="Peerius.smartRecsClick(<?php echo $clickId[$_item->getSku()]?>)" href="<?php echo $_item->getProductUrl() ?>"><?php echo $this->escapeHtml($_item->getName()) ?></a></h2>
|
30 |
<div class="product-details">
|
|
|
31 |
<?php echo $this->getPriceHtml($_item, true, '-recommendations') ?>
|
|
|
|
|
|
|
32 |
</div>
|
33 |
</li>
|
34 |
<?php endforeach ?>
|
36 |
<script type="text/javascript">decorateList('block-recommendations', 'none-recursive')</script>
|
37 |
</div>
|
38 |
</div>
|
39 |
+
<?php
|
40 |
+
/*Only Edit this block if you are rendering all product details as sent by Peerius Recommendations .i.e., no Magento lookup done here */
|
41 |
+
else: ?>
|
42 |
+
<div class="block block-recommendations">
|
43 |
+
<div class="block-title">
|
44 |
+
<strong><span><?php echo $this->escapeHtml($title) ?></span></strong>
|
45 |
+
</div>
|
46 |
+
<div class="block-content">
|
47 |
+
<ul class="peerius-products-grid">
|
48 |
+
<?php $json_recs = json_decode($this->getRequest()->getParam('recs'));
|
49 |
+
$maxRecs = $this->getRequest()->getParam('max');
|
50 |
+
$ctr = 1;
|
51 |
+
foreach($json_recs as $_item): ?>
|
52 |
+
<?php $cId = $clickId[$_item->refCode]?>
|
53 |
+
<li class="peerius-item">
|
54 |
+
<a onClick="Peerius.smartRecsClick(<?php echo $cId?>)" href="<?php echo $_item->url ?>" title="<?php echo $this->escapeHtml($_item->title) ?>" class="peerius-product-image">
|
55 |
+
<img src="<?php echo $_item->img ?>" width="135" alt="<?php echo $this->escapeHtml($_item->title) ?>" />
|
56 |
+
</a>
|
57 |
+
<h2 class="product-name"><p class="product-name"><a onClick="Peerius.smartRecsClick(<?php echo $cId?>)" href="<?php echo $_item->url ?>"><?php echo $this->escapeHtml($_item->title) ?></a></h2>
|
58 |
+
<div class="product-details">
|
59 |
+
<div class="price-box">
|
60 |
+
<?php if($_item->prices->$curCode->unitPrice != $_item->prices->$curCode->salePrice): ?>
|
61 |
+
<p class="old-price">
|
62 |
+
<span class="price-label">Regular Price:</span>
|
63 |
+
<span class="price" id="old-price-<?php echo $cId?>"><?php echo $curSymbol.$_item->prices->$curCode->unitPrice ?></span>
|
64 |
+
</p>
|
65 |
+
<?php endif ?>
|
66 |
+
<p class="special-price">
|
67 |
+
<span class="price-label"><?php echo ($_item->prices->$curCode->unitPrice != $_item->prices->$curCode->salePrice ? 'Special ': '') ?>Price:</span>
|
68 |
+
<span class="price-including-tax">
|
69 |
+
<span class="label">Incl. Tax:</span>
|
70 |
+
<span class="price" id="price-including-tax-<?php echo $cId?>"><?php echo $curSymbol.$_item->prices->$curCode->salePrice ?></span>
|
71 |
+
</span>
|
72 |
+
</p>
|
73 |
+
</div>
|
74 |
+
</div>
|
75 |
+
</li>
|
76 |
+
<?php if($ctr++ == $maxRecs) break;
|
77 |
+
endforeach ?>
|
78 |
+
</ul>
|
79 |
+
<script type="text/javascript">decorateList('block-recommendations', 'none-recursive')</script>
|
80 |
+
</div>
|
81 |
+
</div>
|
82 |
<?php endif ?>
|
app/design/frontend/base/default/template/smartrecs/render.phtml
CHANGED
@@ -1,13 +1,11 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* for the rendering
|
5 |
-
* @category Peerius
|
6 |
-
* @package Peerius_Smartrecs
|
7 |
-
* @author Peerius Ltd
|
8 |
-
*/
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* for the rendering
|
5 |
+
* @category Peerius
|
6 |
+
* @package Peerius_Smartrecs
|
7 |
+
* @author Peerius Ltd
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<!-- Peerius SMART-recs recommendations rendering -->
|
11 |
+
|
|
|
|
app/design/frontend/base/default/template/smartrecs/smartrecs.phtml
CHANGED
@@ -1,55 +1,57 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* for the tracking and rendering
|
5 |
-
* @category Peerius
|
6 |
-
* @package Peerius_Smartrecs
|
7 |
-
* @author Peerius Ltd
|
8 |
-
*/
|
9 |
-
|
10 |
-
?>
|
11 |
-
<!-- Peerius SMART-recs tracking and rendering -->
|
12 |
-
|
13 |
-
<?php
|
14 |
-
$renderActive = (file_exists(dirname(__FILE__).'/render.phtml')) ? true:false;
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
}
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
}
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
}
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
<?php
|
52 |
-
|
53 |
-
|
54 |
-
|
|
|
|
|
55 |
?>
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* for the tracking and rendering
|
5 |
+
* @category Peerius
|
6 |
+
* @package Peerius_Smartrecs
|
7 |
+
* @author Peerius Ltd
|
8 |
+
*/
|
9 |
+
|
10 |
+
?>
|
11 |
+
<!-- Peerius SMART-recs tracking and rendering [<?php echo $this->escapeHtml(Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB))?>]-->
|
12 |
+
|
13 |
+
<?php
|
14 |
+
$renderActive = (file_exists(dirname(__FILE__).'/render.phtml')) ? true:false;
|
15 |
+
|
16 |
+
$enableRecs = Mage::getStoreConfig('peerius/general/enableall') == 1 ? true : false;
|
17 |
+
|
18 |
+
if (Mage::helper('peerius_smartrecs')->isActive()) {
|
19 |
+
$trackingPixel = $this->getTrackingPixel();
|
20 |
+
if ($trackingPixel) {
|
21 |
+
?>
|
22 |
+
|
23 |
+
<script type="text/JavaScript" src="<?php echo $this->escapeHtml(Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB))?>js/peerius/smartrecs/smartrecs.js"></script>
|
24 |
+
<script type="text/JavaScript">
|
25 |
+
<?php if ($renderActive && $enableRecs): ?>
|
26 |
+
var peeriusPage = '<?php echo $this->escapeHtml(Mage::helper('peerius_smartrecs')->getPageType());?>';
|
27 |
+
var peeriusRecsDisabled = <?php echo $enableRecs ? 'false' : 'true'; ?>;
|
28 |
+
var peeriusDisabled = <?php echo Mage::helper('peerius_smartrecs')->getDisabled() ? 'true':'false';?>;
|
29 |
+
var renderRoute = '<?php echo $this->escapeHtml(Mage::getUrl('peerius/Render', array('_forced_secure' => $this->getRequest()->isSecure())))?>';
|
30 |
+
function parsePeeriusJson(jsonData) {
|
31 |
+
// render recommendations ...
|
32 |
+
if (!peeriusDisabled && !peeriusRecsDisabled) {
|
33 |
+
jsonData.forEach(function (widget) {
|
34 |
+
if (null !== $('peerius-smartrecs-'+widget.position)) {
|
35 |
+
renderRec(widget);
|
36 |
+
} else {
|
37 |
+
console.debug('div peerius-smartrecs-'+widget.position + ' not found');
|
38 |
+
}
|
39 |
+
});
|
40 |
+
}
|
41 |
+
}
|
42 |
+
<?php endif;?>
|
43 |
+
var PeeriusCallbacks={track:<?php echo $trackingPixel; ?>};
|
44 |
+
<?php if($enableRecs): ?>
|
45 |
+
PeeriusCallbacks.smartRecs = function(jsonData) {
|
46 |
+
parsePeeriusJson(jsonData);
|
47 |
+
}
|
48 |
+
<?php endif;?>
|
49 |
+
|
50 |
+
</script>
|
51 |
+
<?php }} ?>
|
52 |
+
|
53 |
+
<?php
|
54 |
+
if (Mage::helper('peerius_smartrecs')->isActive()) {
|
55 |
+
echo $this->getTrackingTag();
|
56 |
+
}
|
57 |
?>
|
package.xml
CHANGED
@@ -1,23 +1,191 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<package>
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |

|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
</description>
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
</
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>Peerius_Connect</name>
|
4 |
+
<version>1.0.9</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license uri="http://opensource.org/licenses/osl-3.0.php#sthash.1eAD3rgO.dpuf">OSL v3.0</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>The trusted partner for personalisation.</summary>
|
10 |
+
<description>The Peerius Connect extension allows you to add personalised product recommendations to your website. This extension performs the following key functions:
|
11 |

|
12 |
+
Creates a feed containing product and category information from your site catalogue.
|
13 |
+
Adds a tracking script that allows Peerius to track user behaviour on your site.
|
14 |
+
Renders recommendations that you enable on pre-configured pages.
|
15 |
+
</description>
|
16 |
+
<notes>New configuration option included to allow recommendation content to be returned with full product details including SKUs. The default setting will only allow recommendations to be sent as SKUs.</notes>
|
17 |
+
<authors>
|
18 |
+
<author>
|
19 |
+
<name>Peerius</name>
|
20 |
+
<user>Peerius</user>
|
21 |
+
<email>extensions@peerius.com</email>
|
22 |
+
</author>
|
23 |
+
</authors>
|
24 |
+
<date>2016-01-15</date>
|
25 |
+
<time>15:03:51</time>
|
26 |
+
<contents>
|
27 |
+
<target name="magecommunity">
|
28 |
+
<dir name="Peerius">
|
29 |
+
<dir name="Smartrecs">
|
30 |
+
<dir name="Block">
|
31 |
+
<file name="Config.php" hash="5d81508e9cf3061d6f34458bbdafff9b"/>
|
32 |
+
<file name="Recommendations.php" hash="cc8f955efbd6835d890b8efb864c0cac"/>
|
33 |
+
<file name="Template.php" hash="e9431386180c113cfa4660f8ce2c220b"/>
|
34 |
+
<file name="Tracking.php" hash="dc187f312b64fa7db93e34bf40291773"/>
|
35 |
+
</dir>
|
36 |
+
<dir name="Helper">
|
37 |
+
<file name="Data.php" hash="07a1c36598d89c28a5c9f902707cb02e"/>
|
38 |
+
<file name="Feedhelper.php" hash="5c981f753a3f139dd0798855ec2e51f4"/>
|
39 |
+
</dir>
|
40 |
+
<dir name="Model">
|
41 |
+
<dir name="Feed">
|
42 |
+
<file name="Creator.php" hash="41c2c55bc80a1291c49080cdd533d86b"/>
|
43 |
+
</dir>
|
44 |
+
<file name="Max.php" hash="a3c7eb408d59c3a0b71b9f5f8d85dfa9"/>
|
45 |
+
<file name="SearchLayer.php" hash="4457eb768fc387d08700d67b5e1bb55b"/>
|
46 |
+
<dir name="System">
|
47 |
+
<dir name="Config">
|
48 |
+
<dir name="Source">
|
49 |
+
<dir name="Dropdown">
|
50 |
+
<file name="Values.php" hash="bc71d86dcc6fdb046222c0a051b323b4"/>
|
51 |
+
</dir>
|
52 |
+
<file name="Yesno.php" hash="4f6cb1392c1496837cc6021cb263aad5"/>
|
53 |
+
</dir>
|
54 |
+
</dir>
|
55 |
+
</dir>
|
56 |
+
<dir name="Templates">
|
57 |
+
<file name="Basket.php" hash="96eb28e5977acd90ee8bf38f4e938274"/>
|
58 |
+
<file name="Category.php" hash="7882da9cd0026ed5bde0360189d593ae"/>
|
59 |
+
<file name="Checkout.php" hash="d46564549391af35da90a4a10c9a8093"/>
|
60 |
+
<file name="Home.php" hash="44a09df724298154d2f8671572c7f5ea"/>
|
61 |
+
<file name="Order.php" hash="3525a61a41f63c4133549254c31c842a"/>
|
62 |
+
<file name="Other.php" hash="2cb2c3d3de6d3155b5e33f1f3f8ade00"/>
|
63 |
+
<file name="Product1.php" hash="b3f3f27b3b319290f4ce7238b12e77d7"/>
|
64 |
+
<file name="Product2.php" hash="65170140bc75324cb0e216a9ba4f2597"/>
|
65 |
+
<file name="Search.php" hash="aa1e063656bd5b93a6ea1764dd317bd0"/>
|
66 |
+
<file name="Wishlist.php" hash="49daf0c47250b9512d285340c53af644"/>
|
67 |
+
</dir>
|
68 |
+
<file name="Templates.php" hash="b44ee8b39cf9d2166307ae6eb1500dc8"/>
|
69 |
+
<file name="Token.php" hash="2361e10a26b9beb9f066d6ad4827261c"/>
|
70 |
+
</dir>
|
71 |
+
<dir name="controllers">
|
72 |
+
<dir name="Adminhtml">
|
73 |
+
<file name="PeeriusController.php" hash="6d72ba380fa0ef6d618a97fc3124cdb7"/>
|
74 |
+
</dir>
|
75 |
+
<file name="FeedController.php" hash="7b21a1c6a9a8e27314d9b317f94a2e07"/>
|
76 |
+
<file name="InfoController.php" hash="915a4388f9cc72c917d6804ac38408c7"/>
|
77 |
+
<file name="RenderController.php" hash="e9f46140cb254a24ce9d21288ee9a250"/>
|
78 |
+
</dir>
|
79 |
+
<dir name="etc">
|
80 |
+
<file name="adminhtml.xml" hash="468dbed05f1cb0be9a4062c85e388e04"/>
|
81 |
+
<file name="config.xml" hash="e64216f70b3a67775c93966b412ffb13"/>
|
82 |
+
<file name="system.xml" hash="580dfd7e143413dc71f2ffc5f5f1de63"/>
|
83 |
+
<file name="system_ft.xml" hash="a42d9bf6de1df48c246057a4ef3c3a71"/>
|
84 |
+
<file name="widget.xml" hash="2a2a7c7097a33bb761c97d21c4d373f7"/>
|
85 |
+
</dir>
|
86 |
+
</dir>
|
87 |
+
</dir>
|
88 |
+
</target>
|
89 |
+
<target name="mageetc">
|
90 |
+
<dir name="modules">
|
91 |
+
<file name="Peerius_Smartrecs.xml" hash="e5c77ca4bb1474945191f4be23a0b390"/>
|
92 |
+
</dir>
|
93 |
+
</target>
|
94 |
+
<target name="mageweb">
|
95 |
+
<dir name="js">
|
96 |
+
<dir name="peerius">
|
97 |
+
<dir name="smartrecs">
|
98 |
+
<file name="smartrecs.js" hash="344e4abf974c5d834afbbd5ec22a6785"/>
|
99 |
+
</dir>
|
100 |
+
</dir>
|
101 |
+
</dir>
|
102 |
+
</target>
|
103 |
+
<target name="magedesign">
|
104 |
+
<dir name="frontend">
|
105 |
+
<dir name="base">
|
106 |
+
<dir name="default">
|
107 |
+
<dir name="template">
|
108 |
+
<dir name="smartrecs">
|
109 |
+
<file name="smartrecs.phtml" hash="eb191cbebb3729fe54294db5981e5a21"/>
|
110 |
+
<file name="render.phtml" hash="b508a2f71675d7a37b942cc41d2c5692"/>
|
111 |
+
<file name="render.phtml" hash="b508a2f71675d7a37b942cc41d2c5692"/>
|
112 |
+
<dir name="recs">
|
113 |
+
<file name="home.phtml" hash="9179ca699b638cc8fb6d9755b8f0ebe2"/>
|
114 |
+
<file name="category.phtml" hash="9179ca699b638cc8fb6d9755b8f0ebe2"/>
|
115 |
+
<file name="product-1.phtml" hash="9179ca699b638cc8fb6d9755b8f0ebe2"/>
|
116 |
+
<file name="product-2.phtml" hash="9179ca699b638cc8fb6d9755b8f0ebe2"/>
|
117 |
+
<file name="search.phtml" hash="9179ca699b638cc8fb6d9755b8f0ebe2"/>
|
118 |
+
<file name="basket.phtml" hash="9179ca699b638cc8fb6d9755b8f0ebe2"/>
|
119 |
+
</dir>
|
120 |
+
</dir>
|
121 |
+
</dir>
|
122 |
+
<dir name="layout">
|
123 |
+
<file name="smartrecs.xml" hash="f52a4fba91d0a70e676ea2b92c7814ba"/>
|
124 |
+
</dir>
|
125 |
+
</dir>
|
126 |
+
</dir>
|
127 |
+
</dir>
|
128 |
+
<dir name="adminhtml">
|
129 |
+
<dir name="default">
|
130 |
+
<dir name="default">
|
131 |
+
<dir name="layout">
|
132 |
+
<file name="smartrecs.xml" hash="b18cea41c87596b4a391060772d62036"/>
|
133 |
+
</dir>
|
134 |
+
<dir name="template">
|
135 |
+
<dir name="smartrecs">
|
136 |
+
<file name="config.phtml" hash="e1592ad4495ef3e6b9061e348b35ed1d"/>
|
137 |
+
<file name="aclreloadbutton.phtml" hash="5a1baf33dff410aeef3de6811d3c8777"/>
|
138 |
+
</dir>
|
139 |
+
</dir>
|
140 |
+
</dir>
|
141 |
+
</dir>
|
142 |
+
</dir>
|
143 |
+
</target>
|
144 |
+
<target name="mageskin">
|
145 |
+
<dir>
|
146 |
+
<dir name="adminhtml">
|
147 |
+
<dir name="default">
|
148 |
+
<dir name="default">
|
149 |
+
<dir name="peerius">
|
150 |
+
<dir name="smartrecs">
|
151 |
+
<dir>
|
152 |
+
<dir name="css">
|
153 |
+
<file name="config.css" hash="bc6e8f257e82345829fa4ab40cd6e73a"/>
|
154 |
+
</dir>
|
155 |
+
<dir name="img">
|
156 |
+
<file name="logo-hover.png" hash="d47a12d82bc3b271f343f590f7de260a"/>
|
157 |
+
<file name="logo.png" hash="02fb819ba8faf2b9df42345e6f71463c"/>
|
158 |
+
</dir>
|
159 |
+
<dir name="js">
|
160 |
+
<file name="smartrecs.js" hash="e9fc66f04761d7c0de868f031b592e50"/>
|
161 |
+
</dir>
|
162 |
+
</dir>
|
163 |
+
</dir>
|
164 |
+
</dir>
|
165 |
+
</dir>
|
166 |
+
</dir>
|
167 |
+
</dir>
|
168 |
+
</dir>
|
169 |
+
<dir name="frontend">
|
170 |
+
<dir name="base">
|
171 |
+
<dir name="default">
|
172 |
+
<dir name="css">
|
173 |
+
<dir name="peerius_smartrecs">
|
174 |
+
<file name="style.css" hash="54f4d88777c86d9b2951183e0323f026"/>
|
175 |
+
</dir>
|
176 |
+
</dir>
|
177 |
+
</dir>
|
178 |
+
</dir>
|
179 |
+
</dir>
|
180 |
+
</target>
|
181 |
+
</contents>
|
182 |
+
<compatible/>
|
183 |
+
<dependencies>
|
184 |
+
<required>
|
185 |
+
<php>
|
186 |
+
<min>5.3.0</min>
|
187 |
+
<max>6.0.0</max>
|
188 |
+
</php>
|
189 |
+
</required>
|
190 |
+
</dependencies>
|
191 |
+
</package>
|
skin/adminhtml/default/default/peerius/smartrecs/css/config.css
CHANGED
@@ -1,20 +1,38 @@
|
|
1 |
.navbar-inner {
|
2 |
-
background: transparent url("../img/navigation.png") repeat-
|
3 |
-
height:
|
|
|
|
|
4 |
}
|
5 |
|
6 |
-
.
|
7 |
-
background: transparent url("../img/logo
|
8 |
display:block;
|
9 |
-
|
10 |
-
height: 130px;
|
11 |
-
line-height: 0;
|
12 |
overflow: hidden;
|
13 |
padding: 0;
|
14 |
position: relative;
|
15 |
-
width:
|
16 |
z-index: 3;
|
17 |
-
margin-left:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
}
|
19 |
|
20 |
.container {
|
@@ -23,8 +41,9 @@
|
|
23 |
margin-right:auto;
|
24 |
}
|
25 |
|
26 |
-
a.
|
27 |
-
background
|
|
|
28 |
}
|
29 |
|
30 |
.content-header {
|
1 |
.navbar-inner {
|
2 |
+
/*background: transparent url("../img/navigation.png") repeat-none scroll 0 0px;*/
|
3 |
+
height:105px;
|
4 |
+
width: 500px;
|
5 |
+
float:left;
|
6 |
}
|
7 |
|
8 |
+
.peeriusBrand {
|
9 |
+
background: transparent url("../img/logo.png") no-repeat scroll 0 0px;
|
10 |
display:block;
|
11 |
+
height: 101px;
|
|
|
|
|
12 |
overflow: hidden;
|
13 |
padding: 0;
|
14 |
position: relative;
|
15 |
+
width: 500px;
|
16 |
z-index: 3;
|
17 |
+
margin-left: 0px;
|
18 |
+
float:left;
|
19 |
+
color:#52a746 ;
|
20 |
+
}
|
21 |
+
|
22 |
+
.peeriusBrandText {
|
23 |
+
display:in-line;
|
24 |
+
float:left;
|
25 |
+
font-size: 20px;
|
26 |
+
font-weight: bold;
|
27 |
+
height: 101px;
|
28 |
+
line-height: 101px;
|
29 |
+
overflow: hidden;
|
30 |
+
padding: 0;
|
31 |
+
position: relative;
|
32 |
+
width: 300px;
|
33 |
+
z-index: 4;
|
34 |
+
margin-left: 105px;
|
35 |
+
|
36 |
}
|
37 |
|
38 |
.container {
|
41 |
margin-right:auto;
|
42 |
}
|
43 |
|
44 |
+
a.peeriusBrand:hover {
|
45 |
+
background: transparent url("../img/logo-hover.png") no-repeat scroll 0 0px;
|
46 |
+
color: #000;
|
47 |
}
|
48 |
|
49 |
.content-header {
|
skin/adminhtml/default/default/peerius/smartrecs/img/logo-hover.png
ADDED
Binary file
|
skin/adminhtml/default/default/peerius/smartrecs/img/logo-rollover.png
DELETED
Binary file
|
skin/adminhtml/default/default/peerius/smartrecs/img/logo.png
ADDED
Binary file
|
skin/adminhtml/default/default/peerius/smartrecs/img/navigation.png
DELETED
Binary file
|