IREUS_Recommendation_Engine_Interface - Version 2.2.4

Version Notes

Log out and log in after install to get access to the configuration interface! You will find it in the menu [System -> Configuration -> IREUS Recommendation Engine]

Download this release

Release Info

Developer Magento Core Team
Extension IREUS_Recommendation_Engine_Interface
Version 2.2.4
Comparing to
See all releases


Version 2.2.4

app/code/community/Netresearch/Ireus/Block/Catalog/Product/List/Upsell.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * IREUS
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain the license through the world-wide-web,
11
+ * please send an email to support@ireus.net so we can send you a copy.
12
+ *
13
+ * DISCLAIMER
14
+ *
15
+ * Do not edit or add to this file if you wish to upgrade Ireus to newer
16
+ * versions in the future. If you wish to customize Ireus for your
17
+ * needs please refer to http://www.ireus.net for more information.
18
+ *
19
+ * @category IREUS Recommendation Engine
20
+ * @package Ireus
21
+ * @copyright Copyright (c) 2010 prudsys AG (http://www.prudsys.com)
22
+ * @author Stephan Hoyer, Germany
23
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
24
+ *
25
+ * $Id$
26
+ */
27
+
28
+
29
+ class Netresearch_Ireus_Block_Catalog_Product_List_Upsell
30
+ extends Mage_Catalog_Block_Product_List_Upsell
31
+ {
32
+ public function getItemCollection()
33
+ {
34
+ if (
35
+ Mage::getStoreConfig('ireus/settings/active') &&
36
+ Mage::getStoreConfig('ireus/settings/disable_magento_upsell')
37
+ ) {
38
+ return new Varien_Object();
39
+ }
40
+ return parent::getItemCollection();
41
+ }
42
+ }
app/code/community/Netresearch/Ireus/Block/Checkout/Multishipping/Success.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * IREUS
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain the license through the world-wide-web,
11
+ * please send an email to support@ireus.net so we can send you a copy.
12
+ *
13
+ * DISCLAIMER
14
+ *
15
+ * Do not edit or add to this file if you wish to upgrade Ireus to newer
16
+ * versions in the future. If you wish to customize Ireus for your
17
+ * needs please refer to http://www.ireus.net for more information.
18
+ *
19
+ * @category IREUS Recommendation Engine
20
+ * @package Ireus
21
+ * @copyright Copyright (c) 2010 prudsys AG (http://www.prudsys.com)
22
+ * @author Stephan Hoyer, Germany
23
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
24
+ *
25
+ * $Id$
26
+ */
27
+
28
+
29
+ class Netresearch_Ireus_Block_Checkout_Multishipping_Success extends Mage_Checkout_Block_Multishipping_Success
30
+ {
31
+ public function getOrderIds()
32
+ {
33
+ $ids = Mage::getSingleton('core/session')->getOrderIds(false);
34
+ if ($ids && is_array($ids)) {
35
+ return $ids;
36
+ return implode(', ', $ids);
37
+ }
38
+ return false;
39
+ }
40
+
41
+ public function getViewOrderUrl($orderId)
42
+ {
43
+ return $this->getUrl('sales/order/view/', array('order_id' => $orderId, '_secure' => true));
44
+ }
45
+
46
+ public function getContinueUrl()
47
+ {
48
+ return Mage::getBaseUrl();
49
+ }
50
+ }
app/code/community/Netresearch/Ireus/Block/Data.php ADDED
@@ -0,0 +1,407 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * IREUS
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain the license through the world-wide-web,
11
+ * please send an email to support@ireus.net so we can send you a copy.
12
+ *
13
+ * DISCLAIMER
14
+ *
15
+ * Do not edit or add to this file if you wish to upgrade Ireus to newer
16
+ * versions in the future. If you wish to customize Ireus for your
17
+ * needs please refer to http://www.ireus.net for more information.
18
+ *
19
+ * @category IREUS Recommendation Engine
20
+ * @package Ireus
21
+ * @copyright Copyright (c) 2010 prudsys AG (http://www.prudsys.com)
22
+ * @author Stephan Hoyer, Germany
23
+ * @author Silvio Steiger, Germany
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ *
26
+ * $Id$
27
+ */
28
+
29
+
30
+ // Register IREUS PHP Framework
31
+ require_once('IreusAutoloader.php');
32
+ IreusAutoloader::getInstance()->register();
33
+
34
+
35
+ class Netresearch_Ireus_Block_Data extends Mage_Core_Block_Template
36
+ {
37
+ var $isIreusCallActive;
38
+ var $lastIreusEvent;
39
+ var $latestAddedProduct;
40
+ var $latestOrder;
41
+ var $latestOrderedProducts;
42
+ var $latestMultishippingOrderIds;
43
+
44
+
45
+ /**
46
+ * returns current product id
47
+ *
48
+ * @return int
49
+ */
50
+ protected function getProductId()
51
+ {
52
+ return Mage::registry('product')->getId();
53
+ }
54
+
55
+
56
+ /**
57
+ * returns debug mode
58
+ *
59
+ * @return bool
60
+ */
61
+ protected function isDebugMode()
62
+ {
63
+ return Mage::getStoreConfig('ireus/settings/debug');
64
+ }
65
+
66
+
67
+ /**
68
+ * returns ireus-customer related Recommendation Engine ID
69
+ *
70
+ * @return string
71
+ */
72
+ protected function getEngineId()
73
+ {
74
+ return Mage::getStoreConfig('ireus/settings/re_id');
75
+ }
76
+
77
+
78
+ /**
79
+ * returns current session id
80
+ *
81
+ * @return string
82
+ */
83
+ protected function getSessionId()
84
+ {
85
+ return Mage::getSingleton("customer/session")->getSessionId();
86
+ }
87
+
88
+
89
+ /**
90
+ * returns current user id
91
+ *
92
+ * @return string
93
+ */
94
+ protected function getUserId()
95
+ {
96
+ return Mage::getSingleton("customer/session")->getCustomer()->getId();
97
+ }
98
+
99
+
100
+ /**
101
+ * returns current category id
102
+ *
103
+ * @return int
104
+ */
105
+ protected function getCategoryId()
106
+ {
107
+ return Mage::registry('current_category')->getId();
108
+ }
109
+
110
+
111
+ /**
112
+ * determines, whether it has been ordered something by current visitor
113
+ *
114
+ * @return bool
115
+ */
116
+ protected function hasRecentlyOrdered()
117
+ {
118
+ $this->latestMultishippingOrderIds = Mage::getSingleton('core/session')->getOrderIds(true);
119
+
120
+ //Multishipping
121
+ if(count($this->latestMultishippingOrderIds)) {
122
+ return true;
123
+ }
124
+
125
+ //OnePageCheckout
126
+ if(Mage::getSingleton('checkout/session')->getLastQuoteId()) {
127
+ return true;
128
+ }
129
+
130
+ return false;
131
+ }
132
+
133
+
134
+ /**
135
+ * returns last ordered quote
136
+ *
137
+ * @return Mage_Sales_Quote
138
+ */
139
+ protected function getLatestQuote()
140
+ {
141
+ if(!isset($this->latestQuote)) {
142
+ $this->latestQuote =
143
+ Mage::getModel('sales/quote')
144
+ ->load(Mage::getSingleton('checkout/session')->getLastQuoteId());
145
+ }
146
+ return $this->latestQuote;
147
+ }
148
+
149
+
150
+ /**
151
+ * returns an array of products and theirs ordered qtys like
152
+ *
153
+ * array(
154
+ * 'ids' => array(123, 321, 435),
155
+ * 'qtys'=> array(1,2,2)
156
+ * )
157
+ *
158
+ * @return array
159
+ */
160
+ protected function getLatestOrderedProducts()
161
+ {
162
+ if(!isset($this->latestOrderedProducts)) {
163
+ $ids = $qtys = array();
164
+ $items = array();
165
+ if(isset($this->latestMultishippingOrderIds)) {
166
+ foreach($this->latestMultishippingOrderIds as $orderId=>$orderNumber) {
167
+ $items = array_merge($items, Mage::getModel('sales/order')->load($orderId)->getAllItems());
168
+ }
169
+ }
170
+ else {
171
+ $items = $this->getLatestQuote()->getAllItems();
172
+ }
173
+ foreach($items as $item) {
174
+ $ids[] = $item->getProductId();
175
+ $qtys[] = !is_null($item->getQty()) ? $item->getQty() : $item->getQtyOrdered();
176
+ }
177
+ $this->latestOrderedProducts = array('ids' => $ids, 'qtys' => $qtys);
178
+ }
179
+ return $this->latestOrderedProducts;
180
+ }
181
+
182
+
183
+ /**
184
+ * returns array of last ordered product ids
185
+ *
186
+ * @return array
187
+ */
188
+ protected function getLatestOrderedProductIds()
189
+ {
190
+ $products = $this->getLatestOrderedProducts();
191
+ return $products['ids'];
192
+ }
193
+
194
+
195
+ /**
196
+ * returns array of last ordered product qtys
197
+ *
198
+ * @return array
199
+ */
200
+ protected function getLatestOrderedQtys()
201
+ {
202
+ $products = $this->getLatestOrderedProducts();
203
+ return $products['qtys'];
204
+ }
205
+
206
+
207
+ /**
208
+ * returns id of latest product added to cart
209
+ *
210
+ * @return int
211
+ */
212
+ protected function getLatestAddedProductId()
213
+ {
214
+ if(!isset($this->latestAddedProduct)) {
215
+ $this->latestAddedProduct = Mage::getSingleton('checkout/session')->getData('latestAddedProductsId');
216
+ Mage::getSingleton('checkout/session')->unsetData('latestAddedProductsId');
217
+ }
218
+ return $this->latestAddedProduct;
219
+ }
220
+
221
+
222
+ /**
223
+ * determines whether the current visitor has puted something to cart
224
+ *
225
+ * @return bool
226
+ */
227
+ protected function hasRecentlyAddedSomethingToCart()
228
+ {
229
+ if(!isset($this->latestAddedProduct)) {
230
+ $this->getLatestAddedProductId();
231
+ }
232
+ return isset($this->latestAddedProduct);
233
+ }
234
+
235
+
236
+ /**
237
+ * determines where Ireus should display something on the current page
238
+ *
239
+ * @return bool
240
+ */
241
+ protected function isActive()
242
+ {
243
+ if(!Mage::getStoreConfig('ireus/settings/active')) {
244
+ return false;
245
+ }
246
+
247
+ switch(Mage::app()->getRequest()->getControllerName())
248
+ {
249
+ case 'product': // show product
250
+ if ($this->getNameInLayout() == 'ireus_databasket'
251
+ && !$this->hasRecentlyAddedSomethingToCart()
252
+ ) {
253
+ return false;
254
+ }
255
+ else
256
+ {
257
+ return true;
258
+ }
259
+ case 'category': // show category
260
+ return true;
261
+ case 'cart': // added product to cart
262
+ if (Mage::app()->getRequest()->getActionName() !== 'index'
263
+ || (
264
+ $this->getNameInLayout() == 'ireus_databasket'
265
+ && !$this->hasRecentlyAddedSomethingToCart()
266
+ )
267
+ ) {
268
+ return false;
269
+ }
270
+ else
271
+ {
272
+ return true;
273
+ }
274
+ case 'multishipping': // order successfull
275
+ case 'onepage': // order successfull
276
+ if(
277
+ Mage::app()->getRequest()->getActionName() === 'success' &&
278
+ $this->hasRecentlyOrdered()
279
+ ) {
280
+ return true;
281
+ }
282
+ case 'index': // show homepage
283
+ if(
284
+ Mage::app()->getRequest()->getModuleName() === 'cms' &&
285
+ Mage::app()->getRequest()->getActionName() === 'index'
286
+ ) {
287
+ return true;
288
+ }
289
+ }
290
+ return false;
291
+ }
292
+
293
+
294
+ /**
295
+ * generates JSON data of parameters needed by Ireus
296
+ *
297
+ * @return string
298
+ */
299
+ protected function getJsonData()
300
+ {
301
+ if(!Mage::getStoreConfig('ireus/settings/active')) {
302
+ return "";
303
+ }
304
+
305
+ $return = array (
306
+ 'reid' => $this->getEngineId(),
307
+ 'sid' => $this->getSessionId(),
308
+ 'uid' => $this->getUserId()
309
+ );
310
+
311
+ if($this->isDebugMode()) {
312
+ $return['debug'] = 1;
313
+ }
314
+
315
+ switch(Mage::app()->getRequest()->getControllerName())
316
+ {
317
+ case 'product':
318
+ if ($this->getNameInLayout() == 'ireus_databasket'
319
+ && $this->hasRecentlyAddedSomethingToCart()
320
+ ) {
321
+ $return['pid'] = $this->getLatestAddedProductId();
322
+ $return['e'] = 'basket';
323
+ }
324
+ else
325
+ {
326
+ $return['pid'] = $this->getProductId();
327
+ $return['e'] = 'product';
328
+ }
329
+ break;
330
+ case 'category':
331
+ $return['cid'] = $this->getCategoryId();
332
+ $return['e'] = 'user';
333
+ break;
334
+ case 'index':
335
+ $return['cid'] = "";
336
+ $return['e'] = 'home';
337
+ break;
338
+ case 'cart':
339
+ if ($this->getNameInLayout() == 'ireus_databasket'
340
+ && $this->hasRecentlyAddedSomethingToCart()
341
+ ) {
342
+ $return['pid'] = $this->getLatestAddedProductId();
343
+ $return['e'] = 'basket';
344
+ }
345
+ else
346
+ {
347
+ $return['cid'] = "";
348
+ $return['e'] = 'home';
349
+ }
350
+ break;
351
+ case 'multishipping':
352
+ case 'onepage':
353
+ $return['pids'] = implode(',', $this->getLatestOrderedProductIds());
354
+ $return['qty'] = implode(',', $this->getLatestOrderedQtys());
355
+ $return['e'] = 'order';
356
+ break;
357
+ }
358
+ return Zend_Json::encode($return);
359
+ }
360
+
361
+
362
+ /**
363
+ * Gets cached data for noscript fallback
364
+ *
365
+ * @return string
366
+ */
367
+ protected function getCachedRecomms()
368
+ {
369
+ if(!Mage::getStoreConfig('ireus/settings/active')) {
370
+ return '';
371
+ }
372
+
373
+ $sidparam = Mage::getSingleton('core/session')->getSessionIdQueryParam();
374
+
375
+ switch(Mage::app()->getRequest()->getControllerName())
376
+ {
377
+ case 'product':
378
+ $event = 'product';
379
+ $id = $this->getProductId();
380
+ break;
381
+
382
+ case 'category':
383
+ $event = 'user';
384
+ $id = $this->getCategoryId();
385
+ break;
386
+
387
+ case 'index':
388
+ default:
389
+ $event = 'home';
390
+ $id = '';
391
+ break;
392
+ }
393
+
394
+ return Ireus_Controller_Cache::getContent(
395
+ $this->getEngineId(),
396
+ $this->getSessionId(),
397
+ $event,
398
+ $id,
399
+ Mage::getBaseDir('cache') . DIRECTORY_SEPARATOR . 'ireus',
400
+ array(
401
+ '&'.$sidparam.'=%SID%',
402
+ $sidparam.'=%SID%'
403
+ ),
404
+ 'UTF-8'
405
+ );
406
+ }
407
+ }
app/code/community/Netresearch/Ireus/Helper/Data.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * IREUS
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain the license through the world-wide-web,
11
+ * please send an email to support@ireus.net so we can send you a copy.
12
+ *
13
+ * DISCLAIMER
14
+ *
15
+ * Do not edit or add to this file if you wish to upgrade Ireus to newer
16
+ * versions in the future. If you wish to customize Ireus for your
17
+ * needs please refer to http://www.ireus.net for more information.
18
+ *
19
+ * @category IREUS Recommendation Engine
20
+ * @package Ireus
21
+ * @copyright Copyright (c) 2010 prudsys AG (http://www.prudsys.com)
22
+ * @author Silvio Steiger, Germany
23
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
24
+ *
25
+ * $Id$
26
+ */
27
+
28
+
29
+ class Netresearch_Ireus_Helper_Data extends Mage_Core_Helper_Abstract
30
+ {
31
+ }
app/code/community/Netresearch/Ireus/Model/Observer.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * IREUS
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain the license through the world-wide-web,
11
+ * please send an email to support@ireus.net so we can send you a copy.
12
+ *
13
+ * DISCLAIMER
14
+ *
15
+ * Do not edit or add to this file if you wish to upgrade Ireus to newer
16
+ * versions in the future. If you wish to customize Ireus for your
17
+ * needs please refer to http://www.ireus.net for more information.
18
+ *
19
+ * @category IREUS Recommendation Engine
20
+ * @package Ireus
21
+ * @copyright Copyright (c) 2010 prudsys AG (http://www.prudsys.com)
22
+ * @author Stephan Hoyer, Germany
23
+ * @author Silvio Steiger, Germany
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ *
26
+ * $Id$
27
+ */
28
+
29
+
30
+ class Netresearch_Ireus_Model_Observer
31
+ {
32
+ public function saveLatestAddedProduct($observer)
33
+ {
34
+ Mage::getSingleton('checkout/session')
35
+ ->setData('latestAddedProductsId', $observer['product']->getId());
36
+ return $this;
37
+ }
38
+ }
app/code/community/Netresearch/Ireus/controllers/ExportController.php ADDED
@@ -0,0 +1,380 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * IREUS
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain the license through the world-wide-web,
11
+ * please send an email to support@ireus.net so we can send you a copy.
12
+ *
13
+ * DISCLAIMER
14
+ *
15
+ * Do not edit or add to this file if you wish to upgrade Ireus to newer
16
+ * versions in the future. If you wish to customize Ireus for your
17
+ * needs please refer to http://www.ireus.net for more information.
18
+ *
19
+ * @category IREUS Recommendation Engine
20
+ * @package Ireus
21
+ * @copyright Copyright (c) 2010 prudsys AG (http://www.prudsys.com)
22
+ * @author Stephan Hoyer, Germany
23
+ * @author Silvio Steiger, Germany
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ *
26
+ * $Id$
27
+ */
28
+
29
+
30
+ // Register IREUS PHP Framework
31
+ require_once('IreusAutoloader.php');
32
+ IreusAutoloader::getInstance()->register();
33
+
34
+
35
+ class Netresearch_Ireus_ExportController extends Mage_Core_Controller_Front_Action
36
+ {
37
+ const CONFIG_SECURITY_CODE = 'ireus/settings/security_code';
38
+ const CONFIG_EXPORT_DISABLED_CATEGORIES = 'ireus/settings/export_disabled_categories';
39
+ const CONFIG_IMAGE_WIDTH = 'ireus/settings/image_width';
40
+ const CONFIG_IMAGE_HEIGHT = 'ireus/settings/image_height';
41
+ const PAGE_SIZE = 500;
42
+
43
+ var $_storeId ='admin';
44
+
45
+ var $_ordersColumns = array(
46
+ 'tid' => 'order_id',
47
+ 'pid' => 'product_id'
48
+ );
49
+
50
+ var $_productsColumns = array(
51
+ 'pid' => 'entity_id',
52
+ 'sku' => 'sku',
53
+ 'name' => 'name',
54
+ 'brand' => 'brand',
55
+ 'manufacturer' => 'manufacturer',
56
+ 'description' => 'short_description',
57
+ 'param1' => 'add_to_cart_url',
58
+ 'URL' => 'url',
59
+ 'imageURL' => 'images_url',
60
+ 'netUnitPrice' => 'price',
61
+ 'onlineFlag' => 'is_salable',
62
+ 'quantity' => 'qty',
63
+ 'strikeOutPrice' => 'special_price'
64
+ );
65
+
66
+ static $_sessionId;
67
+
68
+ static $_sessionIdQueryParam;
69
+
70
+ static $_ireusplaceholder = '%SID%';
71
+
72
+
73
+ /**
74
+ * Check security code and redirect to 404 if not given or wrong
75
+ *
76
+ * @return Netresearch_Ireus_ExportController
77
+ */
78
+ public function preDispatch()
79
+ {
80
+ parent::preDispatch();
81
+ $security_code = Mage::App()->getRequest()->getParam('code');
82
+ if(
83
+ is_null($security_code) or
84
+ $security_code != Mage::getStoreConfig(self::CONFIG_SECURITY_CODE)
85
+ ) {
86
+ $this->_redirect('noroute');
87
+ $this->setFlag('',self::FLAG_NO_DISPATCH,true);
88
+ }
89
+
90
+ if ($this->getRequest()->getParam('store')
91
+ ) {
92
+ $this->_setActiveStore($this->getRequest()->getParam('store'));
93
+ }
94
+
95
+ $this->_storeId = Mage::App()->getStore()->getCode();
96
+ self::$_sessionId = Mage::getSingleton('core/session')->getSessionId();
97
+ self::$_sessionIdQueryParam = Mage::getSingleton('core/session')->getSessionIdQueryParam();
98
+
99
+ return $this;
100
+ }
101
+
102
+
103
+ /**
104
+ * Output a CSV of all products with their
105
+ * categories and all parent categories,
106
+ *
107
+ * @return null
108
+ */
109
+ public function categoriesAction()
110
+ {
111
+ // Change maximum execution time
112
+ set_time_limit(0);
113
+
114
+ $product = Mage::getModel('catalog/product');
115
+
116
+ foreach(Mage::getModel('Catalog/Category')
117
+ ->getCollection()
118
+ ->addFieldToFilter('is_active', 1)
119
+ ->addFieldToFilter('level', array('gt' => 1))
120
+ ->addAttributeToSelect('name') as $category
121
+ ) {
122
+ if($category->getProductCount()
123
+ ) {
124
+ $productcategories = Mage::getModel('Catalog/Category')
125
+ ->getCollection()
126
+ ->addFieldToFilter('entity_id', array(
127
+ 'in' => $category->getPathIds()))
128
+ ->addAttributeToSelect('entity_id')
129
+ ->addAttributeToSelect('name');
130
+
131
+ $collection = $category->getProductCollection()
132
+ ->joinField('qty', 'cataloginventory/stock_item', '*',
133
+ 'product_id=entity_id', '{{table}}.stock_id=1', 'left')
134
+ ->addAttributeToFilter('status',
135
+ Mage_Catalog_Model_Product_Status::STATUS_ENABLED)
136
+ ->addAttributeToFilter('visibility', array('in'=>array(
137
+ Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH,
138
+ Mage_Catalog_Model_Product_Visibility::VISIBILITY_IN_CATALOG
139
+ )))
140
+ ->addAttributeToFilter('price', array('gt' => 0));
141
+
142
+ Mage::getSingleton('core/resource_iterator')
143
+ ->walk(
144
+ $collection->getSelect(),
145
+ array(
146
+ array(
147
+ $this,
148
+ 'callbackCategoriesAction'
149
+ )
150
+ ),
151
+ array(
152
+ 'product' => $product,
153
+ 'productcategories' => $productcategories
154
+ )
155
+ );
156
+ }
157
+ }
158
+
159
+ exit;
160
+ }
161
+
162
+
163
+ /**
164
+ * Callback function for the resource iterator of the categories Action
165
+ *
166
+ * @param array $args
167
+ * @return void
168
+ */
169
+ public function callbackCategoriesAction ($args)
170
+ {
171
+ $product = $args['product'];
172
+ $productcategories = $args['productcategories'];
173
+ $product->setData($args['row']);
174
+
175
+ $productsWithCategories = array();
176
+ $pid = $product->getId();
177
+ foreach ($productcategories as $currentcategory
178
+ ) {
179
+ $cid = $currentcategory->getId();
180
+ $productsWithCategories[$pid.$cid] = array(
181
+ 'pid' => $pid,
182
+ 'cid' => $cid,
183
+ 'cidparent' => $currentcategory->getParentId(),
184
+ 'cname' => $currentcategory->getName()
185
+ );
186
+ }
187
+
188
+ // Stream output product wise
189
+ echo Ireus_Controller_Export::getInstance()
190
+ ->createCategoriesCsv($productsWithCategories);
191
+ flush();
192
+ }
193
+
194
+
195
+ /**
196
+ * Output a CSV of all orders
197
+ *
198
+ * @return null
199
+ */
200
+ public function ordersAction()
201
+ {
202
+ // Change maximum execution time
203
+ set_time_limit(0);
204
+
205
+ echo Ireus_Controller_Export::getInstance()
206
+ ->setOrderColumns($this->_ordersColumns)
207
+ ->exportOrdersCsv(Mage::getModel('Sales/Order_Item')->getCollection()->getData());
208
+
209
+ exit;
210
+ }
211
+
212
+
213
+ /**
214
+ * Output a CSV of all products with their attributes
215
+ *
216
+ * @return null
217
+ */
218
+ public function productsAction()
219
+ {
220
+ // Change maximum execution time
221
+ set_time_limit(0);
222
+
223
+ // Prepare the prudsys IREUS Export Controller
224
+ Ireus_Controller_Export::getInstance()
225
+ ->setProductColumns($this->_productsColumns);
226
+
227
+ // Get products from database
228
+ $collection = Mage::getModel('Catalog/Product')
229
+ ->getCollection()
230
+ ->joinField('qty', 'cataloginventory/stock_item', '*',
231
+ 'product_id=entity_id', '{{table}}.stock_id=1', 'left')
232
+ ->addAttributeToFilter('status',
233
+ Mage_Catalog_Model_Product_Status::STATUS_ENABLED)
234
+ ->addAttributeToFilter('price', array('gt' => 0))
235
+ ->addAttributeToFilter(
236
+ 'visibility',
237
+ array(
238
+ 'in' => array(
239
+ Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH,
240
+ Mage_Catalog_Model_Product_Visibility::VISIBILITY_IN_CATALOG
241
+ )
242
+ )
243
+ )
244
+ ->addAttributeToSelect('small_image');
245
+ foreach($this->_productsColumns as $value
246
+ ) {
247
+ $collection->addAttributeToSelect($value);
248
+ }
249
+
250
+ // Walk through collection page wise
251
+ $countCollection = clone $collection;
252
+ $count = $countCollection->count();
253
+ unset ($countCollection);
254
+ $i=0;
255
+ do {
256
+ $i++;
257
+ $products = array();
258
+ $pageCollection = clone $collection;
259
+ $pageCollection->setPage($i, self::PAGE_SIZE);
260
+ foreach ($pageCollection as $product
261
+ ) {
262
+ $product_url = $product->getProductUrl();
263
+ $product->setManufacturer($product->getAttributeText('manufacturer'));
264
+ $product->setUrl(self::setSidPlaceholder($product_url));
265
+ $product->setImagesUrl(Mage::helper('Catalog/Image')
266
+ ->init($product,'small_image')
267
+ ->resize(
268
+ Mage::getStoreConfig(self::CONFIG_IMAGE_WIDTH),
269
+ Mage::getStoreConfig(self::CONFIG_IMAGE_HEIGHT)
270
+ )
271
+ ->__toString());
272
+ $product->setAddToCartUrl(self::getAddToCartUrl($product, $product_url));
273
+
274
+ // Stream result in parts of 10
275
+ $products[] = $product->getData();
276
+ if (count($products) > 9
277
+ ) {
278
+ echo Ireus_Controller_Export::getInstance()
279
+ ->createProductsCsv($products);
280
+ flush();
281
+ $products = array();
282
+ }
283
+ }
284
+
285
+ // Stream remaining items
286
+ if (count($products) > 0
287
+ ) {
288
+ echo Ireus_Controller_Export::getInstance()
289
+ ->createProductsCsv($products);
290
+ flush();
291
+ }
292
+
293
+ $count -= $pageCollection->count();
294
+
295
+ } while($count > 0);
296
+
297
+ // Delete cached recommendations
298
+ Ireus_Controller_Cache::deleteCache(Mage::getBaseDir('cache') . DIRECTORY_SEPARATOR . 'ireus');
299
+
300
+ exit;
301
+ }
302
+
303
+
304
+ /**
305
+ * Create "add this product to cart" url
306
+ *
307
+ * @param object $collection
308
+ * @param array $additional
309
+ * @return array
310
+ */
311
+ protected static function getAddToCartUrl($product, $product_url, $additional = array())
312
+ {
313
+ if ($product->getTypeInstance(true)->hasRequiredOptions($product)
314
+ ) {
315
+ $url = $product_url;
316
+ $link = (strpos($url, '?') !== false) ? '&' : '?';
317
+ $result = $url . $link . 'options=cart';
318
+ }
319
+ else
320
+ {
321
+ $result = Mage::helper('checkout/cart')->getAddUrl($product, $additional);
322
+ }
323
+
324
+ return self::setSidPlaceholder($result);
325
+ }
326
+
327
+
328
+ /**
329
+ * Sets SessionID placeholder in urls for dynamic SessionID adjustments done by IREUS
330
+ *
331
+ * @param string $url
332
+ * @return string
333
+ */
334
+ protected static function setSidPlaceholder ($url)
335
+ {
336
+ if (strpos($url, self::$_sessionId)
337
+ ) {
338
+ $url = str_replace(self::$_sessionId, self::$_ireusplaceholder, $url);
339
+ }
340
+ else
341
+ {
342
+ $url .= ((strpos($url, '?') !== false) ? '&' : '?')
343
+ . self::$_sessionIdQueryParam
344
+ . '='
345
+ . self::$_ireusplaceholder;
346
+ }
347
+
348
+ return $url;
349
+ }
350
+
351
+
352
+ /**
353
+ * Sets a different store if needed
354
+ *
355
+ * @param Mixed $storeCode can be either storeId or storeCode of store to set
356
+ * @return Mage_Core_Controller_Front_Action
357
+ */
358
+ protected function _setActiveStore($storeCode)
359
+ {
360
+ if (!$storeCode
361
+ ) {
362
+ $storeCode = $this->_storeCode;
363
+ }
364
+
365
+ // if storeId is used convert to storeCode
366
+ if (is_numeric($storeCode)) {
367
+ $storeCode = Mage::app()->getStore($storeCode)->getCode();
368
+ }
369
+
370
+ // if current store is ok return
371
+ if (Mage::app()->getStore()->getCode() == $storeCode) {
372
+ return $this;
373
+ }
374
+
375
+ // set active store
376
+ Mage::app()->setCurrentStore($storeCode);
377
+
378
+ return $this;
379
+ }
380
+ }
app/code/community/Netresearch/Ireus/etc/config.xml ADDED
@@ -0,0 +1,139 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * IREUS
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0).
9
+ * It is available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you are unable to obtain the license through the world-wide-web,
12
+ * please send an email to support@ireus.net so we can send you a copy.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade Ireus to newer
17
+ * versions in the future. If you wish to customize Ireus for your
18
+ * needs please refer to http://www.ireus.net for more information.
19
+ *
20
+ * @category IREUS Recommendation Engine
21
+ * @package Ireus
22
+ * @copyright Copyright (c) 2010 prudsys AG (http://www.prudsys.com)
23
+ * @author Stephan Hoyer, Germany
24
+ * @author Silvio Steiger, Germany
25
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
26
+ *
27
+ * $Id$
28
+ */
29
+ -->
30
+ <config>
31
+ <modules>
32
+ <Netresearch_Ireus>
33
+ <version>1.5.0.0</version>
34
+ </Netresearch_Ireus>
35
+ </modules>
36
+
37
+ <admin>
38
+ </admin>
39
+
40
+ <global>
41
+ <blocks>
42
+ <ireus><class>Netresearch_Ireus_Block</class></ireus>
43
+ <catalog>
44
+ <rewrite>
45
+ <product_list_upsell>Netresearch_Ireus_Block_Catalog_Product_List_Upsell</product_list_upsell>
46
+ </rewrite>
47
+ </catalog>
48
+ <checkout>
49
+ <rewrite>
50
+ <multishipping_success>Netresearch_Ireus_Block_Checkout_Multishipping_Success</multishipping_success>
51
+ </rewrite>
52
+ </checkout>
53
+ </blocks>
54
+ <models>
55
+ <ireus>
56
+ <class>Netresearch_Ireus_Model</class>
57
+ </ireus>
58
+ </models>
59
+ <helpers>
60
+ <ireus>
61
+ <class>Netresearch_Ireus_Helper</class>
62
+ </ireus>
63
+ </helpers>
64
+ </global>
65
+
66
+ <adminhtml>
67
+ <translate>
68
+ <modules>
69
+ <Netresearch_Ireus>
70
+ <files>
71
+ <default>Netresearch_Ireus.csv</default>
72
+ </files>
73
+ </Netresearch_Ireus>
74
+ </modules>
75
+ </translate>
76
+ <acl>
77
+ <resources>
78
+ <all>
79
+ <title>Allow Everything</title>
80
+ </all>
81
+ <admin>
82
+ <children>
83
+ <system>
84
+ <children>
85
+ <config>
86
+ <children>
87
+ <ireus translate="title" module="ireus">
88
+ <title>IREUS Recommendation Engine</title>
89
+ <sort_order>50</sort_order>
90
+ </ireus>
91
+ </children>
92
+ </config>
93
+ </children>
94
+ </system>
95
+ </children>
96
+ </admin>
97
+ </resources>
98
+ </acl>
99
+ </adminhtml>
100
+
101
+ <frontend>
102
+ <routers>
103
+ <ireus>
104
+ <use>standard</use>
105
+ <args>
106
+ <module>Netresearch_Ireus</module>
107
+ <frontName>ireus</frontName>
108
+ </args>
109
+ </ireus>
110
+ </routers>
111
+ <translate>
112
+ <modules>
113
+ <Netresearch_Ireus>
114
+ <files>
115
+ <default>Netresearch_Ireus.csv</default>
116
+ </files>
117
+ </Netresearch_Ireus>
118
+ </modules>
119
+ </translate>
120
+ <layout>
121
+ <updates>
122
+ <ireus>
123
+ <file>ireus.xml</file>
124
+ </ireus>
125
+ </updates>
126
+ </layout>
127
+ <events>
128
+ <checkout_cart_add_product_complete>
129
+ <observers>
130
+ <ireus>
131
+ <type>singleton</type>
132
+ <class>ireus/observer</class>
133
+ <method>saveLatestAddedProduct</method>
134
+ </ireus>
135
+ </observers>
136
+ </checkout_cart_add_product_complete>
137
+ </events>
138
+ </frontend>
139
+ </config>
app/code/community/Netresearch/Ireus/etc/system.xml ADDED
@@ -0,0 +1,277 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * IREUS
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0).
9
+ * It is available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you are unable to obtain the license through the world-wide-web,
12
+ * please send an email to support@ireus.net so we can send you a copy.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade Ireus to newer
17
+ * versions in the future. If you wish to customize Ireus for your
18
+ * needs please refer to http://www.ireus.net for more information.
19
+ *
20
+ * @category IREUS Recommendation Engine
21
+ * @package Ireus
22
+ * @copyright Copyright (c) 2010 prudsys AG (http://www.prudsys.com)
23
+ * @author Stephan Hoyer, Germany
24
+ * @author Silvio Steiger, Germany
25
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
26
+ *
27
+ * $Id$
28
+ */
29
+ -->
30
+ <config>
31
+ <sections>
32
+ <ireus translate="label" model="ireus">
33
+ <label>IREUS Recommendation Engine</label>
34
+ <tab>catalog</tab>
35
+ <frontend_type>text</frontend_type>
36
+ <sort_order>70</sort_order>
37
+ <show_in_default>1</show_in_default>
38
+ <show_in_website>1</show_in_website>
39
+ <show_in_store>1</show_in_store>
40
+ <groups>
41
+ <settings translate="label comment">
42
+ <label>Basic Settings</label>
43
+ <frontend_type>text</frontend_type>
44
+ <sort_order>100</sort_order>
45
+ <show_in_default>1</show_in_default>
46
+ <show_in_website>1</show_in_website>
47
+ <show_in_store>1</show_in_store>
48
+ <fields>
49
+ <active translate="label comment">
50
+ <label>Activate IREUS connector:</label>
51
+ <frontend_type>select</frontend_type>
52
+ <comment><![CDATA[For the use of IREUS you also need to activate your IREUS Recommendation Engine on <a href="http://www.ireus.net/rp/setLanguage.do?ref=index.do&locale=en" target="_blank">www.ireus.net</a>.]]></comment>
53
+ <source_model>adminhtml/system_config_source_yesno</source_model>
54
+ <sort_order>100</sort_order>
55
+ <show_in_default>1</show_in_default>
56
+ <show_in_website>1</show_in_website>
57
+ <show_in_store>1</show_in_store>
58
+ </active>
59
+ <re_id translate="label comment">
60
+ <label>Recommendation Engine ID:</label>
61
+ <frontend_type>text</frontend_type>
62
+ <comment><![CDATA[Get your own REID on <a href="http://www.ireus.net/rp/setLanguage.do?ref=registration.do&locale=en" target="_blank">www.ireus.net</a> for free.]]></comment>
63
+ <sort_order>200</sort_order>
64
+ <show_in_default>1</show_in_default>
65
+ <show_in_website>1</show_in_website>
66
+ <show_in_store>1</show_in_store>
67
+ </re_id>
68
+ <security_code translate="label comment">
69
+ <label>Security code:</label>
70
+ <frontend_type>text</frontend_type>
71
+ <comment>Enter an arbitrary key.</comment>
72
+ <sort_order>300</sort_order>
73
+ <show_in_default>1</show_in_default>
74
+ <show_in_website>1</show_in_website>
75
+ <show_in_store>1</show_in_store>
76
+ </security_code>
77
+ <image_width translate="label comment">
78
+ <label>Image width (pixel) *:</label>
79
+ <frontend_type>text</frontend_type>
80
+ <comment><![CDATA[Width of images shown in recommendations.<sup>*</sup>]]></comment>
81
+ <sort_order>400</sort_order>
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
+ </image_width>
86
+ <image_height translate="label comment">
87
+ <label>Image height (pixel) *:</label>
88
+ <frontend_type>text</frontend_type>
89
+ <comment><![CDATA[Height of images shown in recommendations.<sup>*</sup>]]></comment>
90
+ <sort_order>500</sort_order>
91
+ <show_in_default>1</show_in_default>
92
+ <show_in_website>1</show_in_website>
93
+ <show_in_store>1</show_in_store>
94
+ </image_height>
95
+ <disable_magento_upsell translate="label comment">
96
+ <label>Disable Magento Upsell:</label>
97
+ <frontend_type>select</frontend_type>
98
+ <source_model>adminhtml/system_config_source_yesno</source_model>
99
+ <sort_order>600</sort_order>
100
+ <show_in_default>1</show_in_default>
101
+ <show_in_website>1</show_in_website>
102
+ <show_in_store>1</show_in_store>
103
+ </disable_magento_upsell>
104
+ </fields>
105
+ <comment><![CDATA[<p style="font-size: 90%">Changes of settings maked with * will be effective first after rerun of your product data upload to IREUS. You may start the rerun manually in the IREUS customer area on <a href="http://www.ireus.net" target="_blank">www.ireus.net</a>.</p><br />]]></comment>
106
+ </settings>
107
+ <dataupload translate="label comment">
108
+ <label>Data Upload</label>
109
+ <comment>
110
+ <![CDATA[
111
+ <p>For the use of IREUS you need to upload your product catalogs data to your IREUS recommendation engine. You can do this as follows:<p>
112
+ <ol><li>Go to <a href="http://www.ireus.net/rp/setLanguage.do?ref=index.do&locale=en" target="_blank">www.ireus.net</a> and access the customer area.<li>
113
+ <li>Choose the button 'Product Data' and the option 'Http-Upload'.</li>
114
+ <li>Copy following URLs to the appropriate fields of the product upload page and the category upload page.
115
+ Replace <em>{{BaseUrl}}</em> by the base url of your Magento shop including hostname and the storecode if any
116
+ and replace <em>{{SecurityCode}}</em> by the Secutity code you entered above in the basic settings section.</li></ol>
117
+ <br>
118
+ <table>
119
+ <tr>
120
+ <td>
121
+ <label for="ireusproducts">Products: </label>
122
+ </td>
123
+ <td>
124
+ <input id="ireusproducts" type="text" size="90" class="editinput" name="ireusproducts" value="{{BaseUrl}}/ireus/export/products/code/{{SecurityCode}}" readonly>
125
+ </td>
126
+ </tr>
127
+ <tr>
128
+ <td>
129
+ <label for="ireuscategories">Categories: </label>
130
+ </td>
131
+ <td>
132
+ <input id="ireuscategories" type="text" size="90" class="editinput" name="ireuscategories" value="{{BaseUrl}}/ireus/export/categories/code/{{SecurityCode}}" readonly>
133
+ </td>
134
+ </tr>
135
+ </table>
136
+ ]]>
137
+ </comment>
138
+ <frontend_type>text</frontend_type>
139
+ <sort_order>200</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
+ </dataupload>
144
+ <transactions translate="label comment">
145
+ <label>Transaction Data</label>
146
+ <comment>
147
+ <![CDATA[
148
+ <p>Display recommendations immediatelly with uploading transaction data to your IREUS recommendation engine.
149
+ For downloading the needed CSV file open the following url in an internet browser after
150
+ replacing <em>{{BaseUrl}}</em> by the base url of your Magento shop including hostname and the storecode if any and
151
+ replacing <em>{{SecurityCode}}</em> by the Secutity code you entered above in the basic settings section.<p>
152
+ <p>This step is optional but recommended.</p>
153
+ <br>
154
+ <table>
155
+ <tr>
156
+ <td>
157
+ <label for="ireusorders">Orders: </label>
158
+ </td>
159
+ <td>
160
+ <input id="ireusorders" type="text" size="90" class="editinput" name="ireusorders" value="{{BaseUrl}}/ireus/export/orders/code/{{SecurityCode}}" readonly>
161
+ </td>
162
+ </tr>
163
+ </table>
164
+ ]]>
165
+ </comment>
166
+ <frontend_type>text</frontend_type>
167
+ <sort_order>300</sort_order>
168
+ <show_in_default>1</show_in_default>
169
+ <show_in_website>1</show_in_website>
170
+ <show_in_store>1</show_in_store>
171
+ </transactions>
172
+ <recommtemplates translate="label comment">
173
+ <label>Recommendation Templates</label>
174
+ <comment>
175
+ <![CDATA[
176
+ <p>You may create templates for your IREUS recommendations that fit to the design of your shop.
177
+ In the textbox below you find an example. Copy it and use it on the IREUS customer area -> designer -> own Html-Code.
178
+ There you may change these examples to your needs.</p>
179
+ <br>
180
+ <table>
181
+ <tr>
182
+ <td>
183
+ <label for="ireusrecommtemplate">Example template - product detail page:</label>
184
+
185
+ </td>
186
+ <td>
187
+ <textarea id="ireusrecommtemplate" name="ireusrecommtemplate" cols="90" rows="10" wrap="off" readonly="readonly">
188
+ #set ($locale = $conversion.toLocale("de_DE"))
189
+ #if($recommendations.size()>0)
190
+ <div class="box-collateral box-up-sell">
191
+ <h2>What other customers are interested in actually</h2>
192
+ <table cellspacing="0" id="upsell-product-table" class="products-grid">
193
+ <tbody>
194
+ <tr class="first last odd">
195
+ #foreach($recommendation in $recommendations)
196
+ <td>
197
+ <p class="product-image">
198
+ <a href="$recommendation.URL"><img alt="$recommendation.name" src="$recommendation.imageURL" /></a>
199
+ </p>
200
+ <h5><a href="$recommendation.URL">$recommendation.name</a></h5>
201
+ <div class="price-box">
202
+ <span id="product-price-25" class="regular-price"><span class="price">$number.format("currency", $recommendation.netUnitPrice, $locale)</span></span>
203
+ </div>
204
+ </td>
205
+ #end
206
+ </tr>
207
+ </tbody>
208
+ </table>
209
+ </div>
210
+ #end</textarea>
211
+ </td>
212
+ </tr>
213
+ <tr>
214
+ <td>
215
+ <label for="ireusrecommtemplate">Example template - start &amp; category pages:</label>
216
+
217
+ </td>
218
+ <td>
219
+ <textarea id="ireusrecommtemplate" name="ireusrecommtemplate" cols="90" rows="10" wrap="off" readonly="readonly">
220
+ #set ($locale = $conversion.toLocale("de_DE"))
221
+ #if($recommendations.size()>0)
222
+ <div class="block block-related">
223
+ <div class="block-title">
224
+ <strong><span>Choosen for you:</span></strong>
225
+ </div>
226
+ <div class="block-content">
227
+ <p class="block-subtitle">Items that might be of special interest for you:</p>
228
+ <ol class="mini-products-list" id="block-related">
229
+ #foreach($recommendation in $recommendations)
230
+ <li class="item odd">
231
+ <div class="product">
232
+ <a href="$recommendation.URL" title="$recommendation.name" class="product-image"><img src="$recommendation.imageURL" alt="$recommendation.name" height="50" width="50"></a>
233
+ <div class="product-details">
234
+ <p class="product-name"><a href="$recommendation.URL">$recommendation.name</a></p>
235
+ <div class="price-box">
236
+ <span class="regular-price" id="product-price-52-related">
237
+ <span class="price">$number.format("currency", $recommendation.netUnitPrice, $locale)</span>
238
+ </span>
239
+ </div>
240
+ <a href="$recommendation.param1" class="link-wishlist">Add to Wishlist</a>
241
+ </div>
242
+ </div>
243
+ </li>
244
+ #end
245
+ </ol>
246
+ </div>
247
+ </div>
248
+ #end</textarea>
249
+ </td>
250
+ </tr>
251
+
252
+ </table>
253
+ ]]>
254
+ </comment>
255
+ <frontend_type>text</frontend_type>
256
+ <sort_order>400</sort_order>
257
+ <show_in_default>1</show_in_default>
258
+ <show_in_website>1</show_in_website>
259
+ <show_in_store>1</show_in_store>
260
+ </recommtemplates>
261
+ <shoptemplates translate="label comment">
262
+ <label>Shop Template Integration</label>
263
+ <comment>
264
+ <![CDATA[
265
+ <p>Change the reference block names in the file ireus.xml for displaying IREUS recommendations in customized shop templates or for changing the position of the IREUS recommendations. You find this file in the folder: <em>/app/design/frontend/default/default/layout/</em>.</p>
266
+ ]]>
267
+ </comment>
268
+ <frontend_type>text</frontend_type>
269
+