YOOCHOOSE_Recommender_Engine - Version 2.0.0

Version Notes

Download this release

Release Info

Developer yoochoose
Extension YOOCHOOSE_Recommender_Engine
Version 2.0.0
Comparing to
See all releases


Code changes from version 1.4.6 to 2.0.0

Files changed (75) hide show
  1. app/code/community/AvS/Yoochoose/Block/Bestseller.php +0 -38
  2. app/code/community/AvS/Yoochoose/Block/Crosssell.php +0 -41
  3. app/code/community/AvS/Yoochoose/Block/Field/Readonly.php +0 -18
  4. app/code/community/AvS/Yoochoose/Block/Personal.php +0 -42
  5. app/code/community/AvS/Yoochoose/Block/Recoabstract.php +0 -310
  6. app/code/community/AvS/Yoochoose/Block/Related.php +0 -40
  7. app/code/community/AvS/Yoochoose/Block/Tracking.php +0 -100
  8. app/code/community/AvS/Yoochoose/Block/Upsell.php +0 -37
  9. app/code/community/AvS/Yoochoose/Helper/Data.php +0 -142
  10. app/code/community/AvS/Yoochoose/Model/Api.php +0 -52
  11. app/code/community/AvS/Yoochoose/Model/Api/Event.php +0 -239
  12. app/code/community/AvS/Yoochoose/Model/Api/Recommendation.php +0 -260
  13. app/code/community/AvS/Yoochoose/Model/Api/Recommendation/Bestseller.php +0 -32
  14. app/code/community/AvS/Yoochoose/Model/Api/Recommendation/Crossselling.php +0 -94
  15. app/code/community/AvS/Yoochoose/Model/Api/Recommendation/Personal.php +0 -32
  16. app/code/community/AvS/Yoochoose/Model/Api/Recommendation/Related.php +0 -38
  17. app/code/community/AvS/Yoochoose/Model/Api/Recommendation/Upselling.php +0 -40
  18. app/code/community/AvS/Yoochoose/Model/Observer.php +0 -103
  19. app/code/community/AvS/Yoochoose/Model/Source/Overwritten.php +0 -61
  20. app/code/community/AvS/Yoochoose/etc/config.xml +0 -176
  21. app/code/community/AvS/Yoochoose/etc/system.xml +0 -312
  22. app/code/community/Yoochoose/JsTracking/Block/Field/ConfigureAuth.php +52 -0
  23. app/code/community/Yoochoose/JsTracking/Block/Field/Customize.php +55 -0
  24. app/code/community/Yoochoose/JsTracking/Block/Field/Language.php +16 -0
  25. app/code/community/Yoochoose/JsTracking/Block/Field/Readonly.php +30 -0
  26. app/code/community/Yoochoose/JsTracking/Block/Field/Register.php +70 -0
  27. app/code/community/Yoochoose/JsTracking/Block/Head.php +177 -0
  28. app/code/community/Yoochoose/JsTracking/Helper/Data.php +59 -0
  29. app/code/community/{AvS/Yoochoose/Model/Source/Added.php → Yoochoose/JsTracking/Model/Adminhtml/Search/Catalog.php} +47 -57
  30. app/code/community/Yoochoose/JsTracking/Model/Api2/YCCategory.php +6 -0
  31. app/code/community/Yoochoose/JsTracking/Model/Api2/YCCategory/Rest/Admin/V1.php +49 -0
  32. app/code/community/Yoochoose/JsTracking/Model/Api2/YCProducts.php +7 -0
  33. app/code/community/Yoochoose/JsTracking/Model/Api2/YCProducts/Rest/Admin/V1.php +90 -0
  34. app/code/community/Yoochoose/JsTracking/Model/Api2/YCStoreView.php +6 -0
  35. app/code/community/Yoochoose/JsTracking/Model/Api2/YCStoreView/Rest/Admin/V1.php +42 -0
  36. app/code/community/Yoochoose/JsTracking/Model/Api2/YCSubscriber.php +6 -0
  37. app/code/community/Yoochoose/JsTracking/Model/Api2/YCSubscriber/Rest/Admin/V1.php +38 -0
  38. app/code/community/Yoochoose/JsTracking/Model/Observer.php +92 -0
  39. app/code/community/Yoochoose/JsTracking/Model/RequiredValidation.php +23 -0
  40. app/code/community/Yoochoose/JsTracking/Model/ScriptValidation.php +16 -0
  41. app/code/community/Yoochoose/JsTracking/Model/System/Config/Source/DisplayRecommendation.php +25 -0
  42. app/code/community/Yoochoose/JsTracking/Model/System/Config/Source/Languages.php +23 -0
  43. app/code/community/Yoochoose/JsTracking/Model/System/Config/Source/RenderSource.php +25 -0
  44. app/code/community/Yoochoose/JsTracking/controllers/Adminhtml/YoochooseController.php +143 -0
  45. app/code/community/Yoochoose/JsTracking/controllers/ProductsController.php +69 -0
  46. app/code/community/Yoochoose/JsTracking/controllers/ResultController.php +47 -0
  47. app/code/community/Yoochoose/JsTracking/etc/adminhtml.xml +26 -0
  48. app/code/community/Yoochoose/JsTracking/etc/api2.xml +98 -0
  49. app/code/community/Yoochoose/JsTracking/etc/config.xml +138 -0
  50. app/code/community/Yoochoose/JsTracking/etc/config.xml.orig +138 -0
  51. app/code/community/Yoochoose/JsTracking/etc/system.xml +391 -0
  52. app/design/adminhtml/base/default/template/yoochoose/system/config/configure_auth.phtml +34 -0
  53. app/design/adminhtml/base/default/template/yoochoose/system/config/customize.phtml +8 -0
  54. app/design/adminhtml/base/default/template/yoochoose/system/config/register.phtml +30 -0
  55. app/design/frontend/argento/pure/layout/yoochoose.xml +0 -83
  56. app/design/frontend/argento/pure/template/yoochoose/yoochoose_bestseller.phtml +0 -93
  57. app/design/frontend/argento/pure/template/yoochoose/yoochoose_personal.phtml +0 -93
  58. app/design/frontend/argento/pure/template/yoochoose/yoochoose_related.phtml +0 -109
  59. app/design/frontend/argento/pure/template/yoochoose/yoochoose_upsell.phtml +0 -111
  60. app/design/frontend/base/default/layout/yoochoose.xml +0 -64
  61. app/design/frontend/base/default/layout/yoochoose_jstracking.xml +35 -0
  62. app/design/frontend/base/default/template/yoochoose/head.phtml +4 -0
  63. app/design/frontend/base/default/template/yoochoose/tracking.phtml +0 -21
  64. app/design/frontend/default/default/layout/yoochoose.xml +0 -64
  65. app/design/frontend/default/default/template/yoochoose/new.phtml +0 -43
  66. app/design/frontend/galaeverbuy/default/layout/yoochoose.xml +0 -64
  67. app/design/frontend/galaeverbuy/default/template/yoochoose/list.phtml +0 -42
  68. app/design/frontend/rwd/default/layout/yoochoose.xml +0 -64
  69. app/design/frontend/rwd/default/template/yoochoose/list.phtml +0 -61
  70. app/design/frontend/smartwave/porto/layout/yoochoose.xml +0 -56
  71. app/design/frontend/smartwave/porto/template/yoochoose/list.phtml +0 -134
  72. app/etc/modules/AvS_Yoochoose.xml +0 -9
  73. app/etc/modules/Yoochoose_JsTracking.xml +10 -0
  74. app/locale/de_DE/AvS_Yoochoose.csv +0 -4
  75. package.xml +29 -156
app/code/community/AvS/Yoochoose/Block/Bestseller.php DELETED
@@ -1,38 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * @category AvS
5
- * @package AvS_Yoochoose
6
- * @author Andreas von Studnitz <avs@avs-webentwicklung.de>
7
- */
8
-
9
- class AvS_Yoochoose_Block_Bestseller extends AvS_Yoochoose_Block_Recoabstract {
10
-
11
-
12
- protected function isPreferManual() {
13
- return false;
14
- }
15
-
16
-
17
- protected function isYoochooseEnabled() {
18
- return Mage::getStoreConfig('yoochoose/bestseller/display_yoochoose_recommendations');
19
- }
20
-
21
-
22
- protected function getApi() {
23
- $api = Mage::getSingleton('yoochoose/api_recommendation_bestseller');
24
- return $api;
25
- }
26
-
27
-
28
- protected function oldHeaderKey() {
29
- return 'New Products';
30
- }
31
-
32
-
33
- protected function newHeaderKey() {
34
- return 'Best Sellers';
35
- }
36
-
37
-
38
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/AvS/Yoochoose/Block/Crosssell.php DELETED
@@ -1,41 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * @category AvS
5
- * @package AvS_Yoochoose
6
- * @author Andreas von Studnitz <avs@avs-webentwicklung.de>
7
- */
8
-
9
- class AvS_Yoochoose_Block_Crosssell extends AvS_Yoochoose_Block_Recoabstract {
10
-
11
-
12
- protected function isPreferManual() {
13
- return $this->display() == 2 || $this->display() == 3;
14
- }
15
-
16
-
17
- protected function isYoochooseEnabled() {
18
- return $this->display() == 1 || $this->display() == 2;
19
- }
20
-
21
-
22
- private function display() {
23
- return Mage::getStoreConfig('yoochoose/crossselling/display_yoochoose_recommendations');
24
- }
25
-
26
-
27
- protected function getApi() {
28
- $api = Mage::getSingleton('yoochoose/api_recommendation_crossselling');
29
- return $api;
30
- }
31
-
32
-
33
- public function getColumnCount() {
34
- return 1; // it is a column on the right or left of the webpage
35
- }
36
-
37
- protected function newHeaderKey() {
38
- return 'Also Purchased';
39
- }
40
-
41
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/AvS/Yoochoose/Block/Field/Readonly.php DELETED
@@ -1,18 +0,0 @@
1
- <?php
2
-
3
-
4
- /** A renderer for configuration fields.
5
- *
6
- * @author rodion.alukhanov
7
- */
8
- class AvS_Yoochoose_Block_Field_Readonly extends Mage_Adminhtml_Block_System_Config_Form_Field {
9
-
10
- protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element) {
11
-
12
- $element->setDisabled('disabled');
13
-
14
- return parent::_getElementHtml($element);
15
- }
16
- };
17
-
18
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/AvS/Yoochoose/Block/Personal.php DELETED
@@ -1,42 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * @category AvS
5
- * @package AvS_Yoochoose
6
- * @author Andreas von Studnitz <avs@avs-webentwicklung.de>
7
- */
8
-
9
- class AvS_Yoochoose_Block_Personal extends AvS_Yoochoose_Block_Recoabstract {
10
-
11
-
12
- protected function isPreferManual() {
13
- return $this->display() == 2 || $this->display() == 3;
14
- }
15
-
16
-
17
- protected function isYoochooseEnabled() {
18
- return $this->display() == 1 || $this->display() == 2;
19
- }
20
-
21
-
22
- private function display() {
23
- return Mage::getStoreConfig('yoochoose/personal/display_yoochoose_recommendations');
24
- }
25
-
26
-
27
- protected function getApi() {
28
- $api = Mage::getSingleton('yoochoose/api_recommendation_personal');
29
- return $api;
30
- }
31
-
32
-
33
- protected function oldHeaderKey() {
34
- return 'New Products';
35
- }
36
-
37
-
38
- protected function newHeaderKey() {
39
- return 'Recommendations for You';
40
- }
41
-
42
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/AvS/Yoochoose/Block/Recoabstract.php DELETED
@@ -1,310 +0,0 @@
1
- <?php
2
-
3
-
4
- class MagentoArray extends ArrayObject {
5
-
6
- public function __construct($data) {
7
- parent::__construct($data);
8
- }
9
-
10
- public function getSize() {
11
- return $this->count();
12
- }
13
- }
14
-
15
-
16
- class MagentoItemsCollection {
17
-
18
- private $data;
19
-
20
- public function __construct($data) {
21
- $this->data = $data;
22
- }
23
-
24
- public function getItems() {
25
- return new MagentoArray($this->data);
26
- }
27
-
28
- public function getSize() {
29
- return count($this->data);
30
- }
31
- }
32
-
33
-
34
- abstract class AvS_Yoochoose_Block_Recoabstract extends Mage_Catalog_Block_Product_Abstract {
35
-
36
- protected $_itemArrayManual = false;
37
- protected $_itemArrayYoochoose = false;
38
-
39
- protected $_itemArrayMerged = false;
40
-
41
-
42
- /**
43
- * Request Recommendations from Yoochoose Api and transform them to an array
44
- * of products
45
- *
46
- * @return array
47
- */
48
- public function getItemArray() {
49
- $api = $this->getApi();
50
-
51
- $columns = $this->getColumnCount();
52
-
53
- if ($this->_itemArrayMerged === false) {
54
- $this->_itemArrayMerged = $api->mergeItemArrays($this->getItemArrayManual(), $this->getItemArrayYoochoose(), $columns);
55
-
56
- $render = $this->generateRenderPixelObjects();
57
-
58
- $tracking_block = $this->getLayout()->getBlock('yoochoose.tracking');
59
-
60
- $data = $tracking_block->getData("render_urls");
61
-
62
- if (is_array($data)) {
63
- $data = array_merge($data, $render);
64
- } else {
65
- $data = $render;
66
- }
67
-
68
- $tracking_block->setData("render_urls", $data);
69
- }
70
- return $this->_itemArrayMerged;
71
- }
72
-
73
-
74
- /** Compatibility with native magento templates. */
75
- public function getItems() {
76
- return new MagentoArray($this->getItemArray());
77
- }
78
-
79
-
80
- /** Compatibility with native magento templates. */
81
- public function getItemCollection() {
82
- return new MagentoItemsCollection($this->getItemArray());
83
- }
84
-
85
-
86
- /** Compatibility with native magento templates. */
87
- public function getProductCollection() {
88
- return new MagentoItemsCollection($this->getItemArray());
89
- }
90
-
91
-
92
- /** Compatibility with native magento templates. */
93
- public function getItemCount() {
94
- return count($this->getItemArray());
95
- }
96
-
97
-
98
- /** Overwrite me, if you want to overwrite the block header
99
- */
100
- protected function oldHeaderKey() {
101
- return null;
102
- }
103
-
104
-
105
- /** Overwrite me, if you want to overwrite the block header
106
- */
107
- protected function newHeaderKey() {
108
- return null;
109
- }
110
-
111
-
112
- public function __() {
113
- $args = func_get_args();
114
- $oldKey = $this->oldHeaderKey();
115
-
116
- if ($oldKey && count($args) == 1 && $args[0] == $oldKey) {
117
- return parent::__($this->newHeaderKey());
118
- } else {
119
- if (version_compare(PHP_VERSION, '5.3.0') < 0) {
120
- return parent::__($args[0]);
121
- } else {
122
- return call_user_func_array('parent::__', $args);
123
- }
124
- }
125
- }
126
-
127
-
128
- // used in ULTIMO template
129
- public function getBlockName() {
130
- if ($this->newHeaderKey()) {
131
- return parent::__($this->newHeaderKey());
132
- } else {
133
- return parent::getBlockName();
134
- }
135
- }
136
-
137
-
138
- private $item_iterator = null;
139
-
140
- public function resetItemsIterator() {
141
- $this->item_iterator = $this->getItems();
142
- reset($this->item_iterator);
143
- }
144
-
145
-
146
- public function getIterableItem() {
147
- if ($this->item_iterator == null) {
148
- $this->resetItemsIterator();
149
- }
150
- $item = current($this->item_iterator);
151
- next($this->item_iterator);
152
- return $item;
153
- }
154
-
155
-
156
- public function getRowCount() {
157
- $api = $this->getApi();
158
-
159
- return $api->getRowCount();
160
- }
161
-
162
-
163
- private function getItemArrayYoochoose() {
164
- if ($this->_itemArrayYoochoose === false) {
165
-
166
- $api = $this->getApi();
167
- $manual = $this->getItemArrayManual();
168
- $isActive = Mage::helper('yoochoose')->isActive() && $this->isYoochooseEnabled();
169
-
170
- $columns = $this->getColumnCount();
171
-
172
- if ($isActive && count($manual) < $api->getMaxNumberProducts($columns)) {
173
- $this->_itemArrayYoochoose = $api->getRecommendedProducts($columns);
174
- } else {
175
- $this->_itemArrayYoochoose = array();
176
- }
177
- }
178
- return $this->_itemArrayYoochoose;
179
- }
180
-
181
-
182
- private function getItemArrayManual() {
183
- if ($this->_itemArrayManual === false) {
184
-
185
- $api = $this->getApi();
186
- $isActive = Mage::helper('yoochoose')->isActive();
187
-
188
- if ($this->isPreferManual() || ! $isActive) {
189
- $this->_itemArrayManual = $api->getManualItems();
190
- } else {
191
- $this->_itemArrayManual = array();
192
- }
193
- }
194
- return $this->_itemArrayManual;
195
- }
196
-
197
-
198
-
199
-
200
- private function idsToRender() {
201
- $final = $this->getItemArray();
202
- $yoo = $this->getItemArrayYoochoose();
203
-
204
- $follow = array();
205
-
206
- $api = $this->getApi();
207
-
208
- foreach ($yoo as $item) {
209
- if ($api->findProduct($final, $item->getEntityId())) {
210
- $follow[] = $item->getEntityId();
211
- }
212
- }
213
-
214
- if (empty($follow)) {
215
- Mage::log("No items to render. No pixel", Zend_Log::DEBUG, 'yoochoose.log');
216
- return null;
217
- }
218
-
219
- return $follow;
220
- }
221
-
222
-
223
- private function generateRenderPixelObjects() {
224
- $ids = $this->idsToRender();
225
-
226
- $api = $this->getApi();
227
- $eventlib = Mage::getSingleton('yoochoose/api_event');
228
-
229
- return $eventlib->getRenderedTrackingPixelData($ids, $api->getScenario());
230
- }
231
-
232
-
233
- /** Compatibility! Used in old yoochoose templates. */
234
- public function generateRenderPixelUrl() {
235
- return $this->renderPixelUrl($this->idsToRender());
236
- }
237
-
238
-
239
- /**
240
- * Generate String of primary params (as directories, divided by slash
241
- *
242
- * @param array $trackingPixelData
243
- * @return string
244
- */
245
- private function renderPixelUrl($itemIds) {
246
-
247
- $clientId = Mage::getStoreConfig('yoochoose/api/client_id');
248
-
249
- $api = $this->getApi();
250
-
251
- $userId = $api->getUserId();
252
- $itemType = $itemType = Mage::getStoreConfig('yoochoose/api/item_type');
253
-
254
- $baseUrl = Mage::getStoreConfig('yoochoose/api/tracker_server');
255
- $baseUrl = rtrim($baseUrl, "/");
256
-
257
- $result = $baseUrl.
258
- '/api/'.urlencode($clientId).
259
- '/'.AvS_Yoochoose_Model_Api::EVENT_TYPE_RENDER.
260
- '/'.urlencode($userId).
261
- '/'.$itemType.
262
- '/'.implode(",", $itemIds);
263
-
264
- Mage::log("Generating render tracking pixel: [$result]...", Zend_Log::DEBUG, 'yoochoose.log');
265
-
266
- return $result;
267
- }
268
-
269
-
270
- /**
271
- * Generate URL from given Params and Generic Data
272
- *
273
- * @param array $trackingPixelData
274
- * @return string
275
- */
276
- public function generateTrackingPixelUrl($trackingPixelData) {
277
- return Mage::getSingleton('yoochoose/api_event')->generateTrackingPixelUrl($trackingPixelData);
278
- }
279
-
280
-
281
- /** If manual set recommendations must be shown in the box */
282
- abstract protected function isPreferManual();
283
-
284
-
285
- /** If yoochoose recommendations must be shown in the box */
286
- abstract protected function isYoochooseEnabled();
287
-
288
-
289
- /** Instance of the Yoochoose API object. See in Model/Api/Recommendation */
290
- abstract protected function getApi();
291
-
292
-
293
- public function getProductUrl($product, $additional = array()) {
294
-
295
- $api = $this->getApi();
296
-
297
- // if product manually added, it does not create FOLLOW event.
298
- if ( ! $api->findProduct($this->getItemArrayManual(), $product->getEntityId())) {
299
- if (isset($additional['_query'])) {
300
- $query =& $additional['_query'];
301
- $query['recommended'] = $api->getScenario();
302
- } else {
303
- $additional['_query'] = array('recommended' => $api->getScenario());
304
- }
305
- }
306
-
307
- return parent::getProductUrl($product, $additional);
308
- }
309
-
310
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/AvS/Yoochoose/Block/Related.php DELETED
@@ -1,40 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * @category AvS
5
- * @package AvS_Yoochoose
6
- * @author Andreas von Studnitz <avs@avs-webentwicklung.de>
7
- */
8
- class AvS_Yoochoose_Block_Related extends AvS_Yoochoose_Block_Recoabstract {
9
-
10
-
11
- protected function isPreferManual() {
12
- return $this->display() == 2 || $this->display() == 3;
13
- }
14
-
15
-
16
- protected function isYoochooseEnabled() {
17
- return $this->display() == 1 || $this->display() == 2;
18
- }
19
-
20
-
21
- private function display() {
22
- return Mage::getStoreConfig('yoochoose/related/display_yoochoose_recommendations');
23
- }
24
-
25
-
26
- protected function getApi() {
27
- $api = Mage::getSingleton('yoochoose/api_recommendation_related');
28
- return $api;
29
- }
30
-
31
-
32
- public function getColumnCount() {
33
- return 1; // it is a column on the right or left of the webpage
34
- }
35
-
36
-
37
- protected function newHeaderKey() {
38
- return 'Related Products';
39
- }
40
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/AvS/Yoochoose/Block/Tracking.php DELETED
@@ -1,100 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * @category AvS
5
- * @package AvS_Yoochoose
6
- * @author Andreas von Studnitz <avs@avs-webentwicklung.de>
7
- */
8
- class AvS_Yoochoose_Block_Tracking extends Mage_Core_Block_Template {
9
-
10
- /**
11
- * Request object
12
- *
13
- * @var Zend_Controller_Request_Abstract
14
- */
15
- protected $_request;
16
-
17
- protected $_trackingPixelData = null;
18
-
19
- /**
20
- * Constructor
21
- */
22
- public function __construct() {
23
- $this->_request = Mage::app()->getRequest();
24
- }
25
-
26
-
27
- /**
28
- * Generate Yoochoose Tracking Pixel(s) Data depending on request
29
- *
30
- * @return array
31
- */
32
- public function getTrackingPixelData() {
33
- if (!is_array($this->_trackingPixelData)) {
34
-
35
- $this->_trackingPixelData = array();
36
-
37
- switch($this->_getFullActionName()) {
38
-
39
- case 'catalog_product_view':
40
-
41
- $isRecommended = $this->_getRequest()->getParam('recommended');
42
- $this->_trackingPixelData = Mage::getSingleton('yoochoose/api_event')->getProductViewTrackingPixelData($isRecommended);
43
- break;
44
-
45
- case 'checkout_onepage_success':
46
- case 'checkout_multishipping_success':
47
-
48
- $this->_trackingPixelData = Mage::getSingleton('yoochoose/api_event')->getCheckoutSuccessTrackingPixelData();
49
- break;
50
- }
51
-
52
- $render = $this->getData("render_urls");
53
-
54
- if (is_array($render)) {
55
- foreach ($render as $r) {
56
- $this->_trackingPixelData[] = $r;
57
- }
58
- }
59
- }
60
-
61
- return $this->_trackingPixelData;
62
- }
63
-
64
-
65
- /**
66
- * Generate URL from given Params and Generic Data
67
- *
68
- * @param array $trackingPixelData
69
- * @return string
70
- */
71
- public function generateTrackingPixelUrl($trackingPixelData) {
72
- return Mage::getSingleton('yoochoose/api_event')->generateTrackingPixelUrl($trackingPixelData);
73
- }
74
-
75
-
76
- /**
77
- * Retrieve full bane of current action current controller and
78
- * current module
79
- *
80
- * @param string $delimiter
81
- * @return string
82
- */
83
- protected function _getFullActionName($delimiter='_')
84
- {
85
- return $this->_getRequest()->getRequestedRouteName().$delimiter.
86
- $this->_getRequest()->getRequestedControllerName().$delimiter.
87
- $this->_getRequest()->getRequestedActionName();
88
- }
89
-
90
- /**
91
- * Retrieve request object
92
- *
93
- * @return Mage_Core_Controller_Request_Http
94
- */
95
- protected function _getRequest()
96
- {
97
- return $this->_request;
98
- }
99
-
100
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/AvS/Yoochoose/Block/Upsell.php DELETED
@@ -1,37 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * @category AvS
5
- * @package AvS_Yoochoose
6
- * @author Andreas von Studnitz <avs@avs-webentwicklung.de>
7
- */
8
-
9
- class AvS_Yoochoose_Block_Upsell extends AvS_Yoochoose_Block_Recoabstract {
10
-
11
-
12
- protected function isPreferManual() {
13
- return $this->display() == 2 || $this->display() == 3;
14
- }
15
-
16
-
17
- protected function isYoochooseEnabled() {
18
- return $this->display() == 1 || $this->display() == 2;
19
- }
20
-
21
-
22
- private function display() {
23
- return Mage::getStoreConfig('yoochoose/upselling/display_yoochoose_recommendations');
24
- }
25
-
26
-
27
- protected function getApi() {
28
- $api = Mage::getSingleton('yoochoose/api_recommendation_upselling');
29
- return $api;
30
- }
31
-
32
-
33
- protected function newHeaderKey() {
34
- return 'Also Purchased';
35
- }
36
-
37
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/AvS/Yoochoose/Helper/Data.php DELETED
@@ -1,142 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * @category AvS
5
- * @package AvS_Yoochoose
6
- * @author Andreas von Studnitz <avs@avs-webentwicklung.de>
7
- */
8
-
9
- class AvS_Yoochoose_Helper_Data extends Mage_Core_Helper_Abstract
10
- {
11
- const COOKIE_NAME = 'yoochoose_tracking';
12
-
13
- public function isActive()
14
- {
15
- return ! Mage::getStoreConfig('yoochoose/general/disabled');
16
- }
17
-
18
-
19
- /**
20
- * Get User Id from Cookie, Session or Customer Object (if logged in)
21
- */
22
- public function getUserId() {
23
-
24
- $session = Mage::getSingleton('customer/session');
25
-
26
- if ($session && $session->isLoggedIn()) {
27
- return $session->getId();
28
- }
29
-
30
- $coreSession = Mage::getSingleton("core/session");
31
-
32
- if ($coreSession && $coreSession->getSessionId()) {
33
- return $coreSession->getSessionId();
34
- }
35
- }
36
-
37
-
38
- /**
39
- * On Login: Update User ID which is stored in customer object and cookie
40
- */
41
- public function mergeUserIdOnLogin() {
42
-
43
- $session = Mage::getSingleton('customer/session');
44
-
45
- if ($session && $session->isLoggedIn()) {
46
- $coreSession = Mage::getSingleton("core/session");
47
-
48
- $anonymousId = $coreSession->getSessionId();
49
- $customerUserId = $session->getId();
50
-
51
- Mage::log('Transfering user ['.$anonymousId.'] to ['.$customerUserId.']...', Zend_Log::DEBUG, 'yoochoose.log');
52
-
53
- $baseUrl = Mage::getStoreConfig('yoochoose/api/tracker_server');
54
- $baseUrl = rtrim($baseUrl, "/");
55
-
56
- $clientId = Mage::getStoreConfig('yoochoose/api/client_id');
57
-
58
- $url = $baseUrl.'/api/'.$clientId.'/transfer/'.urlencode($anonymousId).'/'.urlencode($customerUserId);
59
-
60
- try {
61
- $this->_getHttpPage($url);
62
- } catch (Exception $e) {
63
- Mage::log('Error transfering user ['.$anonymousId.'] to ['.$customerUserId.']...', Zend_Log::ERR, 'yoochoose.log');
64
- Mage::logException($e);
65
- }
66
- }
67
- }
68
-
69
-
70
- public function _getHttpPage($host, $params = array(), $options = array()) {
71
-
72
- $url = $host.($params ? '?'.http_build_query($params) : '');
73
-
74
- $def_user = Mage::getStoreConfig('yoochoose/api/client_id');
75
- $def_pw = Mage::getStoreConfig('yoochoose/api/license_key');
76
-
77
- Mage::log('Requesting ['.$url.'] as ['.$def_user.']...', Zend_Log::DEBUG, 'yoochoose.log');
78
-
79
- $defaults = array(
80
- CURLOPT_URL => $url,
81
- CURLOPT_HEADER => 0,
82
- CURLOPT_RETURNTRANSFER => TRUE,
83
- CURLOPT_FOLLOWLOCATION => TRUE,
84
- CURLOPT_TIMEOUT => 2,
85
- CURLOPT_HTTPAUTH => CURLAUTH_BASIC,
86
- CURLOPT_USERPWD => "$def_user:$def_pw",
87
- CURLOPT_SSL_VERIFYPEER => FALSE,
88
- CURLOPT_FAILONERROR => TRUE
89
- );
90
-
91
- $ch = curl_init();
92
- $options = $options + $defaults; // numeric arrays. Do not use merge_arrays!
93
- curl_setopt_array($ch, $options);
94
- $result = curl_exec($ch);
95
-
96
- $eno = curl_errno($ch);
97
-
98
- if ($eno && $eno != 22) { // 22 = CURLE_HTTP_RETURNED_ERROR. PHP does not define this constant. Why?
99
- $msg = 'I/O error requesting ['.$host.']. Code: '.$eno.". ".curl_error($ch);
100
- throw new Non200xException($msg, 0, '');
101
- }
102
-
103
- $status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
104
-
105
- if (floor($status / 100) != 2) {
106
- $msg = 'Error requesting ['.$host.']. Status: '.$status.'.';
107
- throw new Non200xException($msg, $status, $result);
108
- }
109
-
110
- curl_close($ch);
111
-
112
- return $result;
113
- }
114
-
115
-
116
- /**
117
- * Generates Product URLs with "recommended" param
118
- *
119
- * @param Mage_Catalog_Model_Product $product
120
- * @return string
121
- */
122
- public function getProductUrl($product) {
123
- $params = array('_query' => array('recommended' => 1));
124
- return $product->getUrlModel()->getUrl($product, $params);
125
- }
126
- }
127
-
128
-
129
- class Non200xException extends Exception {
130
-
131
- private $body;
132
-
133
- public function __construct($message, $code = 0, $body = "", Exception $previous = null) {
134
- parent::__construct($message, $code, $previous);
135
-
136
- $this->body = $body;
137
- }
138
-
139
- public function getBody() {
140
- return $this->body;
141
- }
142
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/AvS/Yoochoose/Model/Api.php DELETED
@@ -1,52 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * @category AvS
5
- * @package AvS_Yoochoose
6
- * @author Andreas von Studnitz <avs@avs-webentwicklung.de>
7
- */
8
-
9
- class AvS_Yoochoose_Model_Api {
10
- const EVENT_TYPE_CLICK = 'click';
11
- const EVENT_TYPE_BUY = 'buy';
12
- const EVENT_TYPE_TRANSFER = 'transfer';
13
- const EVENT_TYPE_FOLLOW = 'follow';
14
- const EVENT_TYPE_RENDER = 'rendered';
15
-
16
-
17
-
18
- /**
19
- * Get User Id from Cookie, Session or Customer Object (if logged in)
20
- *
21
- * @return string
22
- */
23
- public function getUserId() {
24
- return Mage::helper('yoochoose')->getUserId();
25
- }
26
-
27
-
28
- /** @deprecated */
29
- protected function _getUserId() {
30
- return $this->getUserId();
31
- }
32
-
33
-
34
- /**
35
- * return category path like /cat1/cat2/cat3 of current item (category or product)
36
- */
37
- protected function _getCategoryPath() {
38
-
39
- $category = Mage::registry('current_category');
40
- if (!$category) return '';
41
-
42
- $store = Mage::app()->getStore();
43
-
44
- $category_url = $category->getUrlPath();
45
-
46
- $p = strrpos($category_url, ".", -1); // cutting ".html"
47
-
48
- $result = ($p === false) ? $category_url : substr($category_url, 0, $p);
49
-
50
- return $result;
51
- }
52
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/AvS/Yoochoose/Model/Api/Event.php DELETED
@@ -1,239 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * @category AvS
5
- * @package AvS_Yoochoose
6
- * @author Andreas von Studnitz <avs@avs-webentwicklung.de>
7
- */
8
-
9
- class AvS_Yoochoose_Model_Api_Event extends AvS_Yoochoose_Model_Api {
10
-
11
-
12
-
13
- public function getRenderedTrackingPixelData($ids = array(), $scenario = null) {
14
-
15
- $itemType = Mage::getStoreConfig('yoochoose/api/item_type');
16
- $result = array();
17
-
18
- if (! empty($ids)) {
19
- $trackingPixelData = array(
20
- 'ItemId' => implode(",", $ids),
21
- 'ItemTypeId' => $itemType,
22
- 'EventType' => self::EVENT_TYPE_RENDER,
23
- 'scenario' => $scenario
24
- );
25
- $result[] = $trackingPixelData;
26
- }
27
-
28
- return $result;
29
- }
30
-
31
-
32
- /**
33
- * On Product View Page: Generate Tracking Pixel Data
34
- *
35
- * @param boolean $isRecommended
36
- * @return array
37
- */
38
- public function getProductViewTrackingPixelData($isRecommended = null) {
39
-
40
- $itemType = Mage::getStoreConfig('yoochoose/api/item_type');
41
-
42
- $product = Mage::registry('product');
43
- $productId = $product->getId();
44
-
45
- $result = array();
46
-
47
- $trackingPixelData = array(
48
- 'ItemId' => $productId,
49
- 'ItemTypeId' => $itemType,
50
- 'EventType' => self::EVENT_TYPE_CLICK,
51
- 'categorypath' => $this->_getCategoryPath()
52
- );
53
-
54
- $result[] = $trackingPixelData;
55
-
56
- if ($isRecommended) {
57
- $trackingPixelData = array(
58
- 'ItemId' => $productId,
59
- 'ItemTypeId' => $itemType,
60
- 'EventType' => self::EVENT_TYPE_FOLLOW,
61
- 'scenario' => $isRecommended
62
- );
63
-
64
- $result[] = $trackingPixelData;
65
- }
66
-
67
- return $result;
68
- }
69
-
70
-
71
- /**
72
- * On Checkout Success Page: Generate Tracking Pixel Data, one for each item
73
- *
74
- * @return array
75
- */
76
- public function getCheckoutSuccessTrackingPixelData() {
77
-
78
- $orderId = Mage::getSingleton('checkout/session')->getLastOrderId();
79
- $order = Mage::getModel('sales/order')->load($orderId);
80
- $items = $order->getAllItems();
81
-
82
- $timestamp = time();
83
-
84
- $trackingPixelData = array();
85
-
86
- foreach($items as $item) {
87
-
88
- if ($item->getParentItem()) {
89
- continue;
90
- }
91
-
92
- $itemData = $this->_generateItemData($item, $timestamp);
93
- if ($itemData) {
94
- $trackingPixelData[] = $itemData;
95
- }
96
- }
97
-
98
- return $trackingPixelData;
99
- }
100
-
101
-
102
- /**
103
- * Generate order item data for tracking pixel
104
- *
105
- * @param Mage_Sales_Model_Order_Item $item
106
- * @param int $timestamp
107
- * @return array
108
- */
109
- protected function _generateItemData($item, $timestamp) {
110
-
111
- $itemType = Mage::getStoreConfig('yoochoose/api/item_type');
112
- $productId = $item->getProductId();
113
- $product = $item->getProduct();
114
-
115
- $visibility = $product->getVisibility();
116
-
117
- if ($visibility == Mage_Catalog_Model_Product_Visibility::VISIBILITY_NOT_VISIBLE) {
118
- Mage::log("Product [$productId] is not visible. A part of a configurable?", Zend_Log::DEBUG, 'yoochoose.log');
119
-
120
- $parentIds = Mage::getResourceSingleton('catalog/product_type_configurable')->getParentIdsByChild($product->getId());
121
- if (isset($parentIds[0])) {
122
- Mage::log("Product [$productId] is a child product of a configurable one. Parents: ".implode(",", $parentIds).". Using the first parent for tracking.", Zend_Log::DEBUG, 'yoochoose.log');
123
-
124
- $productId = $parentIds[0];
125
- } else {
126
- Mage::log("No paren found for [$productId]. Skipping...", Zend_Log::DEBUG, 'yoochoose.log');
127
- return null;
128
- }
129
- }
130
-
131
- $currency = $item->getOrder()->getBaseCurrency()->getCode();
132
-
133
- return array(
134
- 'ItemId' => $productId,
135
- 'ItemTypeId' => $itemType,
136
- 'EventType' => self::EVENT_TYPE_BUY,
137
- 'quantity' => intval($item->getQtyOrdered()),
138
- 'fullprice' => intval($item->getBasePrice()).$currency
139
- );
140
- }
141
-
142
-
143
- /**
144
- * Generate Url from given Params and Generic Data
145
- *
146
- * @param array $trackingPixelData
147
- * @return string
148
- */
149
- public function generateTrackingPixelUrl($trackingPixelData) {
150
-
151
- $baseUrl = Mage::getStoreConfig('yoochoose/api/tracker_server');
152
- $baseUrl = rtrim($baseUrl, "/");
153
-
154
- $primaryParams = $this->_getPrimaryParamsString($trackingPixelData);
155
- $secondaryParams = $this->_getSecondaryParamsString($trackingPixelData);
156
-
157
- $url = $baseUrl .'/api/'. $primaryParams . $secondaryParams;
158
-
159
- Mage::log("Generating tracking pixel: [$url]...", Zend_Log::DEBUG, 'yoochoose.log');
160
-
161
- return $url;
162
- }
163
-
164
-
165
- /**
166
- * Generate String of primary params (as directories, divided by slash
167
- *
168
- * @param array $trackingPixelData
169
- * @return string
170
- */
171
- protected function _getPrimaryParamsString($trackingPixelData) {
172
-
173
- $clientId = Mage::getStoreConfig('yoochoose/api/client_id');
174
- $eventType = $trackingPixelData['EventType'];
175
-
176
- $primaryAttributesArray = array(
177
- $clientId,
178
- $eventType,
179
- );
180
-
181
- if (isset($trackingPixelData['ItemTypeId']) && isset($trackingPixelData['ItemId'])) {
182
-
183
- $userId = $this->_getUserId();
184
- $itemType = $trackingPixelData['ItemTypeId'];
185
- $itemId = urlencode($trackingPixelData['ItemId']);
186
-
187
- $primaryAttributesArray[] = $userId;
188
- $primaryAttributesArray[] = $itemType;
189
- $primaryAttributesArray[] = $itemId;
190
- }
191
-
192
- $primaryAttributes = implode('/', $primaryAttributesArray);
193
-
194
- return $primaryAttributes;
195
- }
196
-
197
-
198
- /**
199
- * Generate String of secondary params (as default http params)
200
- *
201
- * @param array $trackingPixelData
202
- * @return string
203
- */
204
- protected function _getSecondaryParamsString($trackingPixelData) {
205
-
206
- $secondaryParams = $this->_getSecondaryParams($trackingPixelData);
207
-
208
- $params = array();
209
-
210
- foreach($secondaryParams as $key => $value) {
211
- if ($value !== '') {
212
- $params[$key] = $value;
213
- }
214
- }
215
- if (empty($params)) {
216
- return '';
217
- } else {
218
- return '?'.http_build_query($params);
219
- }
220
- }
221
-
222
-
223
- /**
224
- * Extract secondary params from all params; they are all params which have
225
- * not been used yet
226
- *
227
- * @param array $trackingPixelData
228
- * @return array
229
- */
230
- protected function _getSecondaryParams($trackingPixelData) {
231
- if (isset($trackingPixelData['EventType'])) unset($trackingPixelData['EventType']);
232
- unset($trackingPixelData['ItemTypeId']);
233
- unset($trackingPixelData['ItemId']);
234
- unset($trackingPixelData['userId']);
235
- unset($trackingPixelData['newUserId']);
236
-
237
- return $trackingPixelData;
238
- }
239
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/AvS/Yoochoose/Model/Api/Recommendation.php DELETED
@@ -1,260 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * @category AvS
5
- * @package AvS_Yoochoose
6
- * @author Andreas von Studnitz <avs@avs-webentwicklung.de>
7
- */
8
-
9
- abstract class AvS_Yoochoose_Model_Api_Recommendation extends AvS_Yoochoose_Model_Api {
10
-
11
- const SCENARIO_CROSS_SELLING = 'cross_selling';
12
- const SCENARIO_RELATED_PRODUCTS = 'related_products';
13
- const SCENARIO_UP_SELLING = 'up_selling';
14
-
15
-
16
-
17
- /**
18
- * Get Product Recommendations based on Client Id and License Key
19
- *
20
- * @param int $maxCount
21
- * @return array
22
- */
23
- public function getRecommendedProducts($columns) {
24
-
25
- $scenario = $this->getScenario();
26
- $maxCount = $this->getMaxNumberProducts($columns);
27
-
28
- $url = $this->_getRecommendationBaseUrl($scenario);
29
-
30
- $context = $this->getContext();
31
- $cat = $this->_getCategoryPath();
32
-
33
- $params = array();
34
-
35
- if ($context && ! empty($context)) {
36
- $params['contextitems'] = implode(',', $context);
37
- }
38
-
39
- if ($cat) {
40
- $params['categorypath'] = $cat;
41
- } else if ($context && count($context) == 1 && is_numeric($context[0])) { // for just followed items
42
- $params['useitemcategories'] = 'true';
43
- }
44
-
45
- $params['recnum'] = $maxCount * 2;
46
-
47
- try {
48
- $a = microtime(true);
49
-
50
- $rawResponse = Mage::helper('yoochoose')->_getHttpPage($url, $params);
51
-
52
- $b = microtime(true);
53
-
54
- $response = Zend_Json::decode($rawResponse);
55
-
56
- $result = $this->_getRecommendedProductsArray($response);
57
-
58
- $c = microtime(true);
59
-
60
- $t1 = number_format($b - $a, 3, '.', '');
61
- $t2 = number_format($c - $b, 3, '.', '');
62
-
63
- Mage::log("Reco-Request successful. Scenario: [$scenario]; Amount: ".count($result)."; HTTP-Time: $t1; SQL-Time: $t2.", Zend_Log::DEBUG, 'yoochoose.log');
64
-
65
- return $result;
66
- } catch(Exception $e) {
67
- Mage::logException($e); // systemlog here. yoochoose.log was appended in the helper above.
68
- // authentication failed
69
- return array();
70
- }
71
- }
72
-
73
-
74
-
75
- /**
76
- * Transform Response Array to Array of Products
77
- *
78
- * @param array $response
79
- * @return array
80
- */
81
- protected function _getRecommendedProductsArray($response) {
82
-
83
- $responseArray = $response['recommendationResponseList'];
84
-
85
- $recommendedProductsArray = array();
86
-
87
- $ids = array();
88
-
89
- foreach($responseArray as $reco) {
90
- $ids[] = $reco['itemId'];
91
- }
92
-
93
- return empty($ids) ? array() : $this->loadProducts($ids);
94
- }
95
-
96
-
97
- protected function loadProducts($ids) {
98
- if (empty($ids)) {
99
- return array();
100
- }
101
-
102
- $productCollection =
103
- Mage::getModel('catalog/product')->
104
- getCollection()->
105
- addAttributeToSelect('name')->
106
- addAttributeToSelect('small_image')->
107
- addAttributeToSelect('thumbnail')->
108
- addAttributeToSelect('visibility')->
109
- addAttributeToSelect('rating_summary')->
110
- addFinalPrice()->
111
- addAttributeToFilter('status', array('eq' => Mage_Catalog_Model_Product_Status::STATUS_ENABLED))->
112
- addAttributeToFilter('entity_id', array('in' => $ids))->
113
- load();
114
-
115
- $result = array();
116
-
117
- $products = $productCollection->getItems();
118
-
119
- foreach($ids as $id) {
120
- $p = $this->findProduct($products, $id);
121
- if ($p) {
122
- $result[] = $p;
123
- } else {
124
- Mage::log(
125
- 'Recommended product ['.$id.'] was not found (out of stock?) in the product collection. Skipping...',
126
- Zend_Log::NOTICE, 'yoochoose.log');
127
- }
128
- }
129
-
130
- Mage::log('Requested products ['.implode(",", $ids).']. Found '.count($result).' products.', Zend_Log::DEBUG, 'yoochoose.log');
131
-
132
- return $result;
133
- }
134
-
135
-
136
- /** Searchs the magento product by the specified EntityId.
137
- * Returns null if not found.
138
- */
139
- public function findProduct($products, $id) {
140
- foreach ($products as $product) {
141
- if ($product->getEntityId() == $id) {
142
- return $product;
143
- }
144
- }
145
- return null;
146
- }
147
-
148
-
149
- /**
150
- * Generate Base Url for Recommendation Request
151
- *
152
- * @param string $scenario
153
- * @return string
154
- */
155
- protected function _getRecommendationBaseUrl($scenario) {
156
-
157
- $url = Mage::getStoreConfig('yoochoose/api/reco_server');
158
- $url = rtrim($url, "/");
159
-
160
- $mnd = Mage::getStoreConfig('yoochoose/api/client_id');
161
- $user = $this->_getUserId();
162
-
163
- return $url.'/api/'.$mnd.'/'.urlencode($user)."/".urlencode($scenario).'.json';
164
- }
165
-
166
-
167
- /**
168
- * Generate context for recommendations.
169
- * Returns an array of constants.
170
- */
171
- protected function getContext() {
172
- return array();
173
- }
174
-
175
-
176
- /**
177
- * Merge two array of products; don't add duplicates
178
- *
179
- * @param array $itemArray1
180
- * @param array $itemArray2
181
- * @return array
182
- */
183
- public function mergeItemArrays($itemArray1, $itemArray2, $columns) {
184
-
185
- $numrec = $this->getMaxNumberProducts($columns);
186
-
187
- foreach($itemArray2 as $item) {
188
- if ( ! $this->findProduct($itemArray1, $item->getEntityId())) {
189
-
190
- if (count($itemArray1) >= $numrec) {
191
- break;
192
- }
193
-
194
- $this->initProductUrl($item);
195
-
196
- $itemArray1[] = $item;
197
- }
198
- }
199
- return $itemArray1;
200
- }
201
-
202
-
203
- private function initProductUrl($product) {
204
-
205
- $additional = array();
206
-
207
- $additional['_query'] = array('recommended' => $this->getScenario());
208
-
209
- $url = $product->getUrlModel()->getUrl($product, $additional);
210
-
211
- $product->setDate('url', $url);
212
- }
213
-
214
-
215
- /**
216
- * Gets configured maximum number of recommended products
217
- *
218
- * @return int
219
- */
220
- abstract public function getRowCount();
221
-
222
-
223
- public function getMaxNumberProducts($columns) {
224
-
225
- $rows = $this->getRowCount();
226
-
227
- if (is_numeric($rows)) {
228
-
229
- return $columns * $rows; // intval($maxNumberProducts);
230
- } else {
231
- $scenario = $this->getScenario();
232
- $default = 3;
233
- Mage::log("Invalid rownum [$rows] for scenario [$scenario]. Using default value [$default]...", Zend_Log::WARN, 'yoochoose.log');
234
-
235
- return $default; // some default value
236
- }
237
- }
238
-
239
-
240
- abstract public function getScenario();
241
-
242
-
243
- abstract public function getManualItems();
244
-
245
-
246
- /**
247
- * Converts item collection to array
248
- *
249
- * @return array
250
- */
251
- public function getArrayFromItemCollection($itemCollection) {
252
- $itemArray = array();
253
-
254
- foreach($itemCollection as $item) {
255
- $itemArray[] = $item;
256
- }
257
-
258
- return $itemArray;
259
- }
260
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/AvS/Yoochoose/Model/Api/Recommendation/Bestseller.php DELETED
@@ -1,32 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * @category AvS
5
- * @package AvS_Yoochoose
6
- * @author Andreas von Studnitz <avs@avs-webentwicklung.de>
7
- */
8
-
9
- class AvS_Yoochoose_Model_Api_Recommendation_Bestseller extends AvS_Yoochoose_Model_Api_Recommendation {
10
-
11
- /**
12
- * Gets configured maximum number of recommended products
13
- */
14
- public function getRowCount() {
15
- return Mage::getStoreConfig('yoochoose/bestseller/row_count');
16
- }
17
-
18
-
19
- public function getScenario() {
20
- return Mage::getStoreConfig('yoochoose/bestseller/scenario');
21
- }
22
-
23
-
24
- protected function getContext() {
25
- return null;
26
- }
27
-
28
-
29
- public function getManualItems() {
30
- return array();
31
- }
32
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/AvS/Yoochoose/Model/Api/Recommendation/Crossselling.php DELETED
@@ -1,94 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * @category AvS
5
- * @package AvS_Yoochoose
6
- * @author Andreas von Studnitz <avs@avs-webentwicklung.de>
7
- */
8
-
9
- class AvS_Yoochoose_Model_Api_Recommendation_Crossselling extends AvS_Yoochoose_Model_Api_Recommendation {
10
-
11
- protected $_cartProductIds = array();
12
-
13
- // manual collection
14
- protected $_itemCollection = false;
15
-
16
-
17
- /**
18
- * Gets configured maximum number of recommended products
19
- */
20
- public function getRowCount() {
21
- return Mage::getStoreConfig('yoochoose/crossselling/row_count');
22
- }
23
-
24
-
25
- public function getScenario() {
26
- return Mage::getStoreConfig('yoochoose/crossselling/scenario');
27
- }
28
-
29
-
30
- protected function getContext() {
31
- $cartProductIds = $this->_getCartProductIds();
32
- return $cartProductIds;
33
- }
34
-
35
-
36
- public function getManualItems() {
37
-
38
- if ($this->_itemCollection === false) {
39
- $productIds = $this->_getCartProductIds();
40
-
41
- if (! empty($productIds)) {
42
-
43
- $link = Mage::getSingleton('catalog/product_link')
44
- ->useCrossSellLinks(); // very important, this sets the linkTypeId to 5
45
-
46
- $collection = $link->getProductCollection()
47
- ->addProductFilter($productIds)
48
- ->addExcludeProductFilter($productIds)
49
- ->addAttributeToSelect(array('name', 'url_key', 'url_path'));
50
-
51
- $ids = array();
52
-
53
- foreach ($collection as $cp) {
54
- $ids[] = $cp->getId();
55
- }
56
-
57
- $result = $this->loadProducts($ids);
58
-
59
- $this->_itemCollection = $result;
60
- } else {
61
- $this->_itemCollection = array();
62
- }
63
- }
64
-
65
- return $this->_itemCollection;
66
-
67
- }
68
-
69
-
70
- /**
71
- * Get all Product Ids of customer cart
72
- *
73
- * @return array
74
- */
75
- protected function _getCartProductIds() {
76
-
77
- if (empty($this->_cartProductIds)) {
78
-
79
- $checkoutSession = Mage::getSingleton('checkout/session');
80
- $cartItems = $checkoutSession->getQuote()->getAllItems();
81
-
82
- foreach($cartItems as $item) {
83
- if ($item->getParentItem()) {
84
- continue;
85
- }
86
-
87
- $this->_cartProductIds[] = $item->getProductId();
88
- }
89
- }
90
-
91
- return $this->_cartProductIds;
92
- }
93
-
94
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/AvS/Yoochoose/Model/Api/Recommendation/Personal.php DELETED
@@ -1,32 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * @category AvS
5
- * @package AvS_Yoochoose
6
- * @author Andreas von Studnitz <avs@avs-webentwicklung.de>
7
- */
8
-
9
- class AvS_Yoochoose_Model_Api_Recommendation_Personal extends AvS_Yoochoose_Model_Api_Recommendation {
10
-
11
- /**
12
- * Gets configured maximum number of recommended products
13
- */
14
- public function getRowCount() {
15
- return Mage::getStoreConfig('yoochoose/personal/row_count');
16
- }
17
-
18
-
19
- public function getScenario() {
20
- return Mage::getStoreConfig('yoochoose/personal/scenario');
21
- }
22
-
23
-
24
- protected function getContext() {
25
- return null;
26
- }
27
-
28
-
29
- public function getManualItems() {
30
- return array();
31
- }
32
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/AvS/Yoochoose/Model/Api/Recommendation/Related.php DELETED
@@ -1,38 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * @category AvS
5
- * @package AvS_Yoochoose
6
- * @author Andreas von Studnitz <avs@avs-webentwicklung.de>
7
- */
8
-
9
- class AvS_Yoochoose_Model_Api_Recommendation_Related extends AvS_Yoochoose_Model_Api_Recommendation {
10
-
11
- /**
12
- * Gets configured maximum number of recommended products
13
- */
14
- public function getRowCount() {
15
- return Mage::getStoreConfig('yoochoose/related/row_count');
16
- }
17
-
18
- public function getScenario() {
19
- return Mage::getStoreConfig('yoochoose/related/scenario');
20
- }
21
-
22
-
23
- protected function getContext() {
24
- $product = Mage::registry('product');
25
- return array($product->getId());
26
- }
27
-
28
-
29
- public function getManualItems() {
30
- $product = Mage::registry('product');
31
- if ($product) {
32
- $result = $this->loadProducts($product->getRelatedProductIds());
33
- return $result;
34
- } else {
35
- return array();
36
- }
37
- }
38
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/AvS/Yoochoose/Model/Api/Recommendation/Upselling.php DELETED
@@ -1,40 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * @category AvS
5
- * @package AvS_Yoochoose
6
- * @author Andreas von Studnitz <avs@avs-webentwicklung.de>
7
- */
8
-
9
- class AvS_Yoochoose_Model_Api_Recommendation_Upselling extends AvS_Yoochoose_Model_Api_Recommendation {
10
-
11
- /**
12
- * Gets configured maximum number of recommended products
13
- */
14
- public function getRowCount() {
15
- return Mage::getStoreConfig('yoochoose/upselling/row_count');
16
- }
17
-
18
-
19
- public function getScenario() {
20
- return Mage::getStoreConfig('yoochoose/upselling/scenario');
21
- }
22
-
23
-
24
- protected function getContext() {
25
- $product = Mage::registry('product');
26
- return array($product->getId());
27
- }
28
-
29
-
30
- public function getManualItems() {
31
- $product = Mage::registry('product');
32
- if ($product) {
33
- $result = $this->loadProducts($product->getUpSellProductIds());
34
- return $result;
35
- } else {
36
- return array();
37
- }
38
- }
39
-
40
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/AvS/Yoochoose/Model/Observer.php DELETED
@@ -1,103 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * @category AvS
5
- * @package AvS_Yoochoose
6
- * @author Andreas von Studnitz <avs@avs-webentwicklung.de>
7
- */
8
-
9
- class AvS_Yoochoose_Model_Observer {
10
-
11
- /**
12
- * Update field "yoochoose_user_id" from session to
13
- * customer object (database) or vice verse, if customer info already exists
14
- *
15
- * @param Varien_Event_Observer $observer
16
- */
17
- public function onCustomerLogin($observer)
18
- {
19
- $customer = $observer->getEvent()->getCustomer();
20
- Mage::helper('yoochoose')->mergeUserIdOnLogin();
21
- }
22
-
23
- /**
24
- *
25
- * @param Varien_Event_Observer $observer
26
- */
27
- public function adminSystemConfigChangedSectionYoochoose($observer)
28
- {
29
- $clientId = Mage::getStoreConfig('yoochoose/api/client_id');
30
- $licenseKey = Mage::getStoreConfig('yoochoose/api/license_key');
31
-
32
- if (!$clientId && !$licenseKey) return;
33
-
34
- try {
35
- $licenseType = $this->_getLicenseType();
36
-
37
- $this->_displayMessage($licenseType);
38
-
39
- } catch(Exception $e) {
40
- Mage::log('Error getting license for ['.$clientId.']. Error code ['.$e->getCode().']', Zend_Log::ERR, 'yoochoose.log');
41
- Mage::logException($e);
42
-
43
- $licenseType = __('Error getting license [%s]', $e->getCode());
44
-
45
- Mage::getSingleton('adminhtml/session')->addError(
46
- Mage::helper('yoochoose')->__('License could not be verified.')
47
- );
48
- }
49
-
50
- if ($licenseType != Mage::getStoreConfig('yoochoose/api/license_type')) {
51
- $this->_setConfigData('yoochoose/api/license_type', $licenseType);
52
- }
53
- }
54
-
55
- /**
56
- * Display success or error message, depending on license type
57
- *
58
- * @param string $licenseType
59
- */
60
- protected function _displayMessage($licenseType) {
61
- if ($licenseType && $licenseType != Mage::getStoreConfig('yoochoose/api/license_type')) {
62
- Mage::getSingleton('adminhtml/session')->addSuccess(
63
- Mage::helper('yoochoose')->__('License successfully verified.')
64
- );
65
- }
66
- }
67
-
68
- /**
69
- * Get License Type base on Client Id and License Key
70
- *
71
- * @param string $clientId
72
- * @param string $licenseKey
73
- * @return string
74
- */
75
- protected function _getLicenseType(){
76
-
77
- $clientId = Mage::getStoreConfig('yoochoose/api/client_id');
78
-
79
- if ( ! $clientId) {
80
- return __("Client ID not set");
81
- }
82
-
83
- Mage::log('Requesting license for ['.$clientId.']...', Zend_Log::DEBUG, 'yoochoose.log');
84
-
85
- $url = Mage::getStoreConfig('yoochoose/api/config_server');
86
- $url = rtrim($url, "/");
87
- $url = $url."/api/".rawurlencode($clientId)."/license.json";
88
-
89
- $rawResponse = Mage::helper('yoochoose')->_getHttpPage($url);
90
- $response = Zend_Json::decode($rawResponse);
91
- return $response['license']['type'];
92
- }
93
-
94
-
95
- protected function _setConfigData($configPath, $value)
96
- {
97
- $setup = new Mage_Core_Model_Resource_Setup('core_setup');
98
- $setup->startSetup();
99
- $setup->setConfigData($configPath, $value);
100
- $setup->endSetup();
101
- Mage::getSingleton('core/config')->reinit();
102
- }
103
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/AvS/Yoochoose/Model/Source/Overwritten.php DELETED
@@ -1,61 +0,0 @@
1
- <?php
2
- /**
3
- * Magento
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
- *
15
- * DISCLAIMER
16
- *
17
- * Do not edit or add to this file if you wish to upgrade Magento to newer
18
- * versions in the future. If you wish to customize Magento for your
19
- * needs please refer to http://www.magentocommerce.com for more information.
20
- *
21
- * @category Mage
22
- * @package Mage_Adminhtml
23
- * @copyright Copyright (c) 2013 Magento Inc. (http://www.magentocommerce.com)
24
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
- */
26
-
27
- /**
28
- * Used in creating options for Yes|No config value selection
29
- *
30
- */
31
- class AvS_Yoochoose_Model_Source_Overwritten {
32
-
33
- /**
34
- * Options getter
35
- *
36
- * @return array
37
- */
38
- public function toOptionArray() {
39
- return array(
40
- array('value' => 1, 'label'=>'Yoochoose recommendation only'),
41
- array('value' => 2, 'label'=>'Manually entered and yoochoose recommendation'),
42
- array('value' => 3, 'label'=>'Manually entered recommendation only'),
43
- array('value' => 0, 'label'=>'Disabled')
44
- );
45
- }
46
-
47
- /**
48
- * Get options in "key-value" format
49
- *
50
- * @return array
51
- */
52
- public function toArray(){
53
- return array(
54
- 1 => 'Yoochoose recommendation only',
55
- 2 => 'Manually entered and yoochoose recommendation',
56
- 3 => 'Manually entered recommendation only',
57
- 0 => 'Disabled'
58
- );
59
- }
60
-
61
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/AvS/Yoochoose/etc/config.xml DELETED
@@ -1,176 +0,0 @@
1
- <?xml version="1.0"?>
2
- <config>
3
-
4
- <modules>
5
- <AvS_Yoochoose>
6
- <version>1.4.6</version>
7
- </AvS_Yoochoose>
8
- </modules>
9
-
10
- <global>
11
-
12
- <models>
13
- <yoochoose>
14
- <class>AvS_Yoochoose_Model</class>
15
- </yoochoose>
16
- </models>
17
-
18
- <helpers>
19
- <yoochoose>
20
- <class>AvS_Yoochoose_Helper</class>
21
- </yoochoose>
22
- </helpers>
23
-
24
- <blocks>
25
- <yoochoose>
26
- <class>AvS_Yoochoose_Block</class>
27
- </yoochoose>
28
- <catalog>
29
- <rewrite>
30
- <product_list_upsell>AvS_Yoochoose_Block_Upsell</product_list_upsell>
31
- <product_list_related>AvS_Yoochoose_Block_Related</product_list_related>
32
- </rewrite>
33
- </catalog>
34
- <checkout>
35
- <rewrite>
36
- <cart_crosssell>AvS_Yoochoose_Block_Crosssell</cart_crosssell>
37
- </rewrite>
38
- </checkout>
39
- </blocks>
40
-
41
- </global>
42
-
43
- <frontend>
44
-
45
- <events>
46
- <customer_login>
47
- <observers>
48
- <yoochoose>
49
- <type>singleton</type>
50
- <class>yoochoose/observer</class>
51
- <method>onCustomerLogin</method>
52
- </yoochoose>
53
- </observers>
54
- </customer_login>
55
- </events>
56
-
57
- <layout>
58
- <updates>
59
- <yoochoose>
60
- <file>yoochoose.xml</file>
61
- </yoochoose>
62
- </updates>
63
- </layout>
64
-
65
- <translate>
66
- <modules>
67
- <AvS_Yoochoose>
68
- <files>
69
- <default>AvS_Yoochoose.csv</default>
70
- </files>
71
- </AvS_Yoochoose>
72
- </modules>
73
- </translate>
74
-
75
- </frontend>
76
-
77
- <adminhtml>
78
-
79
- <events>
80
- <admin_system_config_changed_section_yoochoose>
81
- <observers>
82
- <yoochoose>
83
- <type>singleton</type>
84
- <class>yoochoose/observer</class>
85
- <method>adminSystemConfigChangedSectionYoochoose</method>
86
- </yoochoose>
87
- </observers>
88
- </admin_system_config_changed_section_yoochoose>
89
- </events>
90
-
91
- <acl>
92
- <resources>
93
- <admin>
94
- <children>
95
- <system>
96
- <children>
97
- <config>
98
- <children>
99
- <yoochoose translate="title" module="yoochoose">
100
- <title>Yoochoose</title>
101
- </yoochoose>
102
- </children>
103
- </config>
104
- </children>
105
- </system>
106
- </children>
107
- </admin>
108
- </resources>
109
- </acl>
110
-
111
- <translate>
112
- <modules>
113
- <AvS_Yoochoose>
114
- <files>
115
- <default>AvS_Yoochoose.csv</default>
116
- </files>
117
- </AvS_Yoochoose>
118
- </modules>
119
- </translate>
120
-
121
- </adminhtml>
122
-
123
- <default>
124
- <yoochoose>
125
- <general>
126
- <disabled>0</disabled>
127
- </general>
128
- <crossselling>
129
- <display_yoochoose_recommendations>1</display_yoochoose_recommendations>
130
- <scenario>cross_selling</scenario>
131
- <prefer_manual_connections>0</prefer_manual_connections>
132
- <row_count>4</row_count>
133
- </crossselling>
134
- <upselling>
135
- <display_yoochoose_recommendations>1</display_yoochoose_recommendations>
136
- <scenario>up_selling</scenario>
137
- <prefer_manual_connections>0</prefer_manual_connections>
138
- <row_count>1</row_count>
139
- </upselling>
140
- <related>
141
- <display_yoochoose_recommendations>1</display_yoochoose_recommendations>
142
- <scenario>related_products</scenario>
143
- <prefer_manual_connections>0</prefer_manual_connections>
144
- <row_count>6</row_count>
145
- </related>
146
- <bestseller>
147
- <display_yoochoose_recommendations>1</display_yoochoose_recommendations>
148
- <scenario>bestseller</scenario>
149
- <row_count>2</row_count>
150
- </bestseller>
151
- <personal>
152
- <display_yoochoose_recommendations>1</display_yoochoose_recommendations>
153
- <scenario>personal</scenario>
154
- <row_count>2</row_count>
155
- </personal>
156
- <api>
157
- <item_type>1</item_type>
158
- <tracker_server>https://event.yoochoose.net</tracker_server>
159
- <reco_server>https://reco.yoochoose.net</reco_server>
160
- <config_server>https://config.yoochoose.net</config_server>
161
- </api>
162
- </yoochoose>
163
- </default>
164
-
165
- <crontab>
166
- <translate>
167
- <modules>
168
- <AvS_Yoochoose>
169
- <files>
170
- <default>AvS_Yoochoose.csv</default>
171
- </files>
172
- </AvS_Yoochoose>
173
- </modules>
174
- </translate>
175
- </crontab>
176
- </config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/AvS/Yoochoose/etc/system.xml DELETED
@@ -1,312 +0,0 @@
1
- <?xml version="1.0"?>
2
- <config>
3
- <sections>
4
- <yoochoose translate="label" module="yoochoose">
5
- <label>Yoochoose Recommendations</label>
6
- <tab>catalog</tab>
7
- <sort_order>990</sort_order>
8
- <show_in_default>1</show_in_default>
9
- <show_in_website>1</show_in_website>
10
- <show_in_store>1</show_in_store>
11
- <groups>
12
- <general translate="label">
13
- <label>Disable extention</label>
14
- <sort_order>900</sort_order>
15
- <show_in_default>1</show_in_default>
16
- <show_in_website>1</show_in_website>
17
- <show_in_store>1</show_in_store>
18
- <comment><![CDATA[
19
- <!--script type="text/javascript">
20
- document.observe("dom:loaded", function() {
21
- $('yoochoose_general_stats').replace($('yoochoose_general_stats').value);
22
- });
23
- </script-->
24
- ]]></comment>
25
- <fields>
26
- <disabled translate="label">
27
- <label>Disable extention</label>
28
- <frontend_type>select</frontend_type>
29
- <source_model>adminhtml/system_config_source_yesno</source_model>
30
- <sort_order>900</sort_order>
31
- <show_in_default>1</show_in_default>
32
- <show_in_website>1</show_in_website>
33
- <show_in_store>1</show_in_store>
34
- <comment>Disables yoochoose tracking and yoochoose recommendations. If disabled, the manually entered recommendations are shown.</comment>
35
- </disabled>
36
- <!--stats translate="label">
37
- <label>Statistics</label>
38
- <sort_order>20</sort_order>
39
- <show_in_default>1</show_in_default>
40
- <show_in_website>1</show_in_website>
41
- <show_in_store>1</show_in_store>
42
- </stats-->
43
- </fields>
44
- </general>
45
- <api translate="label">
46
- <label>General Settings</label>
47
- <sort_order>5</sort_order>
48
- <show_in_default>1</show_in_default>
49
- <show_in_website>1</show_in_website>
50
- <show_in_store>1</show_in_store>
51
- <fields>
52
- <client_id translate="label,comment">
53
- <label>Yoochoose Customer ID</label>
54
- <comment><![CDATA[
55
- If you don't have a Customer ID yet, <a href='https://admin.yoochoose.net/login.html?product=magento_Direct&lang=en' target='_blank'>click here</a>.
56
- ]]></comment>
57
- <frontend_type>text</frontend_type>
58
- <sort_order>10</sort_order>
59
- <show_in_default>1</show_in_default>
60
- <show_in_website>1</show_in_website>
61
- <show_in_store>1</show_in_store>
62
- </client_id>
63
- <license_key translate="label">
64
- <label>Yoochoose License Key</label>
65
- <comment><![CDATA[
66
- You can find your license key and detailed statistics on the <a href='https://admin.yoochoose.net' target='_blank'>Yoochoose Configuration Backend</a>.
67
- ]]></comment>
68
- <frontend_type>text</frontend_type>
69
- <sort_order>20</sort_order>
70
- <show_in_default>1</show_in_default>
71
- <show_in_website>1</show_in_website>
72
- <show_in_store>1</show_in_store>
73
- </license_key>
74
- <license_type translate="label,comment">
75
- <label>Yoochoose License Type</label>
76
- <frontend_type>text</frontend_type>
77
- <frontend_model>yoochoose/field_readonly</frontend_model>
78
- <sort_order>30</sort_order>
79
- <show_in_default>1</show_in_default>
80
- <show_in_website>1</show_in_website>
81
- <show_in_store>1</show_in_store>
82
- <comment>It is filled out automatically after the configuration was saved.</comment>
83
- </license_type>
84
-
85
- <item_type translate="label,comment">
86
- <label>Item Type</label>
87
- <comment>Recommendation item type (in most cases 1)</comment>
88
- <frontend_type>text</frontend_type>
89
- <frontend_model>yoochoose/field_readonly</frontend_model>
90
- <sort_order>35</sort_order>
91
- <show_in_default>1</show_in_default>
92
- <show_in_store>1</show_in_store>
93
- </item_type>
94
-
95
- <tracker_server translate="label,comment">
96
- <label>Tracking server (read-only)</label>
97
- <comment>URL to the yoochoose event tracking server.</comment>
98
- <frontend_type>text</frontend_type>
99
- <frontend_model>yoochoose/field_readonly</frontend_model>
100
- <sort_order>40</sort_order>
101
- <show_in_default>1</show_in_default>
102
- </tracker_server>
103
-
104
- <reco_server translate="label,comment">
105
- <label>Recommendation server (read-only)</label>
106
- <comment>URL to the yoochoose recommendation server.</comment>
107
- <frontend_type>text</frontend_type>
108
- <frontend_model>yoochoose/field_readonly</frontend_model>
109
- <sort_order>42</sort_order>
110
- <show_in_default>1</show_in_default>
111
- </reco_server>
112
-
113
- <config_server translate="label,comment">
114
- <label>Configuration server (read-only)</label>
115
- <comment>URL to the yoochoose configuration server.</comment>
116
- <frontend_type>text</frontend_type>
117
- <frontend_model>yoochoose/field_readonly</frontend_model>
118
- <sort_order>44</sort_order>
119
- <show_in_default>1</show_in_default>
120
- </config_server>
121
- </fields>
122
- </api>
123
-
124
- <bestseller translate="label">
125
- <label>Best seller block on the home page</label>
126
- <sort_order>10</sort_order>
127
- <show_in_default>1</show_in_default>
128
- <show_in_website>1</show_in_website>
129
- <show_in_store>1</show_in_store>
130
- <fields>
131
- <display_yoochoose_recommendations translate="label">
132
- <label>Display recommendations</label>
133
- <frontend_type>select</frontend_type>
134
- <source_model>adminhtml/system_config_source_yesno</source_model>
135
- <sort_order>10</sort_order>
136
- <show_in_default>1</show_in_default>
137
- <show_in_website>1</show_in_website>
138
- <show_in_store>1</show_in_store>
139
- </display_yoochoose_recommendations>
140
- <scenario translate="label">
141
- <label>Scenario used (read-only)</label>
142
- <frontend_type>text</frontend_type>
143
- <frontend_model>yoochoose/field_readonly</frontend_model>
144
- <sort_order>15</sort_order>
145
- <show_in_default>1</show_in_default>
146
- <show_in_website>1</show_in_website>
147
- <show_in_store>1</show_in_store>
148
- </scenario>
149
- <row_count translate="label">
150
- <label>Rows in the recommendation block</label>
151
- <frontend_type>text</frontend_type>
152
- <sort_order>20</sort_order>
153
- <show_in_default>1</show_in_default>
154
- <show_in_website>1</show_in_website>
155
- <show_in_store>1</show_in_store>
156
- <comment>The amount of the recomendations in the row is dependend on the template and usually between 3 and 6.</comment>
157
- </row_count>
158
- </fields>
159
- </bestseller>
160
-
161
- <personal translate="label">
162
- <label>Personalized recommendation block on the home page</label>
163
- <sort_order>20</sort_order>
164
- <show_in_default>1</show_in_default>
165
- <show_in_website>1</show_in_website>
166
- <show_in_store>1</show_in_store>
167
- <fields>
168
- <display_yoochoose_recommendations translate="label">
169
- <label>Display recommendations</label>
170
- <frontend_type>select</frontend_type>
171
- <source_model>adminhtml/system_config_source_yesno</source_model>
172
- <sort_order>10</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
- </display_yoochoose_recommendations>
177
- <scenario translate="label">
178
- <label>Scenario used (read-only)</label>
179
- <frontend_type>text</frontend_type>
180
- <frontend_model>yoochoose/field_readonly</frontend_model>
181
- <sort_order>15</sort_order>
182
- <show_in_default>1</show_in_default>
183
- <show_in_website>1</show_in_website>
184
- <show_in_store>1</show_in_store>
185
- </scenario>
186
- <row_count translate="label">
187
- <label>Rows in the recommendation block</label>
188
- <frontend_type>text</frontend_type>
189
- <sort_order>20</sort_order>
190
- <show_in_default>1</show_in_default>
191
- <show_in_website>1</show_in_website>
192
- <show_in_store>1</show_in_store>
193
- <comment>The amount of the recomendations in the row is dependend on the template and usually between 3 and 6.</comment>
194
- </row_count>
195
- </fields>
196
- </personal>
197
-
198
- <upselling translate="label">
199
- <label>Upselling block of the product details page</label>
200
- <sort_order>40</sort_order>
201
- <show_in_default>1</show_in_default>
202
- <show_in_website>1</show_in_website>
203
- <show_in_store>1</show_in_store>
204
- <fields>
205
- <display_yoochoose_recommendations translate="label">
206
- <label>Recommendation source</label>
207
- <frontend_type>select</frontend_type>
208
- <source_model>yoochoose/source_overwritten</source_model>
209
- <sort_order>10</sort_order>
210
- <show_in_default>1</show_in_default>
211
- <show_in_website>1</show_in_website>
212
- <show_in_store>1</show_in_store>
213
- <comment>If manually entered recommendations are enabled, they will be shown first in the list.</comment>
214
- </display_yoochoose_recommendations>
215
- <scenario translate="label">
216
- <label>Scenario used (read-only)</label>
217
- <frontend_type>text</frontend_type>
218
- <frontend_model>yoochoose/field_readonly</frontend_model>
219
- <sort_order>15</sort_order>
220
- <show_in_default>1</show_in_default>
221
- <show_in_website>1</show_in_website>
222
- <show_in_store>1</show_in_store>
223
- </scenario>
224
- <row_count translate="label">
225
- <label>Rows in the recommendation block</label>
226
- <frontend_type>text</frontend_type>
227
- <sort_order>20</sort_order>
228
- <show_in_default>1</show_in_default>
229
- <show_in_website>1</show_in_website>
230
- <show_in_store>1</show_in_store>
231
- <comment>The amount of the recomendations in the row is dependend on the template and usually between 3 and 6.</comment>
232
- </row_count>
233
- </fields>
234
- </upselling>
235
-
236
- <related translate="label">
237
- <label>Related products block of the product details page</label>
238
- <sort_order>50</sort_order>
239
- <show_in_default>1</show_in_default>
240
- <show_in_website>1</show_in_website>
241
- <show_in_store>1</show_in_store>
242
- <fields>
243
- <display_yoochoose_recommendations translate="label">
244
- <label>Recommendation source</label>
245
- <frontend_type>select</frontend_type>
246
- <source_model>yoochoose/source_overwritten</source_model>
247
- <sort_order>10</sort_order>
248
- <show_in_default>1</show_in_default>
249
- <show_in_website>1</show_in_website>
250
- <show_in_store>1</show_in_store>
251
- <comment>If manually entered recommendations are enabled, they will be shown first in the list.</comment>
252
- </display_yoochoose_recommendations>
253
- <scenario translate="label">
254
- <label>Scenario used (read-only)</label>
255
- <frontend_type>text</frontend_type>
256
- <frontend_model>yoochoose/field_readonly</frontend_model>
257
- <sort_order>15</sort_order>
258
- <show_in_default>1</show_in_default>
259
- <show_in_website>1</show_in_website>
260
- <show_in_store>1</show_in_store>
261
- </scenario>
262
- <row_count translate="label">
263
- <label>Amount of recommended products</label>
264
- <frontend_type>text</frontend_type>
265
- <sort_order>20</sort_order>
266
- <show_in_default>1</show_in_default>
267
- <show_in_website>1</show_in_website>
268
- <show_in_store>1</show_in_store>
269
- </row_count>
270
- </fields>
271
- </related>
272
-
273
- <crossselling translate="label">
274
- <label>Crossselling block of the shopping basket</label>
275
- <sort_order>60</sort_order>
276
- <show_in_default>1</show_in_default>
277
- <show_in_website>1</show_in_website>
278
- <show_in_store>1</show_in_store>
279
- <fields>
280
- <display_yoochoose_recommendations translate="label">
281
- <label>Recommendation source</label>
282
- <frontend_type>select</frontend_type>
283
- <source_model>yoochoose/source_overwritten</source_model>
284
- <sort_order>10</sort_order>
285
- <show_in_default>1</show_in_default>
286
- <show_in_website>1</show_in_website>
287
- <show_in_store>1</show_in_store>
288
- <comment>If manually entered recommendations are enabled, they will be shown first in the list.</comment>
289
- </display_yoochoose_recommendations>
290
- <scenario translate="label">
291
- <label>Scenario used (read-only)</label>
292
- <frontend_type>text</frontend_type>
293
- <frontend_model>yoochoose/field_readonly</frontend_model>
294
- <sort_order>15</sort_order>
295
- <show_in_default>1</show_in_default>
296
- <show_in_website>1</show_in_website>
297
- <show_in_store>1</show_in_store>
298
- </scenario>
299
- <row_count translate="label">
300
- <label>Amount of recommended products</label>
301
- <frontend_type>text</frontend_type>
302
- <sort_order>20</sort_order>
303
- <show_in_default>1</show_in_default>
304
- <show_in_website>1</show_in_website>
305
- <show_in_store>1</show_in_store>
306
- </row_count>
307
- </fields>
308
- </crossselling>
309
- </groups>
310
- </yoochoose>
311
- </sections>
312
- </config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Yoochoose/JsTracking/Block/Field/ConfigureAuth.php ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Yoochoose_JsTracking_Block_Field_ConfigureAuth extends Mage_Adminhtml_Block_System_Config_Form_Field
4
+ {
5
+ /*
6
+ * Set template
7
+ */
8
+ protected function _construct()
9
+ {
10
+ parent::_construct();
11
+ $this->setTemplate('yoochoose/system/config/configure_auth.phtml');
12
+ }
13
+
14
+ /**
15
+ * Return element html
16
+ *
17
+ * @param Varien_Data_Form_Element_Abstract $element
18
+ * @return string
19
+ */
20
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
21
+ {
22
+ return $this->_toHtml();
23
+ }
24
+
25
+ /**
26
+ * Return ajax url for button
27
+ *
28
+ * @return string
29
+ */
30
+ public function getAjaxConfigureUrl()
31
+ {
32
+ return Mage::helper('adminhtml')->getUrl('adminhtml/adminhtml_yoochoose/configure');
33
+ }
34
+
35
+ /**
36
+ * Generate button html
37
+ *
38
+ * @return string
39
+ */
40
+ public function getButtonHtml()
41
+ {
42
+ $button = $this->getLayout()->createBlock('adminhtml/widget_button')
43
+ ->setData(array(
44
+ 'id' => 'yoochoose_button',
45
+ 'label' => $this->helper('adminhtml')->__('Configure'),
46
+ 'onclick' => 'javascript:yc_configure_auth(); return false;'
47
+ ));
48
+
49
+ return $button->toHtml();
50
+ }
51
+
52
+ }
app/code/community/Yoochoose/JsTracking/Block/Field/Customize.php ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Yoochoose_JsTracking_Block_Field_Customize extends Mage_Adminhtml_Block_System_Config_Form_Field
4
+ {
5
+ /*
6
+ * Set template
7
+ */
8
+ protected function _construct()
9
+ {
10
+ parent::_construct();
11
+ $this->setTemplate('yoochoose/system/config/customize.phtml');
12
+ }
13
+
14
+ /**
15
+ * Return element html
16
+ *
17
+ * @param Varien_Data_Form_Element_Abstract $element
18
+ * @return string
19
+ */
20
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
21
+ {
22
+ return $this->_toHtml();
23
+ }
24
+
25
+ /**
26
+ * Returns yoochoose admin configuration url
27
+ *
28
+ * @return string
29
+ */
30
+ public function getYoochooseLink()
31
+ {
32
+ $customerId = Mage::getStoreConfig('yoochoose/general/customer_id');
33
+ $plugin = Mage::getStoreConfig('yoochoose/general/plugin_id');
34
+
35
+ return 'https://admin.yoochoose.net?customer_id=' . $customerId . '#plugin/configuration' . ($plugin ? '/' . $plugin : '');
36
+ }
37
+
38
+ /**
39
+ * Generate button html
40
+ *
41
+ * @return string
42
+ */
43
+ public function getButtonHtml()
44
+ {
45
+ $button = $this->getLayout()->createBlock('adminhtml/widget_button')
46
+ ->setData(array(
47
+ 'label' => $this->helper('adminhtml')->__('Open Yoochoose Dashboard'),
48
+ 'onclick' => '',
49
+ ));
50
+
51
+ return $button->toHtml();
52
+ }
53
+
54
+ }
55
+
app/code/community/Yoochoose/JsTracking/Block/Field/Language.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Yoochoose_JsTracking_Block_Field_Language extends Mage_Adminhtml_Block_System_Config_Form_Field
4
+ {
5
+
6
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
7
+ {
8
+ if (!Mage::getStoreConfig('yoochoose/general/language')) {
9
+ $locale = Mage::app()->getLocale()->getLocaleCode();
10
+ $element->setValue($locale);
11
+ }
12
+
13
+ return parent::_getElementHtml($element);
14
+ }
15
+
16
+ }
app/code/community/Yoochoose/JsTracking/Block/Field/Readonly.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Yoochoose_JsTracking_Block_Field_Readonly extends Mage_Adminhtml_Block_System_Config_Form_Field
4
+ {
5
+
6
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
7
+ {
8
+ switch ($element->getId()) {
9
+ case 'yoochoose_general_endpoint':
10
+ if (!Mage::getStoreConfig('yoochoose/general/endpoint_overwrite') && !$element->getValue()) {
11
+ $url = Mage::getStoreConfig('web/unsecure/base_url');
12
+ $element->setValue($url);
13
+ }
14
+
15
+ break;
16
+ case 'yoochoose_general_design':
17
+ if (!Mage::getStoreConfig('yoochoose/general/endpoint_overwrite') && !$element->getValue()) {
18
+ $theme = Mage::getSingleton('core/design_package')->getTheme('frontend');
19
+ $element->setValue($theme);
20
+ }
21
+
22
+ break;
23
+ }
24
+
25
+ $element->setReadonly('true');
26
+
27
+ return parent::_getElementHtml($element);
28
+ }
29
+
30
+ }
app/code/community/Yoochoose/JsTracking/Block/Field/Register.php ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Yoochoose_JsTracking_Block_Field_Register extends Mage_Adminhtml_Block_System_Config_Form_Field
4
+ {
5
+ /*
6
+ * Set template
7
+ */
8
+ protected function _construct()
9
+ {
10
+ parent::_construct();
11
+ $this->setTemplate('yoochoose/system/config/register.phtml');
12
+ }
13
+
14
+ /**
15
+ * Return element html
16
+ *
17
+ * @param Varien_Data_Form_Element_Abstract $element
18
+ * @return string
19
+ */
20
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
21
+ {
22
+ return $this->_toHtml();
23
+ }
24
+
25
+
26
+ public function getYoochooseLink()
27
+ {
28
+ $code = Mage::getSingleton('adminhtml/config_data')->getStore();
29
+ $storeId = Mage::getModel('core/store')->load($code)->getId();
30
+ $language = Mage::getStoreConfig('general/locale/code', $storeId);
31
+ return 'https://admin.yoochoose.net/login.html?product=magento_Direct&lang=' . substr($language, 0, strpos($language, '_'));
32
+ }
33
+
34
+ public function getYoochooseRegistration()
35
+ {
36
+ $data = array();
37
+ $code = Mage::getSingleton('adminhtml/config_data')->getStore();
38
+ $storeId = Mage::getModel('core/store')->load($code)->getId();
39
+ $admin = Mage::getModel('admin/session')->getUser();
40
+ $locale = Mage::getStoreConfig('general/locale/code', $storeId);
41
+
42
+ $data['account.firstName'] = $data['billing.firstName'] = $admin->getFirstname();
43
+ $data['account.lastName'] = $data['billing.lastName'] = $admin->getLastname();
44
+ $data['account.email'] = $data['billing.email'] = $admin->getEmail();
45
+ $data['booking.website'] = Mage::helper('core/url')->getHomeUrl();
46
+ $data['booking.timeZone'] = Mage::getStoreConfig('general/locale/timezone', $storeId);
47
+ $data['booking.lang'] = substr($locale, 0, strpos($locale, '_'));
48
+ $data['billing.countryCode'] = substr($locale, strpos($locale, '_') + 1);
49
+
50
+ return json_encode($data);
51
+ }
52
+
53
+ /**
54
+ * Generate button html
55
+ *
56
+ * @return string
57
+ */
58
+ public function getButtonHtml()
59
+ {
60
+ $button = $this->getLayout()->createBlock('adminhtml/widget_button')
61
+ ->setData(array(
62
+ 'label' => $this->helper('adminhtml')->__('Register new Yoochoose account'),
63
+ 'onclick' => 'javascript:yc_register(); return false;'
64
+ ));
65
+
66
+ return $button->toHtml();
67
+ }
68
+
69
+ }
70
+
app/code/community/Yoochoose/JsTracking/Block/Head.php ADDED
@@ -0,0 +1,177 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Yoochoose_JsTracking_Block_Head extends Mage_Core_Block_Template
4
+ {
5
+ const YOOCHOOSE_CDN_SCRIPT = '//event.yoochoose.net/cdn';
6
+ const AMAZON_CDN_SCRIPT = '//cdn.yoochoose.net';
7
+
8
+
9
+ public function renderScripts()
10
+ {
11
+ $yoochoose = $this->getRequest()->get('yoochoose');
12
+ $result = '';
13
+
14
+ if ($yoochoose != 'off') {
15
+ $mandator = Mage::getStoreConfig('yoochoose/general/customer_id');
16
+ $plugin = Mage::getStoreConfig('yoochoose/general/plugin_id');
17
+ $plugin = $plugin? '/' . $plugin : '';
18
+ $scriptOverwrite = Mage::getStoreConfig('yoochoose/advanced/overwrite');
19
+
20
+ if ($scriptOverwrite) {
21
+ $scriptOverwrite = (!preg_match('/^(http|\/\/)/', $scriptOverwrite) ? '//' : '') . $scriptOverwrite;
22
+ $scriptUrl = preg_replace('(^https?:)', '', $scriptOverwrite);
23
+ } else {
24
+ $scriptUrl = Mage::getStoreConfig('yoochoose/advanced/performance') ? self::AMAZON_CDN_SCRIPT : self::YOOCHOOSE_CDN_SCRIPT;
25
+ }
26
+
27
+ $scriptUrl = rtrim($scriptUrl, '/') . "/v1/{$mandator}{$plugin}/tracking.";
28
+
29
+ //<temporary solution>
30
+ $result .= sprintf('<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/handlebars.js/3.0.3/handlebars.min.js"></script>');
31
+ $result .= sprintf('<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/typeahead.js/0.10.5/typeahead.bundle.min.js"></script>');
32
+ //</temporary solution>
33
+
34
+ $result .= sprintf('<script type="text/javascript" src="%s"></script>', $scriptUrl . 'js');
35
+ $result .= sprintf('<link type="text/css" rel="stylesheet" href="%s">', $scriptUrl . 'css');
36
+ $result .= $this->injectTracking();
37
+ }
38
+
39
+ return $result;
40
+ }
41
+
42
+ private function injectTracking()
43
+ {
44
+ $customerId = 0;
45
+ if (Mage::getSingleton('customer/session')->isLoggedIn()) {
46
+ $customerId = Mage::getSingleton('customer/session')->getCustomer()->getId();
47
+ }
48
+
49
+ $order = null;
50
+ if ($this->getOrderId()) {
51
+ $order = $this->getOrderData($this->getOrderId());
52
+ }
53
+
54
+ $itemTypeId = Mage::getStoreConfig('yoochoose/general/itemtypeid');
55
+ $language = Mage::getStoreConfig('yoochoose/general/language');
56
+ $currentPage = $this->getCurrentPage();
57
+
58
+ if (Mage::getStoreConfig('yoochoose/general/language_country')) {
59
+ $language = substr($language, 0, strpos($language, '_'));
60
+ }
61
+
62
+ $json = array(
63
+ 'trackid' => $customerId,
64
+ 'orderData' => $order,
65
+ 'itemType' => $itemTypeId,
66
+ 'language' => str_replace('_', '-', $language),
67
+ 'currentPage' => $currentPage,
68
+ 'products' => $this->getPageProducts($currentPage),
69
+ 'boxes' => $this->getRecommendBoxes($currentPage),
70
+ );
71
+
72
+ return '<script type="text/javascript">var yc_config_object = ' . json_encode($json) . ';</script>';
73
+ }
74
+
75
+ private function getOrderData($orderId)
76
+ {
77
+ $collection = Mage::getResourceModel('sales/order_collection')
78
+ ->addFieldToFilter('entity_id', array('in' => array($orderId)));
79
+ $result = array();
80
+ foreach ($collection as $order) {
81
+ foreach ($order->getAllVisibleItems() as $item) {
82
+ $result[] = array(
83
+ 'id' => $item->getProductId(),
84
+ 'price' => $item->getBasePrice(),
85
+ 'quantity' => $item->getQtyOrdered(),
86
+ 'currency' => $order->getBaseCurrencyCode(),
87
+ );
88
+ }
89
+ }
90
+
91
+ return $result;
92
+ }
93
+
94
+ private function getCurrentPage()
95
+ {
96
+ $request = $this->getRequest();
97
+ $module = $request->getModuleName();
98
+ $controller = $request->getControllerName();
99
+ $action = $request->getActionName();
100
+
101
+ if ($module == 'cms' && $action == 'index') {
102
+ return 'home';
103
+ }
104
+
105
+ if (Mage::registry('current_product')) {
106
+ return 'product';
107
+ }
108
+
109
+ if ($module == 'checkout' && $controller == 'cart' && $action == 'index') {
110
+ return 'cart';
111
+ }
112
+
113
+ if (Mage::registry('current_category')) {
114
+ return 'category';
115
+ }
116
+
117
+ return false;
118
+ }
119
+
120
+ private function getRecommendBoxes($page)
121
+ {
122
+ if (!$page) {
123
+ return false;
124
+ }
125
+
126
+ $result = array();
127
+ switch ($page) {
128
+ case 'home':
129
+ $result[] = $this->createRecommendBox('bestseller');
130
+ $result[] = $this->createRecommendBox('personal');
131
+ break;
132
+ case 'product':
133
+ $result[] = $this->createRecommendBox('upselling');
134
+ $result[] = $this->createRecommendBox('related');
135
+ break;
136
+ case 'cart':
137
+ $result[] = $this->createRecommendBox('crossselling');
138
+ break;
139
+ case 'category':
140
+ $result[] = $this->createRecommendBox('category_page');
141
+ break;
142
+ }
143
+
144
+ return $result;
145
+ }
146
+
147
+ private function createRecommendBox($id)
148
+ {
149
+ return array(
150
+ 'id' => $id,
151
+ 'title' => Mage::getStoreConfig("yoochoose/recommendation_blocks/{$id}_title"),
152
+ 'display' => !Mage::getStoreConfig("yoochoose/recommendation_blocks/{$id}_display"),
153
+ );
154
+ }
155
+
156
+ private function getPageProducts($page)
157
+ {
158
+ $result = array();
159
+
160
+ if ($page === 'product') {
161
+ $result[] = Mage::registry('current_product')->getId();
162
+ } else if ($page === 'cart') {
163
+ $cart = Mage::getModel('checkout/cart')->getQuote();
164
+ foreach ($cart->getAllItems() as $item) {
165
+ $result[] = $item->getProduct()->getId();
166
+ }
167
+ } else if ($page === 'category') {
168
+ $products = Mage::getSingleton('catalog/layer')->getProductCollection();
169
+ foreach ($products as $product) {
170
+ $result[] = $product->getId();
171
+ }
172
+ }
173
+
174
+ return implode(',', $result);
175
+ }
176
+ }
177
+
app/code/community/Yoochoose/JsTracking/Helper/Data.php ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Yoochoose_JsTracking_Helper_Data extends Mage_Core_Helper_Abstract
4
+ {
5
+
6
+ public function _getHttpPage($url, $body, $customerId, $licenceKey)
7
+ {
8
+ $bodyString = json_encode($body);
9
+ $options = array(
10
+ CURLOPT_URL => $url,
11
+ CURLOPT_HEADER => 0,
12
+ CURLOPT_CUSTOMREQUEST => "POST",
13
+ CURLOPT_RETURNTRANSFER => TRUE,
14
+ CURLOPT_FOLLOWLOCATION => TRUE,
15
+ CURLOPT_TIMEOUT => 10,
16
+ CURLOPT_HTTPAUTH => CURLAUTH_BASIC,
17
+ CURLOPT_USERPWD => "$customerId:$licenceKey",
18
+ CURLOPT_SSL_VERIFYPEER => FALSE,
19
+ CURLOPT_HTTPHEADER => array(
20
+ 'Content-Type: application/json',
21
+ 'Content-Length: ' . strlen($bodyString),
22
+ ),
23
+ CURLOPT_POSTFIELDS => $bodyString
24
+ );
25
+
26
+ $cURL = curl_init();
27
+ curl_setopt_array($cURL, $options);
28
+ $response = curl_exec($cURL);
29
+ $result = json_decode($response, true);
30
+
31
+ $eno = curl_errno($cURL);
32
+ if ($eno && $eno != 22) {
33
+ $msg = 'I/O error requesting [' . $url . ']. Code: ' . $eno . ". " . curl_error($cURL);
34
+ throw new Exception($msg);
35
+ }
36
+
37
+ $status = curl_getinfo($cURL, CURLINFO_HTTP_CODE);
38
+ switch ($status) {
39
+ case 200:
40
+ break;
41
+ case 409:
42
+ if ($result['faultCode'] === 'pluginAlreadyExistsFault') {
43
+ break;
44
+ }
45
+ default:
46
+ $msg = $result['faultMessage'] . ' With status code: ' . $status;
47
+ throw new Exception($msg);
48
+ }
49
+
50
+ curl_close($cURL);
51
+
52
+ return $result;
53
+ }
54
+
55
+ public function getModuleVersion()
56
+ {
57
+ return (string) Mage::getConfig()->getNode()->modules->Yoochoose_JsTracking->version;
58
+ }
59
+ }
app/code/community/{AvS/Yoochoose/Model/Source/Added.php → Yoochoose/JsTracking/Model/Adminhtml/Search/Catalog.php} RENAMED
@@ -1,57 +1,47 @@
1
- <?php
2
- /**
3
- * Magento
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
- *
15
- * DISCLAIMER
16
- *
17
- * Do not edit or add to this file if you wish to upgrade Magento to newer
18
- * versions in the future. If you wish to customize Magento for your
19
- * needs please refer to http://www.magentocommerce.com for more information.
20
- *
21
- * @category Mage
22
- * @package Mage_Adminhtml
23
- * @copyright Copyright (c) 2013 Magento Inc. (http://www.magentocommerce.com)
24
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
- */
26
-
27
- /**
28
- * Used in creating options for Yes|No config value selection
29
- *
30
- */
31
- class AvS_Yoochoose_Model_Source_Added {
32
-
33
- /**
34
- * Options getter
35
- *
36
- * @return array
37
- */
38
- public function toOptionArray() {
39
- return array(
40
- array('value' => 1, 'label'=>'Yoochoose recommendation'),
41
- array('value' => 0, 'label'=>'Disabled')
42
- );
43
- }
44
-
45
- /**
46
- * Get options in "key-value" format
47
- *
48
- * @return array
49
- */
50
- public function toArray(){
51
- return array(
52
- 1 => 'Yoochoose recommendation',
53
- 0 => 'Disabled'
54
- );
55
- }
56
-
57
- }
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Page
23
+ * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ require_once(Mage::getModuleDir('model','Mage_Adminhtml') . DS . 'Search' . DS . 'ResultController.php');
28
+
29
+ /**
30
+ * Yoochoose JS-Tracking Result Controller
31
+ *
32
+ * @category Yoochoose
33
+ * @package Yoochoose_JsTracking
34
+ * @author Yoochoose, yoochoose.net
35
+ */
36
+ class Yoochoose_JsTracking_Model_Adminhtml_Search_Catalog extends Mage_Adminhtml_Model_Search_Catalog
37
+ {
38
+ /**
39
+ * Load search results
40
+ *
41
+ * @return Mage_Adminhtml_Model_Search_Catalog
42
+ */
43
+ public function load()
44
+ {
45
+ return parent::load();
46
+ }
47
+ }
 
 
 
 
 
 
 
 
 
 
app/code/community/Yoochoose/JsTracking/Model/Api2/YCCategory.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Yoochoose_JsTracking_Model_Api2_YCCategory extends Mage_Api2_Model_Resource
4
+ {
5
+
6
+ }
app/code/community/Yoochoose/JsTracking/Model/Api2/YCCategory/Rest/Admin/V1.php ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Yoochoose_JsTracking_Model_Api2_YCCategory_Rest_Admin_V1 extends Yoochoose_JsTracking_Model_Api2_YCCategory
4
+ {
5
+
6
+ /**
7
+ * Retrieve list of categories.
8
+ *
9
+ * @return array
10
+ */
11
+ protected function _retrieveCollection()
12
+ {
13
+ $limit = $this->getRequest()->getParam('limit');
14
+ $offset = $this->getRequest()->getParam('offset');
15
+ $storeId = $this->_getStore()->getId();
16
+ $storeUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
17
+
18
+ /* @var $categoryCollection Mage_Catalog_Model_Resource_Category_Collection */
19
+ $categoryCollection = Mage::getResourceModel('catalog/category_collection')
20
+ ->setStoreId($storeId)
21
+ ->addAttributeToFilter('is_active', 1)
22
+ ->addAttributeToSelect(array('url_path', 'name', 'level'));
23
+
24
+ if ($limit && is_numeric($limit)) {
25
+ $offset = $offset ? $offset : 0;
26
+ $categoryCollection->getSelect()->limit($limit, $offset);
27
+ }
28
+
29
+ foreach ($categoryCollection as $category) {
30
+ $url = $category->getUrlPath();
31
+ $path = explode('.', $url);
32
+ $result[] = array(
33
+ 'id' => $category->getId(),
34
+ 'path' => $path[0],
35
+ 'url' => $storeUrl . $url,
36
+ 'name' => $category->getName(),
37
+ 'level' => $category->getLevel(),
38
+ 'parentId' => $category->getParentId(),
39
+ );
40
+ }
41
+
42
+ if (empty($result)) {
43
+ $this->getResponse()->setHeader('HTTP/1.0', '204', true);
44
+ }
45
+
46
+ return array('categories' => array($result));
47
+ }
48
+
49
+ }
app/code/community/Yoochoose/JsTracking/Model/Api2/YCProducts.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Yoochoose_JsTracking_Model_Api2_YCProducts extends Mage_Api2_Model_Resource
4
+ {
5
+
6
+ }
7
+
app/code/community/Yoochoose/JsTracking/Model/Api2/YCProducts/Rest/Admin/V1.php ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Yoochoose_JsTracking_Model_Api2_YCProducts_Rest_Admin_V1 extends Yoochoose_JsTracking_Model_Api2_YCProducts
4
+ {
5
+
6
+ /**
7
+ * Retrieve list of products.
8
+ *
9
+ * @return array
10
+ */
11
+ protected function _retrieveCollection()
12
+ {
13
+ $categoriesRel = array();
14
+ $products = array();
15
+ $limit = $this->getRequest()->getParam('limit');
16
+ $offset = $this->getRequest()->getParam('offset');
17
+ $storeId = $this->_getStore()->getId();
18
+ $helper = Mage::getModel('catalog/product_media_config');
19
+ $storeUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
20
+
21
+ /* @var $collection Mage_Catalog_Model_Resource_Product_Collection */
22
+ $collection = Mage::getResourceModel('catalog/product_collection');
23
+ $collection->setStoreId($storeId);
24
+ $collection->addFieldToFilter('visibility', array(
25
+ 'neq' => Mage_Catalog_Model_Product_Visibility::VISIBILITY_NOT_VISIBLE
26
+ )
27
+ );
28
+ $collection->getSelect()->reset(Zend_Db_Select::COLUMNS);
29
+ $collection->getSelect()->columns(array('e.entity_id'));
30
+ $collection->addAttributeToSelect(array('name', 'description', 'price', 'url_path', 'image', 'manufacturer', 'qty'));
31
+ if ($limit && is_numeric($limit)) {
32
+ $offset = $offset ? $offset : 0;
33
+ $collection->getSelect()->limit($limit, $offset);
34
+ }
35
+
36
+ foreach ($collection as $product) {
37
+ $id = $product->getId();
38
+ $manufacturer = $product->getAttributeText('manufacturer');
39
+ $temp = array(
40
+ 'entity_id' => $id,
41
+ 'name' => $product->getName(),
42
+ 'description' => $product->getDescription(),
43
+ 'price' => $product->getPrice(),
44
+ 'url' => $storeUrl . $product->getUrlPath(),
45
+ 'image' => $helper->getMediaUrl($product['image']),
46
+ 'manufacturer' => $manufacturer ? $manufacturer : null,
47
+ 'categories' => array(),
48
+ 'tags' => array(),
49
+ );
50
+ $imageInfo = getimagesize($temp['image']);
51
+ if (is_array($imageInfo)) {
52
+ $temp['image_size'] = $imageInfo[0] . 'x' . $imageInfo[1];
53
+ }
54
+
55
+ //Categories
56
+ foreach ($product->getCategoryCollection() as $category) {
57
+ $catId = end(explode('/', $category->getPath()));
58
+ if (!isset($categoriesRel[$catId])) {
59
+ $cat = Mage::getResourceModel('catalog/category_collection')
60
+ ->setStoreId($storeId)
61
+ ->addAttributeToSelect('url_path')
62
+ ->addFieldToFilter('entity_id', $catId)
63
+ ->getFirstItem();
64
+
65
+ $url = $cat->getUrlPath();
66
+ $path = explode('.', $url);
67
+ $categoriesRel[$catId] = $path[0];
68
+ }
69
+
70
+ $temp['categories'][] = $categoriesRel[$catId];
71
+ }
72
+
73
+ //Tags
74
+ $tags = Mage::getModel('tag/tag')->getCollection()->joinRel()->addProductFilter($temp['entity_id']);
75
+ $tags->addStoreFilter($storeId);
76
+ foreach ($tags as $tag) {
77
+ $temp['tags'][] = $tag->getName();
78
+ }
79
+
80
+ $products[$id] = $temp;
81
+ }
82
+
83
+ if (empty($products)) {
84
+ $this->getResponse()->setHeader('HTTP/1.0','204', true);
85
+ }
86
+
87
+ return array('products' => array($products));
88
+ }
89
+
90
+ }
app/code/community/Yoochoose/JsTracking/Model/Api2/YCStoreView.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Yoochoose_JsTracking_Model_Api2_YCStoreView extends Mage_Api2_Model_Resource
4
+ {
5
+
6
+ }
app/code/community/Yoochoose/JsTracking/Model/Api2/YCStoreView/Rest/Admin/V1.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Yoochoose_JsTracking_Model_Api2_YCStoreView_Rest_Admin_V1 extends Yoochoose_JsTracking_Model_Api2_YCStoreView
4
+ {
5
+
6
+ protected function getStoreRelations()
7
+ {
8
+ $result = array();
9
+ $stores = Mage::app()->getStores();
10
+ foreach ($stores as $store) {
11
+ Mage::app()->setCurrentStore($store['store_id']);
12
+ $lang = Mage::getStoreConfig('yoochoose/general/language', $store['store_id']);
13
+ if (Mage::getStoreConfig('yoochoose/general/language_country', $store['store_id'])) {
14
+ $lang = substr($lang, 0, strpos($lang, '_'));
15
+ }
16
+
17
+ $result[] = array(
18
+ 'id' => $store['store_id'],
19
+ 'name' => $store['name'],
20
+ 'item_type_id' => Mage::getStoreConfig('yoochoose/general/itemtypeid', $store['store_id']),
21
+ 'languange' => str_replace('_', '-', $lang),
22
+ );
23
+ }
24
+
25
+ if (empty($result)) {
26
+ $this->getResponse()->setHeader('HTTP/1.0', '204', true);
27
+ }
28
+
29
+ return array('views' => array($result));
30
+ }
31
+
32
+ /**
33
+ * Retrieve list of customers.
34
+ *
35
+ * @return array
36
+ */
37
+ protected function _retrieveCollection()
38
+ {
39
+ return $this->getStoreRelations();
40
+ }
41
+
42
+ }
app/code/community/Yoochoose/JsTracking/Model/Api2/YCSubscriber.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Yoochoose_JsTracking_Model_Api2_YCSubscriber extends Mage_Api2_Model_Resource
4
+ {
5
+
6
+ }
app/code/community/Yoochoose/JsTracking/Model/Api2/YCSubscriber/Rest/Admin/V1.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Yoochoose_JsTracking_Model_Api2_YCSubscriber_Rest_Admin_V1 extends Yoochoose_JsTracking_Model_Api2_YCSubscriber
4
+ {
5
+
6
+ /**
7
+ * Retrieve list of customers.
8
+ *
9
+ * @return array
10
+ */
11
+ protected function _retrieveCollection()
12
+ {
13
+ $limit = $this->getRequest()->getParam('limit');
14
+ $offset = $this->getRequest()->getParam('offset');
15
+ $collection = Mage::getResourceModel('newsletter/subscriber_collection');
16
+ $collection->getSelect()->reset(Zend_Db_Select::COLUMNS);
17
+ $collection->getSelect()->columns(array(
18
+ 'customer_id as id',
19
+ 'subscriber_id as subscriber_id',
20
+ 'subscriber_confirm_code as subscriber_code',
21
+ ));
22
+ $collection->getSelect()->where('customer_id != 0 AND subscriber_status = ' . Mage_Newsletter_Model_Subscriber::STATUS_SUBSCRIBED);
23
+
24
+ if ($limit && is_numeric($limit)) {
25
+ $offset = $offset ? $offset : 0;
26
+ $collection->getSelect()->limit($limit, $offset);
27
+ }
28
+
29
+ $subscribers = $collection->load()->toArray();
30
+
31
+ if (empty($subscribers['items'])) {
32
+ $this->getResponse()->setHeader('HTTP/1.0','204', true);
33
+ }
34
+
35
+ return array('subscribers' => array($subscribers['items']));
36
+ }
37
+
38
+ }
app/code/community/Yoochoose/JsTracking/Model/Observer.php ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Yoochoose_JsTracking_Model_Observer
4
+ {
5
+ const YOOCHOOSE_LICENSE_URL = 'https://admin.yoochoose.net/api/v4/';
6
+
7
+ protected $orderIds;
8
+
9
+ /**
10
+ * Applies the special price percentage discount
11
+ * @param Varien_Event_Observer $observer
12
+ * @return Yoochoose_JsTracking_Observer
13
+ */
14
+ public function trackBuy($observer)
15
+ {
16
+ $orderIds = $observer->getEvent()->getOrderIds();
17
+ if (empty($orderIds) || !is_array($orderIds)) {
18
+ return;
19
+ }
20
+
21
+ $block = Mage::app()->getFrontController()->getAction()->getLayout()->getBlock('head');
22
+ if ($block) {
23
+ $block->setOrderId(end($orderIds));
24
+ }
25
+ }
26
+
27
+ /**
28
+ *
29
+ * @param Varien_Event_Observer $observer
30
+ */
31
+ public function adminSystemConfigChangedSectionYoochoose($observer)
32
+ {
33
+ $customerId = Mage::getStoreConfig('yoochoose/general/customer_id');
34
+ $licenseKey = Mage::getStoreConfig('yoochoose/general/license_key');
35
+ $code = Mage::getSingleton('adminhtml/config_data')->getStore();
36
+ $scopeId = Mage::getModel('core/store')->load($code)->getId();
37
+ if ($scopeId === null) {
38
+ $scopeId = 0;
39
+ }
40
+
41
+ $scopeName = $scopeId === 0 ? 'default' : 'stores';
42
+ if (!$customerId && !$licenseKey) {
43
+ return;
44
+ }
45
+
46
+ try {
47
+ $body = array(
48
+ 'base' => array(
49
+ 'type' => 'MAGENTO',
50
+ 'pluginId' => Mage::getStoreConfig('yoochoose/general/plugin_id'),
51
+ 'endpoint' => Mage::getStoreConfig('yoochoose/general/endpoint'),
52
+ ),
53
+ 'frontend' => array(
54
+ 'design' => Mage::getStoreConfig('yoochoose/general/design'),
55
+ ));
56
+
57
+ $url = self::YOOCHOOSE_LICENSE_URL . $customerId . '/plugin/';
58
+ $url .= (Mage::getStoreConfig('yoochoose/general/endpoint_overwrite') ? 'update?createIfNeeded' : 'create?recheckType') . '=true&fallbackDesign=true';
59
+ Mage::getModel('core/config')->saveConfig('yoochoose/general/endpoint_overwrite', 0, $scopeName, $scopeId);
60
+
61
+ Mage::helper('yoochoose_jstracking')->_getHttpPage($url, $body, $customerId, $licenseKey);
62
+ Mage::log('Plugin registrated successfully', Zend_Log::INFO, 'yoochoose.log');
63
+ Mage::getSingleton('adminhtml/session')->addSuccess('Plugin registrated successfully');
64
+
65
+ } catch (Exception $ex) {
66
+ Mage::log($ex->getMessage(), Zend_Log::ERR, 'yoochoose.log');
67
+ Mage::throwException('Plugin registration failed: ' . $ex->getMessage());
68
+ }
69
+
70
+ }
71
+
72
+ /**
73
+ * Adds additional filters to search results
74
+ *
75
+ * @param Varien_Event_Observer $observer
76
+ */
77
+ public function filterParameters(Varien_Event_Observer $observer)
78
+ {
79
+ $manufacturerName = Mage::app()->getRequest()->getParam('manufacturer');
80
+ $block = Mage::app()->getLayout()->getBlock('search_result_list');
81
+ if ($block && $manufacturerName) {
82
+ $productModel = Mage::getModel('catalog/product');
83
+ $attr = $productModel->getResource()->getAttribute('manufacturer');
84
+ if ($attr->usesSource()) {
85
+ $manufacturerId = $attr->getSource()->getOptionId($manufacturerName);
86
+ }
87
+
88
+ $collection = $block->getLoadedProductCollection();
89
+ $collection->addAttributeToFilter('manufacturer', $manufacturerId);
90
+ }
91
+ }
92
+ }
app/code/community/Yoochoose/JsTracking/Model/RequiredValidation.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Yoochoose_JsTracking_Model_RequiredValidation extends Mage_Core_Model_Config_Data
4
+ {
5
+
6
+ public function save()
7
+ {
8
+ $value = trim($this->getValue());
9
+ $name = $this->getField();
10
+ if (empty($value)) {
11
+ Mage::throwException('Filed ' . $name . ' must not be empty.');
12
+ }
13
+
14
+ if ($name === 'itemtypeid') {
15
+ if (!filter_var($value, FILTER_VALIDATE_INT) || $value < 0) {
16
+ Mage::throwException('Filed ' . $name . ' must be an integer greater than 0.');
17
+ }
18
+ }
19
+
20
+ parent::save();
21
+ }
22
+
23
+ }
app/code/community/Yoochoose/JsTracking/Model/ScriptValidation.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Yoochoose_JsTracking_Model_ScriptValidation extends Mage_Core_Model_Config_Data
4
+ {
5
+ const SCRIPT_URL_REGEX = "/^(https:\/\/|http:\/\/|\/\/)?([a-zA-Z][\w\-]*)((\.[a-zA-Z][\w\-]*)*)(:\d+)?((\/[a-zA-Z][\w\-]*){0,2})(\/)?$/";
6
+
7
+ public function save()
8
+ {
9
+ if ($this->getValue() && !preg_match(self::SCRIPT_URL_REGEX, $this->getValue())) {
10
+ Mage::getSingleton('adminhtml/session')->addError('Unsupported URL type: (' . $this->getValue() . ')');
11
+ return;
12
+ }
13
+
14
+ parent::save();
15
+ }
16
+ }
app/code/community/Yoochoose/JsTracking/Model/System/Config/Source/DisplayRecommendation.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Yoochoose_JsTracking_Model_System_Config_Source_DisplayRecommendation
4
+ {
5
+
6
+ /**
7
+ * Options getter
8
+ *
9
+ * @return array
10
+ */
11
+ public function toOptionArray()
12
+ {
13
+ return array(
14
+ array(
15
+ 'label' => 'Deactivate',
16
+ 'value' => 1,
17
+ ),
18
+ array(
19
+ 'label' => 'Activate',
20
+ 'value' => 0,
21
+ ),
22
+ );
23
+ }
24
+ }
25
+
app/code/community/Yoochoose/JsTracking/Model/System/Config/Source/Languages.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Yoochoose_JsTracking_Model_System_Config_Source_Languages
4
+ {
5
+
6
+ /**
7
+ * Options getter
8
+ *
9
+ * @return array
10
+ */
11
+ public function toOptionArray()
12
+ {
13
+ return Mage::app()->getLocale()->getOptionLocales();
14
+ }
15
+
16
+ public function useCountryCode()
17
+ {
18
+ return array(
19
+ '1' => 'Do not use country code (e.g. "en")',
20
+ '0' => 'Use country code (e.g. "en_US")',
21
+ );
22
+ }
23
+ }
app/code/community/Yoochoose/JsTracking/Model/System/Config/Source/RenderSource.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Yoochoose_JsTracking_Model_System_Config_Source_RenderSource
4
+ {
5
+
6
+ /**
7
+ * Options getter
8
+ *
9
+ * @return array
10
+ */
11
+ public function toOptionArray()
12
+ {
13
+ return array(
14
+ array(
15
+ 'label' => 'Load scripts from the Amazon content delivery network (CDN)',
16
+ 'value' => 1,
17
+ ),
18
+ array(
19
+ 'label' => 'Load scripts directly from Yoochoose server',
20
+ 'value' => 0,
21
+ ),
22
+ );
23
+ }
24
+ }
25
+
app/code/community/Yoochoose/JsTracking/controllers/Adminhtml/YoochooseController.php ADDED
@@ -0,0 +1,143 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magentocommerce.com for more information.
21
+ *
22
+ * @category Mage
23
+ * @package Mage_Page
24
+ * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
25
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
26
+ */
27
+
28
+ /**
29
+ * Yoochoose JS-Tracking Adminhtml Controller
30
+ *
31
+ * @category Yoochoose
32
+ * @package Yoochoose_JsTracking
33
+ * @author Yoochoose, yoochoose.net
34
+ */
35
+ class Yoochoose_JsTracking_Adminhtml_YoochooseController extends Mage_Adminhtml_Controller_Action
36
+ {
37
+
38
+ /**
39
+ * Configures REST access for current user. Creates admin role if it does not exist and enables proper attributes.
40
+ */
41
+ public function configureAction()
42
+ {
43
+ $result = array();
44
+
45
+ try {
46
+ $fields = array(
47
+ 'ycstoreview' => 'views',
48
+ 'ycproducts' => 'products',
49
+ 'ycsubscriber' => 'subscribers',
50
+ 'yccategory' => 'categories',
51
+ 'customer' => 'website_id,created_at,created_in,entity_id,dob,'
52
+ . 'disable_auto_group_change,email,firstname,gender,group_id,'
53
+ . 'confirmation,last_logged_in,lastname,middlename,prefix,suffix,'
54
+ . 'taxvat,reward_update_notification,reward_warning_notification',
55
+ );
56
+
57
+ //creating oAuth consumer token
58
+ /* @var $oauthConsumer Mage_Oauth_Model_Consumer */
59
+ $oauthConsumer = Mage::getModel('oauth/consumer')->
60
+ getCollection()->
61
+ addFieldToFilter('name', 'Yoochoose-Consumer')->
62
+ getFirstItem();
63
+
64
+ if (!$oauthConsumer || !$oauthConsumer->getId()) {
65
+ $helper = Mage::helper('oauth');
66
+ $oauthConsumer = Mage::getModel('oauth/consumer');
67
+ $oauthConsumer->setName('Yoochoose-Consumer');
68
+ $oauthConsumer->setKey($helper->generateConsumerKey());
69
+ $oauthConsumer->setSecret($helper->generateConsumerSecret());
70
+ $oauthConsumer->save();
71
+ }
72
+
73
+ $result['consumerName'] = 'Yoochoose-Consumer';
74
+ $result['consumerKey'] = $oauthConsumer->getKey();
75
+ $result['consumerSecret'] = $oauthConsumer->getSecret();
76
+
77
+ $user = Mage::getSingleton('admin/session');
78
+ $userId = $user->getUser()->getUserId();
79
+ $apiRole = Mage::getModel('api2/acl_global_role')->getCollection()
80
+ ->addFilterByAdminId($userId)
81
+ ->getFirstItem();
82
+
83
+ if (!$apiRole || !$apiRole->getId()) {
84
+ $apiRole = Mage::getModel('api2/acl_global_role')->setRoleName('YoochooseRole')->save();
85
+ $resourceModel = Mage::getResourceModel('api2/acl_global_role');
86
+ $resourceModel->saveAdminToRoleRelation($userId, $apiRole->getId());
87
+ }
88
+
89
+ //setting rest role
90
+ $result['restRole'] = $apiRole->getRoleName();
91
+ $id = $apiRole->getId();
92
+ $rule = Mage::getModel('api2/acl_global_rule');
93
+ $ruleCollection = $rule->getCollection()
94
+ ->addFilterByRoleId($id)
95
+ ->addFieldToFilter('privilege', 'retrieve')
96
+ ->addFieldToFilter('resource_id', array('in' => array_keys($fields)));
97
+ foreach ($ruleCollection as $singleRule) {
98
+ $singleRule->delete();
99
+ }
100
+
101
+ foreach ($fields as $key => $value) {
102
+ $rule->setRoleId($id)->setResourceId($key)->setPrivilege('retrieve')->save();
103
+ $rule->setId(null)->isObjectNew(true);
104
+ }
105
+
106
+ //setting attributes
107
+ $attribute = Mage::getModel('api2/acl_filter_attribute');
108
+ $attributeCollection = $attribute->getCollection()
109
+ ->addFieldToFilter('user_type', 'admin')
110
+ ->addFieldToFilter('operation', 'read')
111
+ ->addFieldToFilter('resource_id', array('in' => array_keys($fields)));
112
+ foreach ($attributeCollection as $singleAttribute) {
113
+ $singleAttribute->delete();
114
+ }
115
+
116
+ foreach ($fields as $key => $value) {
117
+ $attribute->setUserType('admin')
118
+ ->setResourceId($key)
119
+ ->setOperation('read')
120
+ ->setAllowedAttributes($value)
121
+ ->save();
122
+ $attribute->setId(null)->isObjectNew(true);
123
+ }
124
+
125
+ //saving configuration
126
+ $configModel = Mage::getModel('core/config');
127
+ $configModel->saveConfig('yoochoose/data_export/rest_role', $result['restRole'], 'default', 0);
128
+ $configModel->saveConfig('yoochoose/data_export/consumer_name', $result['consumerName'], 'default', 0);
129
+ $configModel->saveConfig('yoochoose/data_export/consumer_key', $result['consumerKey'], 'default', 0);
130
+ $configModel->saveConfig('yoochoose/data_export/consumer_secret', $result['consumerSecret'], 'default', 0);
131
+ $result['success'] = true;
132
+ $result['message'] = 'Configured successfully';
133
+
134
+ } catch (Exception $exc) {
135
+ $result['success'] = false;
136
+ $result['message'] = $exc->getMessage();
137
+ Mage::log($exc->getMessage(), Zend_Log::ERR, 'yoochoose.log');
138
+ }
139
+
140
+ Mage::app()->getResponse()->setBody(json_encode($result));
141
+ }
142
+
143
+ }
app/code/community/Yoochoose/JsTracking/controllers/ProductsController.php ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magentocommerce.com for more information.
21
+ *
22
+ * @category Mage
23
+ * @package Mage_Page
24
+ * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
25
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
26
+ */
27
+
28
+ /**
29
+ * Yoochoose JS-Tracking Products Controller
30
+ *
31
+ * @category Yoochoose
32
+ * @package Yoochoose_JsTracking
33
+ * @author Yoochoose, yoochoose.net
34
+ */
35
+ class Yoochoose_JsTracking_ProductsController extends Mage_Core_Controller_Front_Action
36
+ {
37
+
38
+ public function indexAction()
39
+ {
40
+ $productIds = $this->getRequest()->getParam('productIds');
41
+
42
+ $helper = Mage::getModel('catalog/product_media_config');
43
+ $storeUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
44
+ $priceHelper = Mage::helper('core');
45
+ $storeId = Mage::app()->getStore('default')->getId();
46
+ $attributes = array('name', 'thumbnail', 'price', 'url_path');
47
+ $collection = Mage::getResourceModel('catalog/product_collection')->
48
+ setStoreId($storeId)->
49
+ addAttributeToSelect($attributes)->
50
+ addFinalPrice()->
51
+ addAttributeToFilter('status', array('eq' => Mage_Catalog_Model_Product_Status::STATUS_ENABLED))->
52
+ addAttributeToFilter('entity_id', array('in' => explode(',', $productIds)));
53
+
54
+ $collection->getSelect()->reset(Zend_Db_Select::COLUMNS);
55
+ $collection->getSelect()->columns(array('e.entity_id'));
56
+ $products = $collection->load()->toArray();
57
+
58
+ foreach ($products as &$product) {
59
+ unset($product['stock_item']);
60
+ $product['url_path'] = $storeUrl . $product['url_path'];
61
+ $product['thumbnail'] = $helper->getMediaUrl($product['thumbnail']);
62
+ $product['price'] = $priceHelper->currency($product['price'], true, false);
63
+ }
64
+
65
+ header('Content-Type: application/json;');
66
+ exit(json_encode(array_values($products)));
67
+ }
68
+
69
+ }
app/code/community/Yoochoose/JsTracking/controllers/ResultController.php ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magentocommerce.com for more information.
21
+ *
22
+ * @category Mage
23
+ * @package Mage_Page
24
+ * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
25
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
26
+ */
27
+
28
+ require_once(Mage::getModuleDir('controllers','Mage_CatalogSearch') . DS . 'ResultController.php');
29
+
30
+ /**
31
+ * Yoochoose JS-Tracking Result Controller
32
+ *
33
+ * @category Yoochoose
34
+ * @package Yoochoose_JsTracking
35
+ * @author Yoochoose, yoochoose.net
36
+ */
37
+ class Yoochoose_JsTracking_ResultController extends Mage_CatalogSearch_ResultController
38
+ {
39
+ /**
40
+ * Display search result
41
+ */
42
+ public function indexAction()
43
+ {
44
+
45
+ parent::indexAction();
46
+ }
47
+ }
app/code/community/Yoochoose/JsTracking/etc/adminhtml.xml ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <acl>
4
+ <resources>
5
+ <all>
6
+ <title>Allow Everything</title>
7
+ </all>
8
+ <admin>
9
+ <children>
10
+ <system>
11
+ <children>
12
+ <config>
13
+ <children>
14
+ <yoochoose translate="title">
15
+ <title>Yoochoose Section</title>
16
+ <sort_order>100</sort_order>
17
+ </yoochoose>
18
+ </children>
19
+ </config>
20
+ </children>
21
+ </system>
22
+ </children>
23
+ </admin>
24
+ </resources>
25
+ </acl>
26
+ </config>
app/code/community/Yoochoose/JsTracking/etc/api2.xml ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+
3
+ <config>
4
+ <api2>
5
+ <resource_groups>
6
+ <yoochoose translate="title" module="Yoochoose_JsTracking">
7
+ <title>Yoochoose</title>
8
+ <sort_order>5</sort_order>
9
+ </yoochoose>
10
+ </resource_groups>
11
+ <resources>
12
+ <ycsubscriber translate="title" module="api2">
13
+ <group>yoochoose</group>
14
+ <sort_order>10</sort_order>
15
+ <model>yoochoose_jstracking/api2_yCSubscriber</model>
16
+ <title>Subscribers</title>
17
+ <privileges>
18
+ <admin>
19
+ <retrieve>1</retrieve>
20
+ </admin>
21
+ </privileges>
22
+ <attributes translate="subscribers" module="api2">
23
+ <subscribers>Subscribers</subscribers>
24
+ </attributes>
25
+ <routes>
26
+ <route_collection>
27
+ <route>/yoochoose/customers</route>
28
+ <action_type>collection</action_type>
29
+ </route_collection>
30
+ </routes>
31
+ <versions>1</versions>
32
+ </ycsubscriber>
33
+ <ycproducts translate="title" module="api2">
34
+ <group>yoochoose</group>
35
+ <sort_order>10</sort_order>
36
+ <model>yoochoose_jstracking/api2_yCProducts</model>
37
+ <title>Products</title>
38
+ <privileges>
39
+ <admin>
40
+ <retrieve>1</retrieve>
41
+ </admin>
42
+ </privileges>
43
+ <attributes translate="products" module="api2">
44
+ <products>Products</products>
45
+ </attributes>
46
+ <routes>
47
+ <route_collection>
48
+ <route>/yoochoose/products</route>
49
+ <action_type>collection</action_type>
50
+ </route_collection>
51
+ </routes>
52
+ <versions>1</versions>
53
+ </ycproducts>
54
+ <ycstoreview translate="title" module="api2">
55
+ <group>yoochoose</group>
56
+ <sort_order>10</sort_order>
57
+ <model>yoochoose_jstracking/api2_yCStoreView</model>
58
+ <title>Store Views</title>
59
+ <privileges>
60
+ <admin>
61
+ <retrieve>1</retrieve>
62
+ </admin>
63
+ </privileges>
64
+ <attributes translate="views" module="api2">
65
+ <views>Store Views</views>
66
+ </attributes>
67
+ <routes>
68
+ <route_collection>
69
+ <route>/yoochoose/storeviews</route>
70
+ <action_type>collection</action_type>
71
+ </route_collection>
72
+ </routes>
73
+ <versions>1</versions>
74
+ </ycstoreview>
75
+ <yccategory translate="title" module="api2">
76
+ <group>yoochoose</group>
77
+ <sort_order>10</sort_order>
78
+ <model>yoochoose_jstracking/api2_yCCategory</model>
79
+ <title>Categories</title>
80
+ <privileges>
81
+ <admin>
82
+ <retrieve>1</retrieve>
83
+ </admin>
84
+ </privileges>
85
+ <attributes translate="categories" module="api2">
86
+ <categories>Categories</categories>
87
+ </attributes>
88
+ <routes>
89
+ <route_collection>
90
+ <route>/yoochoose/categories</route>
91
+ <action_type>collection</action_type>
92
+ </route_collection>
93
+ </routes>
94
+ <versions>1</versions>
95
+ </yccategory>
96
+ </resources>
97
+ </api2>
98
+ </config>
app/code/community/Yoochoose/JsTracking/etc/config.xml ADDED
@@ -0,0 +1,138 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <config>
3
+ <modules>
4
+ <Yoochoose_JsTracking>
5
+ <version>2.0.0</version>
6
+ </Yoochoose_JsTracking>
7
+ </modules>
8
+ <global>
9
+ <models>
10
+ <yoochoose_jstracking>
11
+ <class>Yoochoose_JsTracking_Model</class>
12
+ </yoochoose_jstracking>
13
+ <adminhtml>
14
+ <rewrite>
15
+ <search_catalog>Yoochoose_JsTracking_Model_Adminhtml_Search_Catalog</search_catalog>
16
+ </rewrite>
17
+ </adminhtml>
18
+ </models>
19
+ <helpers>
20
+ <yoochoose_jstracking>
21
+ <class>Yoochoose_JsTracking_Helper</class>
22
+ </yoochoose_jstracking>
23
+ </helpers>
24
+
25
+ <blocks>
26
+ <yoochoose_jstracking>
27
+ <class>Yoochoose_JsTracking_Block</class>
28
+ </yoochoose_jstracking>
29
+ </blocks>
30
+ </global>
31
+ <frontend>
32
+ <routers>
33
+ <yoochoose>
34
+ <use>standard</use>
35
+ <args>
36
+ <module>Yoochoose_JsTracking</module>
37
+ <frontName>yoochoose</frontName>
38
+ </args>
39
+ </yoochoose>
40
+ <catalogsearch>
41
+ <args>
42
+ <modules>
43
+ <Yoochoose_JsTracking before="Mage_CatalogSearch">Yoochoose_JsTracking</Yoochoose_JsTracking>
44
+ </modules>
45
+ </args>
46
+ </catalogsearch>
47
+ </routers>
48
+ <events>
49
+ <checkout_onepage_controller_success_action>
50
+ <observers>
51
+ <checkout_finish>
52
+ <type>singleton</type>
53
+ <class>Yoochoose_JsTracking_Model_Observer</class>
54
+ <method>trackBuy</method>
55
+ </checkout_finish>
56
+ </observers>
57
+ </checkout_onepage_controller_success_action>
58
+ <controller_action_layout_render_before_catalogsearch_result_index>
59
+ <observers>
60
+ <stackexchange_catalogsearch>
61
+ <type>singleton</type>
62
+ <class>Yoochoose_JsTracking_Model_Observer</class>
63
+ <method>filterParameters</method>
64
+ </stackexchange_catalogsearch>
65
+ </observers>
66
+ </controller_action_layout_render_before_catalogsearch_result_index>
67
+ </events>
68
+ <layout>
69
+ <updates>
70
+ <yoochoose_jstracking module="Yoochoose_JsTracking">
71
+ <file>yoochoose_jstracking.xml</file>
72
+ </yoochoose_jstracking>
73
+ </updates>
74
+ </layout>
75
+ </frontend>
76
+
77
+ <admin>
78
+ <routers>
79
+ <adminhtml>
80
+ <args>
81
+ <modules>
82
+ <yoochoose after="Mage_Adminhtml">Yoochoose_JsTracking</yoochoose>
83
+ </modules>
84
+ </args>
85
+ </adminhtml>
86
+ </routers>
87
+ </admin>
88
+
89
+ <adminhtml>
90
+ <events>
91
+ <admin_system_config_changed_section_yoochoose>
92
+ <observers>
93
+ <yoochoose>
94
+ <type>singleton</type>
95
+ <class>Yoochoose_JsTracking_Model_Observer</class>
96
+ <method>adminSystemConfigChangedSectionYoochoose</method>
97
+ </yoochoose>
98
+ </observers>
99
+ </admin_system_config_changed_section_yoochoose>
100
+ </events>
101
+ <acl>
102
+ <resources>
103
+ <admin>
104
+ <children>
105
+ <system>
106
+ <children>
107
+ <config>
108
+ <children>
109
+ <yoochoose>
110
+ <title>Yoochoose</title>
111
+ </yoochoose>
112
+ </children>
113
+ </config>
114
+ </children>
115
+ </system>
116
+ </children>
117
+ </admin>
118
+ </resources>
119
+ </acl>
120
+ </adminhtml>
121
+
122
+ <default>
123
+ <yoochoose>
124
+ <general>
125
+ <itemtypeid>1</itemtypeid>
126
+ <language_country>1</language_country>
127
+ </general>
128
+ <recommendation_blocks>
129
+ <personal_title>Recommendations for You</personal_title>
130
+ <bestseller_title>Bestsellers</bestseller_title>
131
+ <related_title>Related products</related_title>
132
+ <upselling_title>You may also be interested in the following products</upselling_title>
133
+ <category_page_title>Recommendation in %</category_page_title>
134
+ <crossselling_title>You may also be interested in the following products</crossselling_title>
135
+ </recommendation_blocks>
136
+ </yoochoose>
137
+ </default>
138
+ </config>
app/code/community/Yoochoose/JsTracking/etc/config.xml.orig ADDED
@@ -0,0 +1,138 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <config>
3
+ <modules>
4
+ <Yoochoose_JsTracking>
5
+ <version>2.0.0</version>
6
+ </Yoochoose_JsTracking>
7
+ </modules>
8
+ <global>
9
+ <models>
10
+ <yoochoose_jstracking>
11
+ <class>Yoochoose_JsTracking_Model</class>
12
+ </yoochoose_jstracking>
13
+ <adminhtml>
14
+ <rewrite>
15
+ <search_catalog>Yoochoose_JsTracking_Model_Adminhtml_Search_Catalog</search_catalog>
16
+ </rewrite>
17
+ </adminhtml>
18
+ </models>
19
+ <helpers>
20
+ <yoochoose_jstracking>
21
+ <class>Yoochoose_JsTracking_Helper</class>
22
+ </yoochoose_jstracking>
23
+ </helpers>
24
+
25
+ <blocks>
26
+ <yoochoose_jstracking>
27
+ <class>Yoochoose_JsTracking_Block</class>
28
+ </yoochoose_jstracking>
29
+ </blocks>
30
+ </global>
31
+ <frontend>
32
+ <routers>
33
+ <yoochoose>
34
+ <use>standard</use>
35
+ <args>
36
+ <module>Yoochoose_JsTracking</module>
37
+ <frontName>yoochoose</frontName>
38
+ </args>
39
+ </yoochoose>
40
+ <catalogsearch>
41
+ <args>
42
+ <modules>
43
+ <Yoochoose_JsTracking before="Mage_CatalogSearch">Yoochoose_JsTracking</Yoochoose_JsTracking>
44
+ </modules>
45
+ </args>
46
+ </catalogsearch>
47
+ </routers>
48
+ <events>
49
+ <checkout_onepage_controller_success_action>
50
+ <observers>
51
+ <checkout_finish>
52
+ <type>singleton</type>
53
+ <class>Yoochoose_JsTracking_Model_Observer</class>
54
+ <method>trackBuy</method>
55
+ </checkout_finish>
56
+ </observers>
57
+ </checkout_onepage_controller_success_action>
58
+ <controller_action_layout_render_before_catalogsearch_result_index>
59
+ <observers>
60
+ <stackexchange_catalogsearch>
61
+ <type>singleton</type>
62
+ <class>Yoochoose_JsTracking_Model_Observer</class>
63
+ <method>filterParameters</method>
64
+ </stackexchange_catalogsearch>
65
+ </observers>
66
+ </controller_action_layout_render_before_catalogsearch_result_index>
67
+ </events>
68
+ <layout>
69
+ <updates>
70
+ <yoochoose_jstracking module="Yoochoose_JsTracking">
71
+ <file>yoochoose_jstracking.xml</file>
72
+ </yoochoose_jstracking>
73
+ </updates>
74
+ </layout>
75
+ </frontend>
76
+
77
+ <admin>
78
+ <routers>
79
+ <adminhtml>
80
+ <args>
81
+ <modules>
82
+ <yoochoose after="Mage_Adminhtml">Yoochoose_JsTracking</yoochoose>
83
+ </modules>
84
+ </args>
85
+ </adminhtml>
86
+ </routers>
87
+ </admin>
88
+
89
+ <adminhtml>
90
+ <events>
91
+ <admin_system_config_changed_section_yoochoose>
92
+ <observers>
93
+ <yoochoose>
94
+ <type>singleton</type>
95
+ <class>Yoochoose_JsTracking_Model_Observer</class>
96
+ <method>adminSystemConfigChangedSectionYoochoose</method>
97
+ </yoochoose>
98
+ </observers>
99
+ </admin_system_config_changed_section_yoochoose>
100
+ </events>
101
+ <acl>
102
+ <resources>
103
+ <admin>
104
+ <children>
105
+ <system>
106
+ <children>
107
+ <config>
108
+ <children>
109
+ <yoochoose>
110
+ <title>Yoochoose</title>
111
+ </yoochoose>
112
+ </children>
113
+ </config>
114
+ </children>
115
+ </system>
116
+ </children>
117
+ </admin>
118
+ </resources>
119
+ </acl>
120
+ </adminhtml>
121
+
122
+ <default>
123
+ <yoochoose>
124
+ <general>
125
+ <itemtypeid>1</itemtypeid>
126
+ <language_country>1</language_country>
127
+ </general>
128
+ <recommendation_blocks>
129
+ <personal_title>Recommendations for You</personal_title>
130
+ <bestseller_title>Bestsellers</bestseller_title>
131
+ <related_title>Related products</related_title>
132
+ <upselling_title>You may also be interested in the following products</upselling_title>
133
+ <category_page_title>Recommendation in %</category_page_title>
134
+ <crossselling_title>You may also be interested in the following products</crossselling_title>
135
+ </recommendation_blocks>
136
+ </yoochoose>
137
+ </default>
138
+ </config>
app/code/community/Yoochoose/JsTracking/etc/system.xml ADDED
@@ -0,0 +1,391 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+
3
+ <config>
4
+ <sections>
5
+ <yoochoose translate="label" module="yoochoose_jstracking">
6
+ <label>
7
+ <![CDATA[<img style="width: 16px; margin-left: -5px; margin-right: 5px; vertical-align: bottom;" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAhCAYAAAAswACjAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAB3RJTUUH3wYMBiQ5QEpbXgAACCFJREFUSMdtVWuMXVUV/r61zzn3MXPneaGldErHllYK5VGoPGwL1RpeRjQ8BH8ZIWiK/FAeMZEEokJUNJqADYSgBYIgIlBQTCnttFQKNC2DQh8Ifcx0Zui0nenM3Dt37j3n7L38cc5Mb0d2crJz991nfedb6/vWItIV9Q4A1gIgIDQAlJ7nzKxTER/6rBOq5wGYAyALYAzEpwA/gHPH4BxgjAGgABwAQAi/YxaQREwBmP50zsCIhSID524GcBuAJQDy+P81BGALiDU6PrGR2QwhInDOAgA8D37HaWDUOwAaA4UCsfUAxCCXQ/UJAAsBKFSJz1sk0q8ngDdAfh/AQagaqCZARsCopx8ax6DnGQAWwB0AHgUAqCpA0hPAmCrIUQAxgAyca1FrPViXAJEEMALiRijeBDAZLwGpO1gN4A9QdSCFmWAAznVFA0d6wp4BZ0fGAo2tYSaIvGJrlOmcnTXFlkWwukLDsJCyCwFcC6RAhGXU029AWIDLodoFVcPAH9Yofmps/b9Gov7BywAsgUgRJElAFYBzMZzrgzHv5c6e392w7MLFiOMbNbYByKMgLwGwH4AwHjwGqBqthe9C9SLJZbeV3+l+vrJz1y0S+JfCmKQmqkn2Un0wUSEAQqPYaWz/1vKNle/6s2f+UGthJ8hXoPotAJKki/g2nD4v+dzfh599dasdLd/PwM+rtUqS9H2I50/AmKQmqlm1tkWjyHNxBJIKEWq1djB7zpkPN65Y+gOt1hZDZCWAzQz394LkZsnnThl+9rUnbbnyGxoSIExDY79au7n83109Yx/tdLXD/RkXhWLyDXF+zhfCpnOXZvMdnYs0jlfYiUoBQmgtGsoumndf44qlv9JqbT0UN7G2Z1+HaW7cUnl/9yOVHR/eR89rk1x+yIXVpw8+/vBo6eC+LwO4gECxXscKWAX6CLxXvOyK7tNvuvUcV6vdqHEYuGq4p+Wbq572ZxTvtKXyOYx6+68H+dVjj/3lDMlnrvEKzW8PvPT0C4c3r7/FkJdIKk9NCqInfEFJRKBwqk6Bl+fdftc7hbPOu8OOlzo1jNcWV38n6yrVP5ufPfTgGaU3thXt8dFb/da21/c8ePeGsV0f/NwT6QRgoTppxslHkl1TH8GRpBE5e2jHtoVxefS3rUsunWsrlVXiey9lF8w9Lshmt9UOHPqK39L60Z5f3NUVDn72SyOSU+csVE3qIaYMbGpGW+d0A1VR52JPzBnH3t70wKG//ulRv7llpPKfvRexubDD3B43nuoXmu8c3PjaE6Pd2+8zIll1TtPgk23DpQzqH6Zgkt4TqFojpqHUs29+YcGiNZmW9utGN239nfiFpoudjdcP/OPFrxmRFk2am0wBkArSgByiMa/TmLU0Zj3IkfTc1enBqLOxRy789NGHvshMdqvQWya5ufPH+19cOyLAlarqTmJAUoFQjXmgffmKBRnPvza29nu09qqWpV9aqCK/1oSl1gF5qV9vOLJh3SfZWR1Z6GfatiWT3dAFaBcQp7t2kboRCHcsW36PqjaoKmoHeggAE7s/ZqIHbd6+5MIHNgKui9Spd9M4bzUWXrLbe+fxrUJhlh0f/xDOtU0Vk7RJDwvWXl6ptUcHD14BMffT8zYBOgKwTeP4Sqje73d0vNIViBC4Ka2RmYojMpCZedq5onG8CKptdWpJcgu44tXXvKzHRy6EmAKN+S1Uu6H4BKrv05iHAGa1XF5SOP/8FzTpwJO1ZDoqZkXHj58tau3pSVudyuvk3ts0e3ExOjb8jGQCwDlCFVD1Egc6Si4TRf2Dz7Wff3k7gME6qQOAgyrUxp1CMjstuJKEA4aCmTNWHX/hnxe7SvVuyecO0PMIY0DfozTkP46HR+8ZefmNq7KzOy61wHAyt+o7DwDnmjxVHT2J4on91HDo6JvZmaffMvzMunbvlLbncucutNKYz9qx8sTEv/dm7PDoamloWFDt/XQDga9PH87pEKt6FDmgpEJ1Kp+qqgJ0HHnz1dLc2+7qdVG42I6WFpc2vTsO1TKEBXpeHr6ByeX3HtmwzglQTC1woi4kKNInXkvLHpC9J1FUVZIY+aj7unh87HEJslDnwMBvYCaYQd/Pq7Mw2byrDvY9We7ZfwMp6cicikMAowyC3VI9fHiMIl1TxTrRIpwhl+766eqL49LIT/yW1v3iB6DnqfgB/Nb2j6uDfffuffDeKw25COrqWTgAoMiOiVKph1uCADBmuatW38LJdJPLpFjV3fmZs9YVL7/KBm3FTO3oYPVo1+uZ6tDR6w0573PeiwF4DILvIo6f4obkT+d73osax9dPXqgHIkmnSgdUAJQINBHIMamlTgOwAAyN+TB/1lkXkQy5JZcT8Tyn5BxbLm+HczPqnFvPSElOnamqTcUybWBCQYpkMqtg7UYFjABwtlo1rlLplSC4GWQ1BYjrXhaoGnUO6pyqc0hnDacxsCCFvv8jV61udFFkwiiy4uIYzjkL0sDazZLNXg2R4TRlk0OqvstO//LJOwakR9//sQvD3ytgrlC1BgC3dXSgcugQAMALAiOeZ2HMHFepPKbOXZ3mfLJduGlgMilXiuxjJnO7m5jYBBEv39ER0zmElUryVVubm1EdTYzvB4GphaErA1rM5VZqGK5W51YCaK/zQQrDCZLd8Lw/+m1tz1KkWjt61GSamqw6BxvHWFEqnaC+bfZs1Pr6kgJkMmLDkLGq9QF4ra3trlK5QJ2bD9UmADWKHGIQfHDmI4/s71uzBmM7d4oxhuNRZEMAp7S3Y9nQEADgf8hRLruPEQ0OAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDE1LTA2LTEyVDA2OjM2OjU3LTA0OjAwTE/ABwAAACV0RVh0ZGF0ZTptb2RpZnkAMjAxNS0wNi0xMlQwNjozNjo1Ny0wNDowMD0SeLsAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAAASUVORK5CYII="/> Yoochoose Recommendations]]>
8
+ </label>
9
+ <tab>service</tab>
10
+ <frontend_type>text</frontend_type>
11
+ <sort_order>1000</sort_order>
12
+ <show_in_default>1</show_in_default>
13
+ <show_in_website>1</show_in_website>
14
+ <show_in_store>1</show_in_store>
15
+ <groups>
16
+ <general>
17
+ <label>General Settings</label>
18
+ <sort_order>5</sort_order>
19
+ <frontend_type>text</frontend_type>
20
+ <show_in_default>1</show_in_default>
21
+ <show_in_website>1</show_in_website>
22
+ <show_in_store>1</show_in_store>
23
+ <fields>
24
+ <click_here>
25
+ <label>If you don't have a Customer ID yet, please</label>
26
+ <frontend_type>button</frontend_type>
27
+ <frontend_model>yoochoose_jstracking/field_register</frontend_model>
28
+ <sort_order>5</sort_order>
29
+ <show_in_default>1</show_in_default>
30
+ <show_in_website>1</show_in_website>
31
+ <show_in_store>1</show_in_store>
32
+ <comment><![CDATA[Please visit <a href='https://www.yoochoose.com' target='_blank'>
33
+ Yoochoose website</a> for information to pricing, data privacy and terms of service.]]></comment>
34
+ </click_here>
35
+ <customer_id translate="label">
36
+ <label>Customer ID</label>
37
+ <frontend_type>text</frontend_type>
38
+ <backend_model>yoochoose_jstracking/requiredValidation</backend_model>
39
+ <sort_order>10</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
+ <validate>validate-alphanum</validate>
44
+ </customer_id>
45
+ <license_key translate="label">
46
+ <label>License Key</label>
47
+ <comment><![CDATA[
48
+ You can find your license key and detailed statistics on the <a id="ycLicenceLink"
49
+ href='https://admin.yoochoose.net?customer_id={{mandator_id}}#plugin/configuration{{plugin-id}}'
50
+ target='_blank'>Yoochoose Configuration Backend</a>.
51
+ <script>
52
+ window.onload = function(){
53
+ var link = document.getElementById('ycLicenceLink'),
54
+ mandator = document.getElementById('yoochoose_general_customer_id').value,
55
+ plugin = document.getElementById('yoochoose_general_plugin_id').value;
56
+
57
+ link.href = link.href.replace('{{mandator_id}}', mandator);
58
+ plugin = (plugin ? '/' + plugin : '');
59
+ link.href = link.href.replace('{{plugin-id}}', plugin);
60
+ };
61
+ </script>
62
+ ]]></comment>
63
+ <frontend_type>text</frontend_type>
64
+ <backend_model>yoochoose_jstracking/requiredValidation</backend_model>
65
+ <sort_order>15</sort_order>
66
+ <show_in_default>1</show_in_default>
67
+ <show_in_website>1</show_in_website>
68
+ <show_in_store>1</show_in_store>
69
+ </license_key>
70
+ <plugin_id>
71
+ <label>Plugin ID</label>
72
+ <comment>(optional) If all you shop views have the same design, leave it blank.</comment>
73
+ <frontend_type>text</frontend_type>
74
+ <sort_order>20</sort_order>
75
+ <show_in_default>1</show_in_default>
76
+ <show_in_website>1</show_in_website>
77
+ <show_in_store>1</show_in_store>
78
+ </plugin_id>
79
+ <endpoint>
80
+ <label>Endpoint</label>
81
+ <sort_order>25</sort_order>
82
+ <frontend_type>text</frontend_type>
83
+ <frontend_model>yoochoose_jstracking/field_readonly</frontend_model>
84
+ <show_in_default>1</show_in_default>
85
+ <show_in_website>1</show_in_website>
86
+ <show_in_store>1</show_in_store>
87
+ <validate>validate-url</validate>
88
+ </endpoint>
89
+ <design>
90
+ <label>Design</label>
91
+ <comment><![CDATA[We will try to find a design template for you shop. Please read
92
+ <a href="https://www.yoochoose.com/magento-connect-2-tutorial"
93
+ target="_blank">Magento Connect Extention Tutorial</a>, if you need to customize
94
+ the desing of the recommendations.]]></comment>
95
+ <sort_order>26</sort_order>
96
+ <frontend_type>text</frontend_type>
97
+ <frontend_model>yoochoose_jstracking/field_readonly</frontend_model>
98
+ <show_in_default>1</show_in_default>
99
+ <show_in_website>1</show_in_website>
100
+ <show_in_store>1</show_in_store>
101
+ <validate>validate-alphanum</validate>
102
+ </design>
103
+ <endpoint_overwrite>
104
+ <comment><![CDATA[Overwrite endpoint and design configuration,
105
+ if exists (it happens once, as you clicks "Save")
106
+ <script>
107
+ (function (){
108
+ document.getElementById('yoochoose_general_endpoint_overwrite').onchange = function (e){
109
+ var value = e.target.value == 1 ? false : true;
110
+ document.getElementById('yoochoose_general_endpoint').readOnly = value;
111
+ document.getElementById('yoochoose_general_design').readOnly = value;
112
+ };
113
+ })();</script>
114
+ ]]></comment>
115
+ <sort_order>30</sort_order>
116
+ <frontend_type>select</frontend_type>
117
+ <source_model>adminhtml/system_config_source_yesno</source_model>
118
+ <show_in_default>1</show_in_default>
119
+ <show_in_website>1</show_in_website>
120
+ <show_in_store>1</show_in_store>
121
+ </endpoint_overwrite>
122
+ <itemtypeid translate="label">
123
+ <label>Item type</label>
124
+ <comment><![CDATA[In the most cases the item type must be set to 1.
125
+ If more than one type is needed or if more, than one
126
+ shop language is supported, please read the
127
+ <a href="http://doc.yoochoose.net/" target="_blank" >User Guide</a>.]]>
128
+ </comment>
129
+ <frontend_type>text</frontend_type>
130
+ <sort_order>50</sort_order>
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
+ <backend_model>yoochoose_jstracking/requiredValidation</backend_model>
135
+ <validate>validate-not-negative-number</validate>
136
+ </itemtypeid>
137
+ <language translate="label">
138
+ <label>Language</label>
139
+ <frontend_type>select</frontend_type>
140
+ <frontend_model>yoochoose_jstracking/field_language</frontend_model>
141
+ <source_model>yoochoose_jstracking/system_config_source_languages</source_model>
142
+ <sort_order>60</sort_order>
143
+ <show_in_default>1</show_in_default>
144
+ <show_in_website>1</show_in_website>
145
+ <show_in_store>1</show_in_store>
146
+ </language>
147
+ <language_country>
148
+ <comment><![CDATA[Include the country code into the language.]]></comment>
149
+ <sort_order>65</sort_order>
150
+ <frontend_type>select</frontend_type>
151
+ <source_model>yoochoose_jstracking/system_config_source_languages::useCountryCode</source_model>
152
+ <show_in_default>1</show_in_default>
153
+ <show_in_website>1</show_in_website>
154
+ <show_in_store>1</show_in_store>
155
+ </language_country>
156
+ </fields>
157
+ </general>
158
+
159
+ <advanced>
160
+ <label>Script Endpoint</label>
161
+ <sort_order>6</sort_order>
162
+ <frontend_type>text</frontend_type>
163
+ <show_in_default>1</show_in_default>
164
+ <show_in_website>1</show_in_website>
165
+ <show_in_store>1</show_in_store>
166
+ <fields>
167
+ <performance translate="label">
168
+ <label>Performance</label>
169
+ <comment><![CDATA[CDN mode provide better performance
170
+ but takes about a 30 minutes, if the configuration is updated.
171
+ Please switch to CDN only, if the configuration is
172
+ done and stable.]]></comment>
173
+ <sort_order>10</sort_order>
174
+ <frontend_type>select</frontend_type>
175
+ <source_model>yoochoose_jstracking/system_config_source_renderSource</source_model>
176
+ <show_in_default>1</show_in_default>
177
+ <show_in_website>1</show_in_website>
178
+ <show_in_store>1</show_in_store>
179
+ </performance>
180
+ <overwrite translate="label">
181
+ <label>Overwrite Endpoint</label>
182
+ <backend_model>yoochoose_jstracking/scriptValidation</backend_model>
183
+ <frontend_type>text</frontend_type>
184
+ <sort_order>50</sort_order>
185
+ <show_in_default>1</show_in_default>
186
+ <show_in_website>1</show_in_website>
187
+ <show_in_store>1</show_in_store>
188
+ <comment><![CDATA[<span style="color: red; font-weight: bold;">Attention!
189
+ </span> See the <a href="https://www.yoochoose.com/magento-connect-2-tutorial"
190
+ target="_blank">extension manual</a>, if you about to use this property.]]></comment>
191
+ </overwrite>
192
+ </fields>
193
+ </advanced>
194
+
195
+ <recommendation_blocks translate="label">
196
+ <label>Product recommendation blocks</label>
197
+ <sort_order>10</sort_order>
198
+ <show_in_default>1</show_in_default>
199
+ <show_in_website>1</show_in_website>
200
+ <show_in_store>1</show_in_store>
201
+ <fields>
202
+ <personal_display translate="label">
203
+ <label>Home page. Personalized recommendations</label>
204
+ <frontend_type>select</frontend_type>
205
+ <source_model>yoochoose_jstracking/system_config_source_displayRecommendation</source_model>
206
+ <sort_order>5</sort_order>
207
+ <show_in_default>1</show_in_default>
208
+ <show_in_website>1</show_in_website>
209
+ <show_in_store>1</show_in_store>
210
+ </personal_display>
211
+ <personal_title translate="label">
212
+ <label>Title</label>
213
+ <frontend_type>text</frontend_type>
214
+ <sort_order>10</sort_order>
215
+ <show_in_default>1</show_in_default>
216
+ <show_in_website>1</show_in_website>
217
+ <show_in_store>1</show_in_store>
218
+ </personal_title>
219
+
220
+ <bestseller_display translate="label">
221
+ <label>Home page. Bestsellers</label>
222
+ <frontend_type>select</frontend_type>
223
+ <source_model>yoochoose_jstracking/system_config_source_displayRecommendation</source_model>
224
+ <sort_order>15</sort_order>
225
+ <show_in_default>1</show_in_default>
226
+ <show_in_website>1</show_in_website>
227
+ <show_in_store>1</show_in_store>
228
+ </bestseller_display>
229
+ <bestseller_title translate="label">
230
+ <label>Title</label>
231
+ <frontend_type>text</frontend_type>
232
+ <sort_order>20</sort_order>
233
+ <show_in_default>1</show_in_default>
234
+ <show_in_website>1</show_in_website>
235
+ <show_in_store>1</show_in_store>
236
+ </bestseller_title>
237
+
238
+ <related_display translate="label">
239
+ <label>Product page. Related products</label>
240
+ <frontend_type>select</frontend_type>
241
+ <source_model>yoochoose_jstracking/system_config_source_displayRecommendation</source_model>
242
+ <sort_order>25</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
+ </related_display>
247
+ <related_title translate="label">
248
+ <label>Title</label>
249
+ <frontend_type>text</frontend_type>
250
+ <sort_order>30</sort_order>
251
+ <show_in_default>1</show_in_default>
252
+ <show_in_website>1</show_in_website>
253
+ <show_in_store>1</show_in_store>
254
+ </related_title>
255
+
256
+ <upselling_display translate="label">
257
+ <label>Product page. Up-selling block</label>
258
+ <frontend_type>select</frontend_type>
259
+ <source_model>yoochoose_jstracking/system_config_source_displayRecommendation</source_model>
260
+ <sort_order>35</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
+ </upselling_display>
265
+ <upselling_title translate="label">
266
+ <label>Title</label>
267
+ <frontend_type>text</frontend_type>
268
+ <sort_order>40</sort_order>
269
+ <show_in_default>1</show_in_default>
270
+ <show_in_website>1</show_in_website>
271
+ <show_in_store>1</show_in_store>
272
+ </upselling_title>
273
+
274
+ <category_page_display translate="label">
275
+ <label>Category page. Recommendations</label>
276
+ <frontend_type>select</frontend_type>
277
+ <source_model>yoochoose_jstracking/system_config_source_displayRecommendation</source_model>
278
+ <sort_order>45</sort_order>
279
+ <show_in_default>1</show_in_default>
280
+ <show_in_website>1</show_in_website>
281
+ <show_in_store>1</show_in_store>
282
+ </category_page_display>
283
+ <category_page_title translate="label">
284
+ <label>Title</label>
285
+ <frontend_type>text</frontend_type>
286
+ <sort_order>50</sort_order>
287
+ <show_in_default>1</show_in_default>
288
+ <show_in_website>1</show_in_website>
289
+ <show_in_store>1</show_in_store>
290
+ <comment><![CDATA[Wildchar % will be replaces with
291
+ the name of the current category, for example "SHIRTS". Wildchar %% will
292
+ be replaces with the current category path, for example "HOME / MEN / SHIRTS".
293
+ ]]></comment>
294
+ </category_page_title>
295
+
296
+ <crossselling_display translate="label">
297
+ <label>Shopping basket page. Cross-selling products</label>
298
+ <frontend_type>select</frontend_type>
299
+ <source_model>yoochoose_jstracking/system_config_source_displayRecommendation</source_model>
300
+ <sort_order>55</sort_order>
301
+ <show_in_default>1</show_in_default>
302
+ <show_in_website>1</show_in_website>
303
+ <show_in_store>1</show_in_store>
304
+ </crossselling_display>
305
+ <crossselling_title translate="label">
306
+ <label>Title</label>
307
+ <frontend_type>text</frontend_type>
308
+ <sort_order>60</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
+ </crossselling_title>
313
+
314
+ <customization>
315
+ <label>Yoochoose Extension Customization</label>
316
+ <frontend_type>Button</frontend_type>
317
+ <frontend_model>yoochoose_jstracking/field_customize</frontend_model>
318
+ <sort_order>65</sort_order>
319
+ <show_in_default>1</show_in_default>
320
+ <show_in_website>1</show_in_website>
321
+ <show_in_store>1</show_in_store>
322
+ <comment><![CDATA[ In the Yoochoose dashboard you can specify the amount of the
323
+ recommendation for every block and customize the HTML template.]]></comment>
324
+ </customization>
325
+ </fields>
326
+ </recommendation_blocks>
327
+
328
+ <data_export>
329
+ <label>Data Import Configuration</label>
330
+ <comment><![CDATA[
331
+ After application consumer key and secret was generated, please
332
+ enter it into the magento plugin configuration in the Yoochoose
333
+ Configuration Backend.
334
+ <p id="yc_adminConfigureMsg" style="display: none;"></p>]]></comment>
335
+ <sort_order>80</sort_order>
336
+ <frontend_type>text</frontend_type>
337
+ <show_in_default>1</show_in_default>
338
+ <show_in_website>1</show_in_website>
339
+ <show_in_store>1</show_in_store>
340
+ <fields>
341
+ <automatically translate="label">
342
+ <label>Configure Permissions Automatically</label>
343
+ <frontend_type>button</frontend_type>
344
+ <frontend_model>yoochoose_jstracking/field_configureAuth</frontend_model>
345
+ <sort_order>10</sort_order>
346
+ <show_in_default>1</show_in_default>
347
+ <show_in_website>0</show_in_website>
348
+ <show_in_store>0</show_in_store>
349
+ </automatically>
350
+ <consumer_name translate="label">
351
+ <label>OAUTH Consumer Name</label>
352
+ <sort_order>15</sort_order>
353
+ <frontend_type>text</frontend_type>
354
+ <frontend_model>yoochoose_jstracking/field_readonly</frontend_model>
355
+ <show_in_default>1</show_in_default>
356
+ <show_in_website>0</show_in_website>
357
+ <show_in_store>0</show_in_store>
358
+ </consumer_name>
359
+ <consumer_key translate="label">
360
+ <label>OAUTH Consumer Key</label>
361
+ <sort_order>25</sort_order>
362
+ <frontend_type>text</frontend_type>
363
+ <frontend_model>yoochoose_jstracking/field_readonly</frontend_model>
364
+ <show_in_default>1</show_in_default>
365
+ <show_in_website>0</show_in_website>
366
+ <show_in_store>0</show_in_store>
367
+ </consumer_key>
368
+ <consumer_secret translate="label">
369
+ <label>OAUTH Consumer Secret</label>
370
+ <sort_order>35</sort_order>
371
+ <frontend_type>text</frontend_type>
372
+ <frontend_model>yoochoose_jstracking/field_readonly</frontend_model>
373
+ <show_in_default>1</show_in_default>
374
+ <show_in_website>0</show_in_website>
375
+ <show_in_store>0</show_in_store>
376
+ </consumer_secret>
377
+ <rest_role translate="label">
378
+ <label>REST Role</label>
379
+ <sort_order>45</sort_order>
380
+ <frontend_type>text</frontend_type>
381
+ <frontend_model>yoochoose_jstracking/field_readonly</frontend_model>
382
+ <show_in_default>1</show_in_default>
383
+ <show_in_website>0</show_in_website>
384
+ <show_in_store>0</show_in_store>
385
+ </rest_role>
386
+ </fields>
387
+ </data_export>
388
+ </groups>
389
+ </yoochoose>
390
+ </sections>
391
+ </config>
app/design/adminhtml/base/default/template/yoochoose/system/config/configure_auth.phtml ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Yoochoose
4
+ * @package Yoochoose-JSTracking
5
+ * @copyright Copyright (c) 2015 Yoochoose GmbH. (http://www.yoochoose.net)
6
+ */
7
+ ?>
8
+
9
+ <script type="text/javascript">
10
+ //<![CDATA[
11
+ function yc_configure_auth() {
12
+ new Ajax.Request('<?php echo $this->getAjaxConfigureUrl() ?>', {
13
+ method: 'get',
14
+ onSuccess: function (transport) {
15
+ var data, message = document.getElementById('yc_adminConfigureMsg');
16
+ if (transport.responseText) {
17
+ data = JSON.parse(transport.responseText);
18
+ message.innerHTML = data.message;
19
+ message.style.display = 'block';
20
+ message.style.color = data.success? 'green' : 'red';
21
+ if (data.success) {
22
+ document.getElementById('yoochoose_data_export_consumer_name').value = data.consumerName;
23
+ document.getElementById('yoochoose_data_export_consumer_key').value = data.consumerKey;
24
+ document.getElementById('yoochoose_data_export_consumer_secret').value = data.consumerSecret;
25
+ document.getElementById('yoochoose_data_export_rest_role').value = data.restRole;
26
+ }
27
+ }
28
+ }
29
+ });
30
+ }
31
+ //]]>
32
+ </script>
33
+
34
+ <?php echo $this->getButtonHtml() ?>
app/design/adminhtml/base/default/template/yoochoose/system/config/customize.phtml ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Yoochoose
4
+ * @package Yoochoose-JSTracking
5
+ * @copyright Copyright (c) 2015 Yoochoose GmbH. (http://www.yoochoose.net)
6
+ */
7
+
8
+ echo "<a href='{$this->getYoochooseLink()}' target='_blank'> {$this->getButtonHtml()} </a>";
app/design/adminhtml/base/default/template/yoochoose/system/config/register.phtml ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Yoochoose
4
+ * @package Yoochoose-JSTracking
5
+ * @copyright Copyright (c) 2015 Yoochoose GmbH. (http://www.yoochoose.net)
6
+ */
7
+ ?>
8
+ <script type="text/javascript">
9
+ function yc_register() {
10
+ var form = document.createElement("form"),
11
+ input = document.createElement("input"),
12
+ object = <?php echo $this->getYoochooseRegistration(); ?>;
13
+
14
+ form.method = "post";
15
+ form.action = "<?php echo $this->getYoochooseLink(); ?>";
16
+ form.target = "_blank";
17
+
18
+ for (var property in object) {
19
+ if (object.hasOwnProperty(property)) {
20
+ input.setAttribute('name', property);
21
+ input.setAttribute('value', object[property]);
22
+ form.appendChild(input.cloneNode(true));
23
+ }
24
+ }
25
+
26
+ form.submit();
27
+ }
28
+ </script>
29
+
30
+ <?php echo $this->getButtonHtml() ?>
app/design/frontend/argento/pure/layout/yoochoose.xml DELETED
@@ -1,83 +0,0 @@
1
- <?xml version="1.0"?>
2
- <layout version="0.1.0">
3
-
4
- <default>
5
-
6
- <!-- Yoochoose Tracking -->
7
- <reference name="before_body_end">
8
- <block type="yoochoose/tracking" name="yoochoose.tracking" template="yoochoose/tracking.phtml" />
9
- <!-- disable again if necessary -->
10
- <action method="unsetChild" ifconfig="yoochoose/general/disabled">
11
- <name>yoochoose.tracking</name>
12
- </action>
13
- </reference>
14
-
15
- </default>
16
-
17
- <cms_index_index>
18
- <reference name="content">
19
- <block type="yoochoose/bestseller" name="yoochoose.bestseller" template="yoochoose/yoochoose_bestseller.phtml">
20
- <action method="addColumnCountLayoutDepend"><layout>empty</layout><count>6</count></action>
21
- <action method="addColumnCountLayoutDepend"><layout>one_column</layout><count>5</count></action>
22
- <action method="addColumnCountLayoutDepend"><layout>two_columns_left</layout><count>4</count></action>
23
- <action method="addColumnCountLayoutDepend"><layout>two_columns_right</layout><count>4</count></action>
24
- <action method="addColumnCountLayoutDepend"><layout>three_columns</layout><count>3</count></action>
25
- </block>
26
- <!-- disable again if necessary -->
27
- <action method="unsetChild" ifconfig="yoochoose/general/disabled">
28
- <name>yoochoose.bestseller</name>
29
- </action>
30
- </reference>
31
-
32
- <reference name="content">
33
- <block type="yoochoose/personal" name="yoochoose.personal" template="yoochoose/yoochoose_personal.phtml">
34
- <action method="addColumnCountLayoutDepend"><layout>empty</layout><count>6</count></action>
35
- <action method="addColumnCountLayoutDepend"><layout>one_column</layout><count>5</count></action>
36
- <action method="addColumnCountLayoutDepend"><layout>two_columns_left</layout><count>4</count></action>
37
- <action method="addColumnCountLayoutDepend"><layout>two_columns_right</layout><count>4</count></action>
38
- <action method="addColumnCountLayoutDepend"><layout>three_columns</layout><count>3</count></action>
39
- </block>
40
- <!-- disable again if necessary -->
41
- <action method="unsetChild" ifconfig="yoochoose/general/disabled">
42
- <name>yoochoose.personal</name>
43
- </action>
44
- </reference>
45
- </cms_index_index>
46
-
47
-
48
- <catalog_product_view>
49
-
50
- <reference name="content">
51
- <block type="yoochoose/upsell" name="yoochoose.upsell" template="yoochoose/yoochoose_upsell.phtml">
52
- <action method="addColumnCountLayoutDepend"><layout>empty</layout><count>6</count></action>
53
- <action method="addColumnCountLayoutDepend"><layout>one_column</layout><count>5</count></action>
54
- <action method="addColumnCountLayoutDepend"><layout>two_columns_left</layout><count>4</count></action>
55
- <action method="addColumnCountLayoutDepend"><layout>two_columns_right</layout><count>4</count></action>
56
- <action method="addColumnCountLayoutDepend"><layout>three_columns</layout><count>3</count></action>
57
- </block>
58
- <!-- disable again if necessary -->
59
- <action method="unsetChild" ifconfig="yoochoose/general/disabled">
60
- <name>yoochoose.upsell</name>
61
- </action>
62
- </reference>
63
-
64
- <reference name="content">
65
- <block type="yoochoose/related" name="yoochoose.related" template="yoochoose/yoochoose_related.phtml">
66
- <action method="addColumnCountLayoutDepend"><layout>empty</layout><count>6</count></action>
67
- <action method="addColumnCountLayoutDepend"><layout>one_column</layout><count>5</count></action>
68
- <action method="addColumnCountLayoutDepend"><layout>two_columns_left</layout><count>4</count></action>
69
- <action method="addColumnCountLayoutDepend"><layout>two_columns_right</layout><count>4</count></action>
70
- <action method="addColumnCountLayoutDepend"><layout>three_columns</layout><count>3</count></action>
71
- </block>
72
- <!-- disable again if necessary -->
73
- <action method="unsetChild" ifconfig="yoochoose/general/disabled">
74
- <name>yoochoose.related</name>
75
- </action>
76
- </reference>
77
- </catalog_product_view>
78
-
79
-
80
- <checkout_cart_index>
81
- </checkout_cart_index>
82
-
83
- </layout>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/argento/pure/template/yoochoose/yoochoose_bestseller.phtml DELETED
@@ -1,93 +0,0 @@
1
- <?php
2
- /**
3
- * Magento
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Academic Free License (AFL 3.0)
8
- * that is bundled with this package in the file LICENSE_AFL.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/afl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
- *
15
- * DISCLAIMER
16
- *
17
- * Do not edit or add to this file if you wish to upgrade Magento to newer
18
- * versions in the future. If you wish to customize Magento for your
19
- * needs please refer to http://www.magentocommerce.com for more information.
20
- *
21
- * @category design
22
- * @package base_default
23
- * @copyright Copyright (c) 2013 Magento Inc. (http://www.magentocommerce.com)
24
- * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
- */
26
- ?>
27
- <?php if($this->getItems()->getSize()): ?>
28
- <div class="block block-related">
29
- <div class="block-title">
30
- <span><span><?php echo $this->__('Best Sellers') ?></span></span>
31
- </div>
32
- <div class="block-content">
33
- <ol class="mini-products-list" id="block-related">
34
- <?php foreach($this->getItems() as $_item): ?>
35
- <li class="item">
36
- <div class="product">
37
- <a href="<?php echo $_item->getProductUrl() ?>" title="<?php echo $this->escapeHtml($_item->getName()) ?>" class="product-image"
38
- ><img src="<?php echo $this->helper('catalog/image')->init($_item, 'thumbnail')->resize(50) ?>"
39
- srcset="<?php echo $this->helper('catalog/image')->init($_item, 'thumbnail')->resize(50 * 2) ?> 2x"
40
- width="50" height="50"
41
- alt="<?php echo $this->escapeHtml($_item->getName()) ?>"
42
- /></a>
43
- <div class="product-details">
44
- <p class="product-name"><a href="<?php echo $_item->getProductUrl() ?>"><?php echo $this->escapeHtml($_item->getName()) ?></a></p>
45
- <?php echo $this->getPriceHtml($_item, true, '-related') ?>
46
- <?php if ($this->helper('wishlist')->isAllow()) : ?>
47
- <a href="<?php echo $this->getAddToWishlistUrl($_item) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a>
48
- <?php endif; ?>
49
- </div>
50
- </div>
51
- </li>
52
- <?php endforeach ?>
53
- </ol>
54
- <script type="text/javascript">decorateList('block-related', 'none-recursive');</script>
55
- </div>
56
- <script type="text/javascript">
57
- //<![CDATA[
58
- $$('.related-checkbox').each(function(elem){
59
- Event.observe(elem, 'click', addRelatedToProduct);
60
- });
61
-
62
- var relatedProductsCheckFlag = false;
63
- function selectAllRelated(txt){
64
- if (relatedProductsCheckFlag == false) {
65
- $$('.related-checkbox').each(function(elem){
66
- elem.checked = true;
67
- });
68
- relatedProductsCheckFlag = true;
69
- txt.innerHTML="<?php echo $this->__('unselect all') ?>";
70
- } else {
71
- $$('.related-checkbox').each(function(elem){
72
- elem.checked = false;
73
- });
74
- relatedProductsCheckFlag = false;
75
- txt.innerHTML="<?php echo $this->__('select all') ?>";
76
- }
77
- addRelatedToProduct();
78
- }
79
-
80
- function addRelatedToProduct(){
81
- var checkboxes = $$('.related-checkbox');
82
- var values = [];
83
- for(var i=0;i<checkboxes.length;i++){
84
- if(checkboxes[i].checked) values.push(checkboxes[i].value);
85
- }
86
- if($('related-products-field')){
87
- $('related-products-field').value = values.join(',');
88
- }
89
- }
90
- //]]>
91
- </script>
92
- </div>
93
- <?php endif ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/argento/pure/template/yoochoose/yoochoose_personal.phtml DELETED
@@ -1,93 +0,0 @@
1
- <?php
2
- /**
3
- * Magento
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Academic Free License (AFL 3.0)
8
- * that is bundled with this package in the file LICENSE_AFL.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/afl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
- *
15
- * DISCLAIMER
16
- *
17
- * Do not edit or add to this file if you wish to upgrade Magento to newer
18
- * versions in the future. If you wish to customize Magento for your
19
- * needs please refer to http://www.magentocommerce.com for more information.
20
- *
21
- * @category design
22
- * @package base_default
23
- * @copyright Copyright (c) 2013 Magento Inc. (http://www.magentocommerce.com)
24
- * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
- */
26
- ?>
27
- <?php if($this->getItems()->getSize()): ?>
28
- <div class="block block-related">
29
- <div class="block-title">
30
- <span><span><?php echo $this->__('Recommendations for You') ?></span></span>
31
- </div>
32
- <div class="block-content">
33
- <ol class="mini-products-list" id="block-related">
34
- <?php foreach($this->getItems() as $_item): ?>
35
- <li class="item">
36
- <div class="product">
37
- <a href="<?php echo $_item->getProductUrl() ?>" title="<?php echo $this->escapeHtml($_item->getName()) ?>" class="product-image"
38
- ><img src="<?php echo $this->helper('catalog/image')->init($_item, 'thumbnail')->resize(50) ?>"
39
- srcset="<?php echo $this->helper('catalog/image')->init($_item, 'thumbnail')->resize(50 * 2) ?> 2x"
40
- width="50" height="50"
41
- alt="<?php echo $this->escapeHtml($_item->getName()) ?>"
42
- /></a>
43
- <div class="product-details">
44
- <p class="product-name"><a href="<?php echo $_item->getProductUrl() ?>"><?php echo $this->escapeHtml($_item->getName()) ?></a></p>
45
- <?php echo $this->getPriceHtml($_item, true, '-related') ?>
46
- <?php if ($this->helper('wishlist')->isAllow()) : ?>
47
- <a href="<?php echo $this->getAddToWishlistUrl($_item) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a>
48
- <?php endif; ?>
49
- </div>
50
- </div>
51
- </li>
52
- <?php endforeach ?>
53
- </ol>
54
- <script type="text/javascript">decorateList('block-related', 'none-recursive');</script>
55
- </div>
56
- <script type="text/javascript">
57
- //<![CDATA[
58
- $$('.related-checkbox').each(function(elem){
59
- Event.observe(elem, 'click', addRelatedToProduct);
60
- });
61
-
62
- var relatedProductsCheckFlag = false;
63
- function selectAllRelated(txt){
64
- if (relatedProductsCheckFlag == false) {
65
- $$('.related-checkbox').each(function(elem){
66
- elem.checked = true;
67
- });
68
- relatedProductsCheckFlag = true;
69
- txt.innerHTML="<?php echo $this->__('unselect all') ?>";
70
- } else {
71
- $$('.related-checkbox').each(function(elem){
72
- elem.checked = false;
73
- });
74
- relatedProductsCheckFlag = false;
75
- txt.innerHTML="<?php echo $this->__('select all') ?>";
76
- }
77
- addRelatedToProduct();
78
- }
79
-
80
- function addRelatedToProduct(){
81
- var checkboxes = $$('.related-checkbox');
82
- var values = [];
83
- for(var i=0;i<checkboxes.length;i++){
84
- if(checkboxes[i].checked) values.push(checkboxes[i].value);
85
- }
86
- if($('related-products-field')){
87
- $('related-products-field').value = values.join(',');
88
- }
89
- }
90
- //]]>
91
- </script>
92
- </div>
93
- <?php endif ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/argento/pure/template/yoochoose/yoochoose_related.phtml DELETED
@@ -1,109 +0,0 @@
1
- <?php
2
- /**
3
- * Magento
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Academic Free License (AFL 3.0)
8
- * that is bundled with this package in the file LICENSE_AFL.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/afl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
- *
15
- * DISCLAIMER
16
- *
17
- * Do not edit or add to this file if you wish to upgrade Magento to newer
18
- * versions in the future. If you wish to customize Magento for your
19
- * needs please refer to http://www.magentocommerce.com for more information.
20
- *
21
- * @category design
22
- * @package base_default
23
- * @copyright Copyright (c) 2013 Magento Inc. (http://www.magentocommerce.com)
24
- * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
- */
26
- ?>
27
- <?php if($this->getItems()->getSize()): ?>
28
- <!-- youchoose related -->
29
- <div class="block block-related">
30
- <div class="block-title">
31
- <span><span><?php echo $this->__('Related Products, Over the Counter') ?></span></span>
32
- </div>
33
- <div class="block-content">
34
- <ol class="mini-products-list" id="block-related">
35
- <?php foreach($this->getItems() as $_item): ?>
36
- <li class="item">
37
- <div class="product">
38
- <a href="<?php echo $_item->getProductUrl() ?>" title="<?php echo $this->escapeHtml($_item->getName()) ?>" class="product-image"
39
- ><img src="<?php echo $this->helper('catalog/image')->init($_item, 'thumbnail')->resize(50) ?>"
40
- srcset="<?php echo $this->helper('catalog/image')->init($_item, 'thumbnail')->resize(50 * 2) ?> 2x"
41
- width="50" height="50"
42
- alt="<?php echo $this->escapeHtml($_item->getName()) ?>"
43
- /></a>
44
- <div class="product-details item-name-header" >
45
- <p class="product-name"><a href="<?php echo $_item->getProductUrl() ?>"><?php
46
- $categoryIds = $_item->getCategoryIds();
47
-
48
- if(count($categoryIds) ){
49
- $firstCategoryId = $categoryIds[0];
50
- $_category = Mage::getModel('catalog/category')->load($firstCategoryId);
51
-
52
- echo "<b>";
53
- echo $this->escapeHtml($_category->getName());
54
- echo "</b><br>";
55
- }
56
- echo $this->escapeHtml($_item->getName());
57
- ?></a></p>
58
- <?php echo $this->getPriceHtml($_item, true, '-related') ?>
59
- <?php if ($this->helper('wishlist')->isAllow()) : ?>
60
- <a href="<?php echo $this->getAddToWishlistUrl($_item) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a>
61
- <?php endif; ?>
62
- </div>
63
- <form action="<?php echo $this->getAddToCartUrl($_item) ?>" method="post" id="product_addtocart_form_<?php echo $_item->getId()?>"<?php if($_item->getOptions()): ?> enctype="multipart/form-data"<?php endif; ?>>
64
- <button type="button" class="button btn-cart" onclick="this.form.submit()"><span><span><span><?php echo $this->__('Add to Cart') ?></span></span></span></button>
65
- </form>
66
- </div>
67
- </li>
68
- <?php endforeach ?>
69
- </ol>
70
- <script type="text/javascript">decorateList('block-related', 'none-recursive');</script>
71
- </div>
72
- <script type="text/javascript">
73
- //<![CDATA[
74
- $$('.related-checkbox').each(function(elem){
75
- Event.observe(elem, 'click', addRelatedToProduct);
76
- });
77
-
78
- var relatedProductsCheckFlag = false;
79
- function selectAllRelated(txt){
80
- if (relatedProductsCheckFlag == false) {
81
- $$('.related-checkbox').each(function(elem){
82
- elem.checked = true;
83
- });
84
- relatedProductsCheckFlag = true;
85
- txt.innerHTML="<?php echo $this->__('unselect all') ?>";
86
- } else {
87
- $$('.related-checkbox').each(function(elem){
88
- elem.checked = false;
89
- });
90
- relatedProductsCheckFlag = false;
91
- txt.innerHTML="<?php echo $this->__('select all') ?>";
92
- }
93
- addRelatedToProduct();
94
- }
95
-
96
- function addRelatedToProduct(){
97
- var checkboxes = $$('.related-checkbox');
98
- var values = [];
99
- for(var i=0;i<checkboxes.length;i++){
100
- if(checkboxes[i].checked) values.push(checkboxes[i].value);
101
- }
102
- if($('related-products-field')){
103
- $('related-products-field').value = values.join(',');
104
- }
105
- }
106
- //]]>
107
- </script>
108
- </div>
109
- <?php endif ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/argento/pure/template/yoochoose/yoochoose_upsell.phtml DELETED
@@ -1,111 +0,0 @@
1
- <?php
2
- /**
3
- * Magento
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Academic Free License (AFL 3.0)
8
- * that is bundled with this package in the file LICENSE_AFL.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/afl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
- *
15
- * DISCLAIMER
16
- *
17
- * Do not edit or add to this file if you wish to upgrade Magento to newer
18
- * versions in the future. If you wish to customize Magento for your
19
- * needs please refer to http://www.magentocommerce.com for more information.
20
- *
21
- * @category design
22
- * @package base_default
23
- * @copyright Copyright (c) 2013 Magento Inc. (http://www.magentocommerce.com)
24
- * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
- */
26
- ?>
27
- <?php if($this->getItems()->getSize()): ?>
28
- <div class="block block-related">
29
- <!-- yoochoose upsell -->
30
- <div class="block-title">
31
- <span><span><?php echo $this->__('You may also be interested in the following product(s)') ?></span></span>
32
- </div>
33
- <div class="block-content">
34
- <ol class="mini-products-list" id="block-related">
35
- <?php foreach($this->getItems() as $_item): ?>
36
- <li class="item">
37
- <div class="product">
38
- <a href="<?php echo $_item->getProductUrl() ?>" title="<?php echo $this->escapeHtml($_item->getName()) ?>" class="product-image"
39
- ><img src="<?php echo $this->helper('catalog/image')->init($_item, 'thumbnail')->resize(50) ?>"
40
- srcset="<?php echo $this->helper('catalog/image')->init($_item, 'thumbnail')->resize(50 * 2) ?> 2x"
41
- width="50" height="50"
42
- alt="<?php echo $this->escapeHtml($_item->getName()) ?>"
43
- /></a>
44
- <div class="product-details item-name-header">
45
- <p class="product-name"><a href="<?php echo $_item->getProductUrl() ?>"><?php
46
- $categoryIds = $_item->getCategoryIds();
47
-
48
- if(count($categoryIds) ){
49
- $firstCategoryId = $categoryIds[0];
50
- $_category = Mage::getModel('catalog/category')->load($firstCategoryId);
51
-
52
- echo "<b>";
53
- echo $this->escapeHtml($_category->getName());
54
- echo "</b><br>";
55
- }
56
- echo $this->escapeHtml($_item->getName())
57
-
58
- ?></a></p>
59
- <?php echo $this->getPriceHtml($_item, true, '-related') ?>
60
- <?php if ($this->helper('wishlist')->isAllow()) : ?>
61
- <a href="<?php echo $this->getAddToWishlistUrl($_item) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a>
62
- <?php endif; ?>
63
-
64
- </div>
65
- <form action="<?php echo $this->getAddToCartUrl($_item) ?>" method="post" id="product_addtocart_form_<?php echo $_item->getId()?>"<?php if($_item->getOptions()): ?> enctype="multipart/form-data"<?php endif; ?>>
66
- <button type="button" class="button btn-cart" onclick="this.form.submit()"><span><span><span><?php echo $this->__('Add to Cart') ?></span></span></span></button>
67
- </form>
68
- </div>
69
- </li>
70
- <?php endforeach ?>
71
- </ol>
72
- <script type="text/javascript">decorateList('block-related', 'none-recursive');</script>
73
- </div>
74
- <script type="text/javascript">
75
- //<![CDATA[
76
- $$('.related-checkbox').each(function(elem){
77
- Event.observe(elem, 'click', addRelatedToProduct);
78
- });
79
-
80
- var relatedProductsCheckFlag = false;
81
- function selectAllRelated(txt){
82
- if (relatedProductsCheckFlag == false) {
83
- $$('.related-checkbox').each(function(elem){
84
- elem.checked = true;
85
- });
86
- relatedProductsCheckFlag = true;
87
- txt.innerHTML="<?php echo $this->__('unselect all') ?>";
88
- } else {
89
- $$('.related-checkbox').each(function(elem){
90
- elem.checked = false;
91
- });
92
- relatedProductsCheckFlag = false;
93
- txt.innerHTML="<?php echo $this->__('select all') ?>";
94
- }
95
- addRelatedToProduct();
96
- }
97
-
98
- function addRelatedToProduct(){
99
- var checkboxes = $$('.related-checkbox');
100
- var values = [];
101
- for(var i=0;i<checkboxes.length;i++){
102
- if(checkboxes[i].checked) values.push(checkboxes[i].value);
103
- }
104
- if($('related-products-field')){
105
- $('related-products-field').value = values.join(',');
106
- }
107
- }
108
- //]]>
109
- </script>
110
- </div>
111
- <?php endif ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/base/default/layout/yoochoose.xml DELETED
@@ -1,64 +0,0 @@
1
- <?xml version="1.0"?>
2
- <layout version="0.1.0">
3
-
4
- <default>
5
-
6
- <!-- Yoochoose Tracking -->
7
- <reference name="before_body_end">
8
- <block type="yoochoose/tracking" name="yoochoose.tracking" template="yoochoose/tracking.phtml" />
9
- <!-- disable again if necessary -->
10
- <action method="unsetChild" ifconfig="yoochoose/general/disabled">
11
- <name>yoochoose.tracking</name>
12
- </action>
13
- </reference>
14
-
15
- </default>
16
-
17
- <cms_index_index>
18
- <reference name="content">
19
- <block type="yoochoose/bestseller" name="yoochoose.bestseller" template="catalog/product/new.phtml">
20
- <action method="addColumnCountLayoutDepend"><layout>empty</layout><count>6</count></action>
21
- <action method="addColumnCountLayoutDepend"><layout>one_column</layout><count>5</count></action>
22
- <action method="addColumnCountLayoutDepend"><layout>two_columns_left</layout><count>4</count></action>
23
- <action method="addColumnCountLayoutDepend"><layout>two_columns_right</layout><count>4</count></action>
24
- <action method="addColumnCountLayoutDepend"><layout>three_columns</layout><count>3</count></action>
25
- </block>
26
- <!-- disable again if necessary -->
27
- <action method="unsetChild" ifconfig="yoochoose/general/disabled">
28
- <name>yoochoose.bestseller</name>
29
- </action>
30
- </reference>
31
-
32
- <reference name="content">
33
- <block type="yoochoose/personal" name="yoochoose.personal" template="catalog/product/new.phtml">
34
- <action method="addColumnCountLayoutDepend"><layout>empty</layout><count>6</count></action>
35
- <action method="addColumnCountLayoutDepend"><layout>one_column</layout><count>5</count></action>
36
- <action method="addColumnCountLayoutDepend"><layout>two_columns_left</layout><count>4</count></action>
37
- <action method="addColumnCountLayoutDepend"><layout>two_columns_right</layout><count>4</count></action>
38
- <action method="addColumnCountLayoutDepend"><layout>three_columns</layout><count>3</count></action>
39
- </block>
40
- <!-- disable again if necessary -->
41
- <action method="unsetChild" ifconfig="yoochoose/general/disabled">
42
- <name>yoochoose.personal</name>
43
- </action>
44
- </reference>
45
- </cms_index_index>
46
-
47
-
48
- <catalog_product_view>
49
- <reference name="product.info.upsell">
50
- <!-- <action method="setTemplate"><template>yoochoose/upsell.phtml</template></action> -->
51
- </reference>
52
- <reference name="catalog.product.related">
53
- <!-- <action method="setTemplate"><template>yoochoose/related.phtml</template></action> -->
54
- </reference>
55
- </catalog_product_view>
56
-
57
-
58
- <checkout_cart_index>
59
- <reference name="checkout.cart.crosssell">
60
- <!-- <action method="setTemplate"><template>yoochoose/crosssell.phtml</template></action> -->
61
- </reference>
62
- </checkout_cart_index>
63
-
64
- </layout>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/base/default/layout/yoochoose_jstracking.xml ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magentocommerce.com for more information.
21
+ *
22
+ * @category design
23
+ * @package default_default
24
+ * @author Yoochoose
25
+ */
26
+
27
+ -->
28
+
29
+ <layout version="1.0.0">
30
+ <default>
31
+ <reference name="head">
32
+ <block type="yoochoose_jstracking/head" name="yoochoose.jstracking" template="yoochoose/head.phtml"/>
33
+ </reference>
34
+ </default>
35
+ </layout>
app/design/frontend/base/default/template/yoochoose/head.phtml ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+
2
+ <?php
3
+ echo $this->renderScripts();
4
+ ?>
app/design/frontend/base/default/template/yoochoose/tracking.phtml DELETED
@@ -1,21 +0,0 @@
1
- <?php
2
- /**
3
- * @category AvS
4
- * @package AvS_Yoochoose
5
- * @author Andreas von Studnitz <avs@avs-webentwicklung.de>
6
- */
7
-
8
- /** @var $this AvS_Yoochoose_Block_Tracking */
9
- ?>
10
- <!-- #EOF yoochoose tracking -->
11
- <?php
12
- if (Mage::helper('yoochoose')->isActive() && sizeof($this->getTrackingPixelData()) > 0):
13
- ?>
14
- <div id="yoochoose_tracking">
15
- <?php foreach ($this->getTrackingPixelData() as $trackingPixelData): ?>
16
- <img src="<?php echo $this->generateTrackingPixelUrl($trackingPixelData) ?>" alt="<?php echo $this->__('Yoochoose Tracking') ?>" width="0" height="0" />
17
- <?php endforeach ?>
18
- </div>
19
- <?php endif ?>
20
- <!-- #BOF yoochoose tracking -->
21
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/default/default/layout/yoochoose.xml DELETED
@@ -1,64 +0,0 @@
1
- <?xml version="1.0"?>
2
- <layout version="0.1.0">
3
-
4
- <default>
5
-
6
- <!-- Yoochoose Tracking -->
7
- <reference name="before_body_end">
8
- <block type="yoochoose/tracking" name="yoochoose.tracking" template="yoochoose/tracking.phtml" />
9
- <!-- disable again if necessary -->
10
- <action method="unsetChild" ifconfig="yoochoose/general/disabled">
11
- <name>yoochoose.tracking</name>
12
- </action>
13
- </reference>
14
-
15
- </default>
16
-
17
- <cms_index_index>
18
- <reference name="content">
19
- <block type="yoochoose/bestseller" name="yoochoose.bestseller" template="yoochoose/new.phtml">
20
- <action method="addColumnCountLayoutDepend"><layout>empty</layout><count>6</count></action>
21
- <action method="addColumnCountLayoutDepend"><layout>one_column</layout><count>5</count></action>
22
- <action method="addColumnCountLayoutDepend"><layout>two_columns_left</layout><count>4</count></action>
23
- <action method="addColumnCountLayoutDepend"><layout>two_columns_right</layout><count>4</count></action>
24
- <action method="addColumnCountLayoutDepend"><layout>three_columns</layout><count>3</count></action>
25
- </block>
26
- <!-- disable again if necessary -->
27
- <action method="unsetChild" ifconfig="yoochoose/general/disabled">
28
- <name>yoochoose.bestseller</name>
29
- </action>
30
- </reference>
31
-
32
- <reference name="content">
33
- <block type="yoochoose/personal" name="yoochoose.personal" template="yoochoose/new.phtml">
34
- <action method="addColumnCountLayoutDepend"><layout>empty</layout><count>6</count></action>
35
- <action method="addColumnCountLayoutDepend"><layout>one_column</layout><count>5</count></action>
36
- <action method="addColumnCountLayoutDepend"><layout>two_columns_left</layout><count>4</count></action>
37
- <action method="addColumnCountLayoutDepend"><layout>two_columns_right</layout><count>4</count></action>
38
- <action method="addColumnCountLayoutDepend"><layout>three_columns</layout><count>3</count></action>
39
- </block>
40
- <!-- disable again if necessary -->
41
- <action method="unsetChild" ifconfig="yoochoose/general/disabled">
42
- <name>yoochoose.personal</name>
43
- </action>
44
- </reference>
45
- </cms_index_index>
46
-
47
-
48
- <catalog_product_view>
49
- <reference name="product.info.upsell">
50
- <!-- <action method="setTemplate"><template>yoochoose/upsell.phtml</template></action> -->
51
- </reference>
52
- <reference name="catalog.product.related">
53
- <!-- <action method="setTemplate"><template>yoochoose/related.phtml</template></action> -->
54
- </reference>
55
- </catalog_product_view>
56
-
57
-
58
- <checkout_cart_index>
59
- <reference name="checkout.cart.crosssell">
60
- <!-- <action method="setTemplate"><template>yoochoose/crosssell.phtml</template></action> -->
61
- </reference>
62
- </checkout_cart_index>
63
-
64
- </layout>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/default/default/template/yoochoose/new.phtml DELETED
@@ -1,43 +0,0 @@
1
- <?php
2
- /**
3
- * @category AvS
4
- * @package AvS_Yoochoose
5
- * @author Rodion Alukhanov
6
- */
7
- ?>
8
-
9
-
10
- <?php $_products = $this->getItemArray() ?>
11
- <?php if(count($_products)): ?>
12
- <h2 class="subtitle"><?php echo $this->getBlockName(); ?></h2>
13
- <?php $_columnCount = $this->getColumnCount(); ?>
14
- <?php $i=0; foreach ($_products as $_product): ?>
15
- <?php if ($i++%$_columnCount==0): ?>
16
- <ul class="products-grid">
17
- <?php endif ?>
18
- <li class="item<?php if(($i-1)%$_columnCount==0): ?> first<?php elseif($i%$_columnCount==0): ?> last<?php endif; ?>">
19
- <a href="<?php echo $this->getProductUrl($_product) ?>" title="<?php echo $this->escapeHtml($_product->getName()) ?>" class="product-image"><img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(135) ?>" width="135" height="135" alt="<?php echo $this->escapeHtml($_product->getName()) ?>" /></a>
20
- <h3 class="product-name"><a href="<?php echo $this->getProductUrl($_product) ?>" title="<?php echo $this->escapeHtml($_product->getName()) ?>"><?php echo $this->escapeHtml($_product->getName()) ?></a></h3>
21
- <?php echo $this->getReviewsSummaryHtml($_product, 'short') ?>
22
- <?php echo $this->getPriceHtml($_product, true, '-new') ?>
23
- <div class="actions">
24
- <?php if($_product->isSaleable()): ?>
25
- <button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button>
26
- <?php else: ?>
27
- <p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
28
- <?php endif; ?>
29
- <ul class="add-to-links">
30
- <?php if ($this->helper('wishlist')->isAllow()) : ?>
31
- <li><a href="<?php echo $this->getAddToWishlistUrl($_product) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>
32
- <?php endif; ?>
33
- <?php if ($_compareUrl = $this->getAddToCompareUrl($_product)): ?>
34
- <li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
35
- <?php endif; ?>
36
- </ul>
37
- </div>
38
- </li>
39
- <?php if ($i%$_columnCount==0 || $i==count($_products)): ?>
40
- </ul>
41
- <?php endif ?>
42
- <?php endforeach; ?>
43
- <?php endif; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/galaeverbuy/default/layout/yoochoose.xml DELETED
@@ -1,64 +0,0 @@
1
- <?xml version="1.0"?>
2
- <layout version="0.1.0">
3
-
4
- <default>
5
-
6
- <!-- Yoochoose Tracking -->
7
- <reference name="before_body_end">
8
- <block type="yoochoose/tracking" name="yoochoose.tracking" template="yoochoose/tracking.phtml" />
9
- <!-- disable again if necessary -->
10
- <action method="unsetChild" ifconfig="yoochoose/general/disabled">
11
- <name>yoochoose.tracking</name>
12
- </action>
13
- </reference>
14
-
15
- </default>
16
-
17
- <cms_index_index>
18
- <reference name="content">
19
- <block type="yoochoose/bestseller" name="yoochoose.bestseller" template="yoochoose/list.phtml">
20
- <action method="addColumnCountLayoutDepend"><layout>empty</layout><count>6</count></action>
21
- <action method="addColumnCountLayoutDepend"><layout>one_column</layout><count>5</count></action>
22
- <action method="addColumnCountLayoutDepend"><layout>two_columns_left</layout><count>4</count></action>
23
- <action method="addColumnCountLayoutDepend"><layout>two_columns_right</layout><count>4</count></action>
24
- <action method="addColumnCountLayoutDepend"><layout>three_columns</layout><count>3</count></action>
25
- </block>
26
- <!-- disable again if necessary -->
27
- <action method="unsetChild" ifconfig="yoochoose/general/disabled">
28
- <name>yoochoose.bestseller</name>
29
- </action>
30
- </reference>
31
-
32
- <reference name="content">
33
- <block type="yoochoose/personal" name="yoochoose.personal" template="yoochoose/list.phtml">
34
- <action method="addColumnCountLayoutDepend"><layout>empty</layout><count>6</count></action>
35
- <action method="addColumnCountLayoutDepend"><layout>one_column</layout><count>5</count></action>
36
- <action method="addColumnCountLayoutDepend"><layout>two_columns_left</layout><count>4</count></action>
37
- <action method="addColumnCountLayoutDepend"><layout>two_columns_right</layout><count>4</count></action>
38
- <action method="addColumnCountLayoutDepend"><layout>three_columns</layout><count>3</count></action>
39
- </block>
40
- <!-- disable again if necessary -->
41
- <action method="unsetChild" ifconfig="yoochoose/general/disabled">
42
- <name>yoochoose.personal</name>
43
- </action>
44
- </reference>
45
- </cms_index_index>
46
-
47
-
48
- <catalog_product_view>
49
- <reference name="product.info.upsell">
50
- <!-- <action method="setTemplate"><template>yoochoose/upsell.phtml</template></action> -->
51
- </reference>
52
- <reference name="catalog.product.related">
53
- <!-- <action method="setTemplate"><template>yoochoose/related.phtml</template></action> -->
54
- </reference>
55
- </catalog_product_view>
56
-
57
-
58
- <checkout_cart_index>
59
- <reference name="checkout.cart.crosssell">
60
- <!-- <action method="setTemplate"><template>yoochoose/crosssell.phtml</template></action> -->
61
- </reference>
62
- </checkout_cart_index>
63
-
64
- </layout>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/galaeverbuy/default/template/yoochoose/list.phtml DELETED
@@ -1,42 +0,0 @@
1
- <?php
2
- $_productCollection=$this->getItemArray();
3
- $_helper = $this->helper('catalog/output');
4
- $_columnCount = $this->getColumnCount();
5
-
6
- $conf = new Gala_Galaeverbuysettings_Galaeverbuysettings();
7
- $w = $conf->get_grid_thumb_width();
8
- $h = $conf->get_grid_thumb_height();
9
-
10
- ?>
11
- <?php if(!count($_productCollection)): ?>
12
- <!-- yoochoose: no products found for [<?php echo $this->getBlockName(); ?>] -->
13
- <?php else: ?>
14
- <div class="featured_products">
15
- <h3><?php echo $this->getBlockName(); ?></h3>
16
- <div class="category-products">
17
- <?php $i=0; foreach ($_productCollection as $_product): ?>
18
- <?php if ($i++%$_columnCount==0): ?>
19
- <ul class="products-grid">
20
- <?php endif ?>
21
- <li class="item<?php if(($i-1)%$_columnCount==0): ?> first<?php elseif($i%$_columnCount==0): ?> last<?php endif; ?>">
22
- <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image"><img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize($w,$h); ?>" width="<?php echo $w ?>" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" /></a>
23
- <?php Mage::helper('productlabels')->display($_product); ?>
24
- <h2 class="product-name"><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($_product->getName(), null, true) ?>"><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?></a></h2>
25
- <?php echo $this->getReviewsSummaryHtml($_product, 'short') ?>
26
- <?php echo $this->getPriceHtml($_product, true) ?>
27
- <div class="actions">
28
- <?php if($_product->isSaleable()): ?>
29
- <button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button>
30
- <?php else: ?>
31
- <p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
32
- <?php endif; ?>
33
- </div>
34
- </li>
35
- <?php if ($i%$_columnCount==0 || $i==count($_productCollection)): ?>
36
- </ul>
37
- <?php endif ?>
38
- <?php endforeach ?>
39
- <script type="text/javascript">decorateGeneric($$('ul.products-grid'), ['odd','even','first','last'])</script>
40
- </div>
41
- </div>
42
- <?php endif; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/rwd/default/layout/yoochoose.xml DELETED
@@ -1,64 +0,0 @@
1
- <?xml version="1.0"?>
2
- <layout version="0.1.0">
3
-
4
- <default>
5
-
6
- <!-- Yoochoose Tracking -->
7
- <reference name="before_body_end">
8
- <block type="yoochoose/tracking" name="yoochoose.tracking" template="yoochoose/tracking.phtml" />
9
- <!-- disable again if necessary -->
10
- <action method="unsetChild" ifconfig="yoochoose/general/disabled">
11
- <name>yoochoose.tracking</name>
12
- </action>
13
- </reference>
14
-
15
- </default>
16
-
17
- <cms_index_index>
18
- <reference name="content">
19
- <block type="yoochoose/bestseller" name="yoochoose.bestseller" template="yoochoose/list.phtml">
20
- <action method="addColumnCountLayoutDepend"><layout>empty</layout><count>6</count></action>
21
- <action method="addColumnCountLayoutDepend"><layout>one_column</layout><count>5</count></action>
22
- <action method="addColumnCountLayoutDepend"><layout>two_columns_left</layout><count>4</count></action>
23
- <action method="addColumnCountLayoutDepend"><layout>two_columns_right</layout><count>4</count></action>
24
- <action method="addColumnCountLayoutDepend"><layout>three_columns</layout><count>3</count></action>
25
- </block>
26
- <!-- disable again if necessary -->
27
- <action method="unsetChild" ifconfig="yoochoose/general/disabled">
28
- <name>yoochoose.bestseller</name>
29
- </action>
30
- </reference>
31
-
32
- <reference name="content">
33
- <block type="yoochoose/personal" name="yoochoose.personal" template="yoochoose/list.phtml">
34
- <action method="addColumnCountLayoutDepend"><layout>empty</layout><count>6</count></action>
35
- <action method="addColumnCountLayoutDepend"><layout>one_column</layout><count>5</count></action>
36
- <action method="addColumnCountLayoutDepend"><layout>two_columns_left</layout><count>4</count></action>
37
- <action method="addColumnCountLayoutDepend"><layout>two_columns_right</layout><count>4</count></action>
38
- <action method="addColumnCountLayoutDepend"><layout>three_columns</layout><count>3</count></action>
39
- </block>
40
- <!-- disable again if necessary -->
41
- <action method="unsetChild" ifconfig="yoochoose/general/disabled">
42
- <name>yoochoose.personal</name>
43
- </action>
44
- </reference>
45
- </cms_index_index>
46
-
47
-
48
- <catalog_product_view>
49
- <reference name="product.info.upsell">
50
- <!-- <action method="setTemplate"><template>yoochoose/upsell.phtml</template></action> -->
51
- </reference>
52
- <reference name="catalog.product.related">
53
- <!-- <action method="setTemplate"><template>yoochoose/related.phtml</template></action> -->
54
- </reference>
55
- </catalog_product_view>
56
-
57
-
58
- <checkout_cart_index>
59
- <reference name="checkout.cart.crosssell">
60
- <!-- <action method="setTemplate"><template>yoochoose/crosssell.phtml</template></action> -->
61
- </reference>
62
- </checkout_cart_index>
63
-
64
- </layout>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/rwd/default/template/yoochoose/list.phtml DELETED
@@ -1,61 +0,0 @@
1
- <?php
2
- /**
3
- * Magento
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Academic Free License (AFL 3.0)
8
- * that is bundled with this package in the file LICENSE_AFL.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/afl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
- *
15
- * DISCLAIMER
16
- *
17
- * Do not edit or add to this file if you wish to upgrade Magento to newer
18
- * versions in the future. If you wish to customize Magento for your
19
- * needs please refer to http://www.magentocommerce.com for more information.
20
- *
21
- * @category design
22
- * @package rwd_default
23
- * @copyright Copyright (c) 2014 Magento Inc. (http://www.magentocommerce.com)
24
- * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
- */
26
- ?>
27
- <?php if (($_products = $this->getProductCollection()) && $_products->getSize()): ?>
28
- <h2 class="subtitle"><?php echo $this->__($this->newHeaderKey()); ?></h2>
29
- <?php $_columnCount = $this->getColumnCount(); ?>
30
- <ul class="products-grid products-grid--max-<?php echo $_columnCount; ?>-col">
31
- <?php $i=0; foreach ($_products->getItems() as $_product): ?>
32
- <li class="item<?php if(($i-1)%$_columnCount==0): ?> first<?php elseif($i%$_columnCount==0): ?> last<?php endif; ?>">
33
- <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->escapeHtml($_product->getName()) ?>" class="product-image">
34
- <?php $_imgSize = 260; ?>
35
- <img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize($_imgSize); ?>" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" />
36
- </a>
37
- <h3 class="product-name"><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->escapeHtml($_product->getName()) ?>"><?php echo $this->escapeHtml($_product->getName()) ?></a></h3>
38
- <?php echo $this->getReviewsSummaryHtml($_product, 'short') ?>
39
- <?php echo $this->getPriceHtml($_product, true, '-new') ?>
40
- <div class="actions">
41
- <?php if($_product->isSaleable()): ?>
42
- <button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button>
43
- <?php else: ?>
44
- <p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
45
- <?php endif; ?>
46
- <ul class="add-to-links">
47
- <?php if ($this->helper('wishlist')->isAllow()) : ?>
48
- <li><a href="<?php echo $this->getAddToWishlistUrl($_product) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>
49
- <?php endif; ?>
50
- <?php if ($_compareUrl = $this->getAddToCompareUrl($_product)): ?>
51
- <li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
52
- <?php endif; ?>
53
- </ul>
54
- </div>
55
- </li>
56
- <?php /*if ($i%$_columnCount==0 || $i==count($_products)): ?>
57
- </ul>
58
- <?php endif*/ ?>
59
- <?php endforeach; ?>
60
- </ul>
61
- <?php endif; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/smartwave/porto/layout/yoochoose.xml DELETED
@@ -1,56 +0,0 @@
1
- <?xml version="1.0"?>
2
- <layout version="0.1.0">
3
-
4
- <default>
5
- <!-- Yoochoose Tracking -->
6
- <reference name="before_body_end">
7
- <block type="yoochoose/tracking" name="yoochoose.tracking" template="yoochoose/tracking.phtml" />
8
- <!-- disable again if necessary -->
9
- <action method="unsetChild" ifconfig="yoochoose/general/disabled">
10
- <name>yoochoose.tracking</name>
11
- </action>
12
- </reference>
13
- </default>
14
-
15
- <cms_index_index>
16
- <reference name="content">
17
- <block type="yoochoose/bestseller" name="yoochoose.bestseller" template="yoochoose/list.phtml">
18
- <action method="setColumnCount"><columns>4</columns></action>
19
- </block>
20
- <!-- disable again if necessary -->
21
- <action method="unsetChild" ifconfig="yoochoose/general/disabled">
22
- <name>yoochoose.bestseller</name>
23
- </action>
24
- </reference>
25
-
26
- <reference name="content">
27
- <block type="yoochoose/personal" name="yoochoose.personal" template="yoochoose/list.phtml">
28
- <action method="setColumnCount"><columns>4</columns></action>
29
- </block>
30
- <!-- disable again if necessary -->
31
- <action method="unsetChild" ifconfig="yoochoose/general/disabled">
32
- <name>yoochoose.personal</name>
33
- </action>
34
- </reference>
35
- </cms_index_index>
36
-
37
-
38
- <catalog_product_view>
39
- <reference name="content">
40
- <block type="yoochoose/related" name="yoochoose.related" template="yoochoose/list.phtml">
41
- <action method="setColumnCount"><columns>4</columns></action>
42
- </block>
43
- <!-- disable again if necessary -->
44
- <action method="unsetChild" ifconfig="yoochoose/general/disabled">
45
- <name>yoochoose.related</name>
46
- </action>
47
- </reference>
48
- </catalog_product_view>
49
-
50
-
51
- <checkout_cart_index>
52
- <reference name="checkout.cart.crosssell">
53
- </reference>
54
- </checkout_cart_index>
55
-
56
- </layout>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/smartwave/porto/template/yoochoose/list.phtml DELETED
@@ -1,134 +0,0 @@
1
- <?php
2
- $store = Mage::app()->getStore();
3
- $code = $store->getCode();
4
- ?>
5
- <?php if(count($this->getItemCollection()->getItems())): ?>
6
- <div class="product-view">
7
- <div class="box-collateral box-up-sell category-products">
8
- <h2><span><?php echo $this->__($this->newHeaderKey()); ?></span></h2>
9
- <?php $_columnCount = 4; ?>
10
- <?php if(Mage::getStoreConfig("porto_settings/general/layout",$code) == "1024"): ?>
11
- <?php $_columnCount = 3; ?>
12
- <?php endif; ?>
13
- <?php $this->resetItemsIterator() ?>
14
- <ul class="products-grid columns<?php echo $_columnCount; ?>">
15
- <?php for($_i=0;$_i<$this->getRowCount();$_i++): ?>
16
- <?php for($_j=0;$_j<$this->getColumnCount();$_j++): ?>
17
- <?php if($_product=$this->getIterableItem()): ?>
18
- <li class="item"><div class="item-area">
19
- <div class="product-image-area">
20
- <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image">
21
- <?php
22
- if(Mage::getStoreConfig("porto_settings/category/alternative_image", $code)){
23
- ?>
24
- <img class="defaultImage" src="<?php if(Mage::getStoreConfig("porto_settings/category/aspect_ratio",$code)):?><?php echo $this->helper('catalog/image')->init($_product, 'small_image')->constrainOnly(FALSE)->keepAspectRatio(TRUE)->keepFrame(FALSE)->resize(350);?><?php else: ?><?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(Mage::getStoreConfig("porto_settings/category/ratio_width",$code),Mage::getStoreConfig("porto_settings/category/ratio_height",$code)); ?><?php endif; ?>" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>"/>
25
- <img class="hoverImage" src="<?php if(Mage::getStoreConfig("porto_settings/category/aspect_ratio",$code)):?><?php echo $this->helper('catalog/image')->init($_product, 'thumbnail')->constrainOnly(FALSE)->keepAspectRatio(TRUE)->keepFrame(FALSE)->resize(350);?><?php else: ?><?php echo $this->helper('catalog/image')->init($_product, 'thumbnail')->resize(Mage::getStoreConfig("porto_settings/category/ratio_width",$code),Mage::getStoreConfig("porto_settings/category/ratio_height",$code)); ?><?php endif; ?>" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'thumbnail'), null, true) ?>"/>
26
- <?php
27
- } else {
28
- ?>
29
- <img src="<?php if(Mage::getStoreConfig("porto_settings/category/aspect_ratio",$code)):?><?php echo $this->helper('catalog/image')->init($_product, 'small_image')->constrainOnly(FALSE)->keepAspectRatio(TRUE)->keepFrame(FALSE)->resize(350);?><?php else: ?><?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(Mage::getStoreConfig("porto_settings/category/ratio_width",$code),Mage::getStoreConfig("porto_settings/category/ratio_height",$code)); ?><?php endif; ?>" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>"/>
30
- <?php
31
- }
32
- ?>
33
- </a>
34
- <?php
35
- // Get the Special Price
36
- $specialprice = Mage::getModel('catalog/product')->load($_product->getId())->getSpecialPrice();
37
- // Get the Special Price FROM date
38
- $specialPriceFromDate = Mage::getModel('catalog/product')->load($_product->getId())->getSpecialFromDate();
39
- // Get the Special Price TO date
40
- $specialPriceToDate = Mage::getModel('catalog/product')->load($_product->getId())->getSpecialToDate();
41
- // Get Current date
42
- $today = time();
43
-
44
- if ($specialprice){
45
- if($today >= strtotime( $specialPriceFromDate) && $today <= strtotime($specialPriceToDate) || $today >= strtotime( $specialPriceFromDate) && is_null($specialPriceToDate)){
46
- if(Mage::getStoreConfig("porto_settings/product_label/sale", $code)){
47
- ?>
48
- <div class="product-label" style="right: 10px;"><span class="sale-product-icon"><?php echo Mage::getStoreConfig("porto_settings/product_label/sale_label_text", $code);?></span></div>
49
- <?php
50
- }
51
- }
52
- }
53
- ?>
54
- <?php
55
- $now = date("Y-m-d");
56
- $newsFrom= substr($_product->getData('news_from_date'),0,10);
57
- $newsTo= substr($_product->getData('news_to_date'),0,10);
58
- if ($newsTo != '' || $newsFrom != ''){
59
- if (($newsTo != '' && $newsFrom != '' && $now>=$newsFrom && $now<=$newsTo) || ($newsTo == '' && $now >=$newsFrom) || ($newsFrom == '' && $now<=$newsTo))
60
- {
61
- if(Mage::getStoreConfig("porto_settings/product_label/new", $code)){
62
- ?>
63
- <div class="product-label" style="left: 10px;"><span class="new-product-icon"><?php echo Mage::getStoreConfig("porto_settings/product_label/new_label_text", $code);?></span></div>
64
- <?php
65
- }
66
- }
67
- }
68
- ?>
69
- </div>
70
- <div class="details-area">
71
- <h2 class="product-name"><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($_product->getName(), null, true) ?>"><?php echo $_product->getName() ?></a></h2>
72
- <?php
73
- if (Mage::helper('catalog')->isModuleEnabled('Mage_Review')):
74
- if($_product->getRatingSummary()):
75
- ?>
76
- <?php
77
- $review_html = $this->getReviewsSummaryHtml($_product, 'short');
78
- if($review_html){
79
- echo $review_html;
80
- }else{
81
- ?>
82
- <div class="ratings">
83
- <div class="rating-box">
84
- <div class="rating" style="width:0"></div>
85
- </div>
86
- </div>
87
- <?php
88
- }
89
- ?>
90
- <?php else: ?>
91
- <div class="ratings">
92
- <div class="rating-box">
93
- <div class="rating" style="width:0"></div>
94
- </div>
95
- </div>
96
- <?php
97
- endif;
98
- endif;
99
- ?>
100
- <?php echo $this->getPriceHtml($_product, true) ?>
101
- <div class="actions">
102
- <?php if (Mage::getStoreConfig("porto_settings/category_grid/show_addtolinks", $code) && $this->helper('wishlist')->isAllow()) : ?>
103
- <a href="<?php if(Mage::getStoreConfig("ajaxcart/addtolinks/enablecategory", $code)):?>javascript:ajaxWishlist('<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>','<?php echo $_product->getId()?>');<?php else: ?><?php echo $this->helper('wishlist')->getAddUrl($_product) ?><?php endif; ?>" class="addtowishlist" title="<?php echo $this->__('Add to Wishlist') ?>"><i class="icon-wishlist"></i></a>
104
- <?php endif; ?>
105
- <?php if (Mage::getStoreConfig("porto_settings/category_grid/show_addtocart", $code)): ?>
106
- <?php if ( !($_product->getData('has_options') || $_product->isGrouped()) ) : ?>
107
- <a href="<?php if(Mage::getStoreConfig("ajaxcart/addtocart/enablecategory", $code)):?>javascript:setLocationAjax('<?php echo $this->getAddToCartUrl($_product) ?>')<?php else: ?><?php echo $this->getAddToCartUrl($_product) ?><?php endif; ?>" class="addtocart" title="<?php echo $this->__('Add to Cart') ?>"><i class="icon-cart"></i>&nbsp;<?php echo $this->__('Add to Cart') ?></a>
108
- <?php else : ?>
109
- <a href="<?php if(Mage::getStoreConfig("ajaxcart/addtocart/enablecategory", $code)):?>javascript:showOptions('<?php echo $_product->getId()?>')<?php else: ?><?php echo $this->getAddToCartUrl($_product) ?><?php endif; ?>" class="addtocart" title="<?php echo $this->__('Add to Cart') ?>"><i class="icon-cart"></i>&nbsp;<?php echo $this->__('Add to Cart') ?></a>
110
- <a href='<?php echo $this->getUrl('ajaxcart/index/options',array('product_id'=>$_product->getId()));?>' class='fancybox' id='fancybox<?php echo $_product->getId()?>' style='display:none'>Options</a>
111
- <?php endif;?>
112
- <?php endif; ?>
113
- <?php if(Mage::getStoreConfig("porto_settings/category_grid/show_addtolinks", $code) && Mage::getStoreConfig("porto_settings/category/compare", $code) && $_compareUrl=$this->getAddToCompareUrl($_product)): ?>
114
- <a href="<?php if(Mage::getStoreConfig("ajaxcart/addtolinks/enablecategory", $code)):?>javascript:ajaxCompare('<?php echo $_compareUrl ?>','<?php echo $_product->getId()?>');<?php else: ?><?php echo $_compareUrl ?><?php endif; ?>" class="comparelink" title="<?php echo $this->__('Add to Compare') ?>"><i class="icon-compare"></i></a>
115
- <?php endif; ?>
116
- <div class="clearer"></div>
117
- </div>
118
- </div>
119
- </div></li>
120
- <?php endif; ?>
121
- <?php endfor; ?>
122
- <?php endfor; ?>
123
- </ul>
124
- <script type="text/javascript">
125
- jQuery('.col-main .products-grid li:nth-child(2n)').addClass('nth-child-2n');
126
- jQuery('.col-main .products-grid li:nth-child(2n+1)').addClass('nth-child-2np1');
127
- jQuery('.col-main .products-grid li:nth-child(3n)').addClass('nth-child-3n');
128
- jQuery('.col-main .products-grid li:nth-child(3n+1)').addClass('nth-child-3np1');
129
- jQuery('.col-main .products-grid li:nth-child(4n)').addClass('nth-child-4n');
130
- jQuery('.col-main .products-grid li:nth-child(4n+1)').addClass('nth-child-4np1');
131
- </script>
132
- </div>
133
- </div>
134
- <?php endif; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/etc/modules/AvS_Yoochoose.xml DELETED
@@ -1,9 +0,0 @@
1
- <?xml version="1.0"?>
2
- <config>
3
- <modules>
4
- <AvS_Yoochoose>
5
- <active>true</active>
6
- <codePool>community</codePool>
7
- </AvS_Yoochoose>
8
- </modules>
9
- </config>
 
 
 
 
 
 
 
 
 
app/etc/modules/Yoochoose_JsTracking.xml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <config>
3
+ <modules>
4
+ <Yoochoose_JsTracking>
5
+ <active>true</active>
6
+ <!-- Which code pool to use: core, community or local -->
7
+ <codePool>community</codePool>
8
+ </Yoochoose_JsTracking>
9
+ </modules>
10
+ </config>
app/locale/de_DE/AvS_Yoochoose.csv DELETED
@@ -1,4 +0,0 @@
1
-
2
-
3
- Best Sellers,Bestsellers
4
- Recommendations for You,Empfehlungen für Sie
 
 
 
 
package.xml CHANGED
@@ -1,165 +1,38 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>YOOCHOOSE_Recommender_Engine</name>
4
- <version>1.4.6</version>
5
  <stability>stable</stability>
6
- <license> Apache License</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Use our superior and patented recommender engine to boost your online sales with personalized and self-learning recommendations.</summary>
10
- <description>All leading online shops have already identifies the enormous revenue potential of professional recommendation services. Our experiences with other online shops show that a sales growth of up to 20% can be expected. &#xD;
11
- &#xD;
12
- Recommendation types supported by the extension: People who bought this product, also bought that. People who searched for this kind of product, finally bought this. Best sellers. Personalized recommendations: Products recommended according to the user's click or buy.</description>
13
- <notes>New features:&#xD;
14
- - Dynamic home page with best sellers and personalized recommendations for the current customer.&#xD;
15
- - Multiple rows in the recommendation blocks.&#xD;
16
- - Conversion rate and added revenue in the Yoochoose &#xD;
17
- configuration backend.&#xD;
18
- &#xD;
19
- Updates and Bug-Fixes:&#xD;
20
- - Completely rewritten manual.&#xD;
21
- - Simplified configuration.&#xD;
22
- - No SQL changes needed for installation&#xD;
23
- - Manual entered recommendations fixed&#xD;
24
- - Customer profile transfer simplified</notes>
25
- <authors><author><name>Rodion Alukhanov</name><user>admin</user><email>rodion.alukhanov@yoochoose.com</email></author></authors>
26
- <date>2014-05-27</date>
27
- <time>14:21:22</time>
28
- <contents>
29
- <target name="magecommunity">
30
- <dir name="AvS">
31
- <dir name="Yoochoose">
32
- <dir name="Block">
33
- <file name="Bestseller.php"/>
34
- <file name="Crosssell.php"/>
35
- <dir name="Field">
36
- <file name="Readonly.php"/>
37
- </dir>
38
- <file name="Personal.php"/>
39
- <file name="Recoabstract.php" />
40
- <file name="Related.php"/>
41
- <file name="Tracking.php"/>
42
- <file name="Upsell.php"/>
43
- </dir>
44
- <dir name="Helper">
45
- <file name="Data.php"/>
46
- </dir>
47
- <dir name="Model">
48
- <dir name="Api">
49
- <file name="Event.php"/>
50
- <dir name="Recommendation">
51
- <file name="Bestseller.php"/>
52
- <file name="Crossselling.php"/>
53
- <file name="Personal.php"/>
54
- <file name="Related.php"/>
55
- <file name="Upselling.php"/>
56
- </dir>
57
- <file name="Recommendation.php" />
58
- </dir>
59
- <file name="Api.php"/>
60
- <file name="Observer.php"/>
61
- <dir name="Source">
62
- <file name="Added.php"/>
63
- <file name="Overwritten.php"/>
64
- </dir>
65
- </dir>
66
- <dir name="etc">
67
- <file name="config.xml"/>
68
- <file name="system.xml"/>
69
- </dir>
70
- </dir>
71
- </dir>
72
- </target>
73
- <target name="magedesign">
74
- <dir name="frontend">
75
- <dir name="argento">
76
- <dir name="pure">
77
- <dir name="layout">
78
- <file name="yoochoose.xml"/>
79
- </dir>
80
- <dir name="template">
81
- <dir name="yoochoose">
82
- <file name="yoochoose_bestseller.phtml"/>
83
- <file name="yoochoose_personal.phtml"/>
84
- <file name="yoochoose_related.phtml"/>
85
- <file name="yoochoose_upsell.phtml"/>
86
- </dir>
87
- </dir>
88
- </dir>
89
- </dir>
90
- <dir name="base"><!-- it is a fallback configuration -->
91
- <dir name="default">
92
- <dir name="layout">
93
- <file name="yoochoose.xml"/>
94
- </dir>
95
- <dir name="template">
96
- <dir name="yoochoose">
97
- <file name="tracking.phtml"/>
98
- </dir>
99
- </dir>
100
- </dir>
101
- </dir>
102
- <dir name="default"><!-- it is an old orange template (default template in CE before 1.9) -->
103
- <dir name="default">
104
- <dir name="layout">
105
- <file name="yoochoose.xml"/>
106
- </dir>
107
- <dir name="template">
108
- <dir name="yoochoose">
109
- <file name="new.phtml"/>
110
- </dir>
111
- </dir>
112
- </dir>
113
- </dir>
114
- <dir name="galaeverbuy">
115
- <dir name="default">
116
- <dir name="layout">
117
- <file name="yoochoose.xml"/>
118
- </dir>
119
- <dir name="template">
120
- <dir name="yoochoose">
121
- <file name="list.phtml"/>
122
- </dir>
123
- </dir>
124
- </dir>
125
- </dir>
126
- <dir name="rwd"><!-- it is a default blue template for CE 1.9 and later -->
127
- <dir name="default">
128
- <dir name="layout">
129
- <file name="yoochoose.xml"/>
130
- </dir>
131
- <dir name="template">
132
- <dir name="yoochoose">
133
- <file name="list.phtml"/>
134
- </dir>
135
- </dir>
136
- </dir>
137
- </dir>
138
- <dir name="smartwave">
139
- <dir name="porto">
140
- <dir name="layout">
141
- <file name="yoochoose.xml"/>
142
- </dir>
143
- <dir name="template">
144
- <dir name="yoochoose">
145
- <file name="list.phtml"/>
146
- </dir>
147
- </dir>
148
- </dir>
149
- </dir>
150
- </dir>
151
- </target>
152
- <target name="magelocale">
153
- <dir name="de_DE">
154
- <file name="AvS_Yoochoose.csv"/>
155
- </dir>
156
- </target>
157
- <target name="mageetc">
158
- <dir name="modules">
159
- <file name="AvS_Yoochoose.xml"/>
160
- </dir>
161
- </target>
162
- </contents>
163
  <compatible/>
164
- <dependencies><required><php><min>5.3.0</min><max>5.10.0</max></php></required></dependencies>
 
 
 
 
 
 
 
165
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>YOOCHOOSE_Recommender_Engine</name>
4
+ <version>2.0.0</version>
5
  <stability>stable</stability>
6
+ <license>MIT</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Use our superior and patented recommender engine to boost your online sales with personalized and self-learning recommendations.</summary>
10
+ <description>
11
+ All leading online shops have already identifies the enormous revenue potential of professional
12
+ recommendation services. Our experiences with other online shops show that a sales growth of up
13
+ to 20% can be expected. &#xD;&#xD;
14
+ Recommendation types supported by the extension: People who bought this product, also bought that.
15
+ People who searched for this kind of product, finally bought this. Best sellers. Personalized
16
+ recommendations: Products recommended according to the user's click or buy.
17
+ </description>
18
+ <notes/>
19
+ <authors>
20
+ <author>
21
+ <name>yoochoose</name>
22
+ <user>yoochoose</user>
23
+ <email>support@yoochoose.com</email>
24
+ </author>
25
+ </authors>
26
+ <date>2015-07-27</date>
27
+ <time>11:25:25</time>
28
+ <contents><target name="mageetc"><dir name="modules"><file name="Yoochoose_JsTracking.xml" hash="14527f4cb00af1e51ae49735de37bf07"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="yoochoose_jstracking.xml" hash="168087bdb7131b4770d6f5678b533da5"/></dir><dir name="template"><dir name="yoochoose"><file name="head.phtml" hash="6664db6c78bb01ebbc7f329117dbf2f6"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="base"><dir name="default"><dir name="template"><dir name="yoochoose"><dir name="system"><dir name="config"><file name="configure_auth.phtml" hash="6fd498b6bd4c0f6645133e32e024e2d4"/><file name="customize.phtml" hash="7089e299419ce91bc3d29862987ce966"/><file name="register.phtml" hash="fb122e554f22db9621f406b36964dd53"/></dir></dir></dir></dir></dir></dir></dir></target><target name="magecommunity"><dir name="Yoochoose"><dir name="JsTracking"><dir name="Block"><dir name="Field"><file name="ConfigureAuth.php" hash="ce97bdaa6c0e706ec369f9f17edff852"/><file name="Customize.php" hash="4d6c47263d5604b16f501e3e063c4594"/><file name="Language.php" hash="37229ec818f82c4400b38655c8dbc92f"/><file name="Readonly.php" hash="97aa48dad489377d7c183f5dc12d5bb7"/><file name="Register.php" hash="feca222aaad944bd0fd5843c00c3a90b"/></dir><file name="Head.php" hash="979ff183780a2fb456e75ba44b3e6f90"/></dir><dir name="Helper"><file name="Data.php" hash="13263edfbe948e01d612acb977dcb519"/></dir><dir name="Model"><dir name="Adminhtml"><dir name="Search"><file name="Catalog.php" hash="ae4a136dace9d2eba7295064df0e8a25"/></dir></dir><dir name="Api2"><dir name="YCCategory"><dir name="Rest"><dir name="Admin"><file name="V1.php" hash="4c472bb5c4303b87782cdbd80780bc7a"/></dir></dir></dir><file name="YCCategory.php" hash="057f7d74de4b516a5f40ba7ca90444d2"/><dir name="YCProducts"><dir name="Rest"><dir name="Admin"><file name="V1.php" hash="41d5f47548ca59f3748ffd6c9a4ae2bd"/></dir></dir></dir><file name="YCProducts.php" hash="eeb12a6aac6bdcd54255e266a72ebbfc"/><dir name="YCStoreView"><dir name="Rest"><dir name="Admin"><file name="V1.php" hash="3175f0494eb930aab7007a4307c07e2b"/></dir></dir></dir><file name="YCStoreView.php" hash="0df53a526e74f7599cb6e280801ddd3b"/><dir name="YCSubscriber"><dir name="Rest"><dir name="Admin"><file name="V1.php" hash="791fd6ae69f5c0ffce26570d123fbe38"/></dir></dir></dir><file name="YCSubscriber.php" hash="4b14357894a245ddf6de7d035074d8b5"/></dir><file name="Observer.php" hash="8a69a3c956a21e692ccec5d695e5f47d"/><file name="RequiredValidation.php" hash="40b3d59328810b5be34ad71b43a06e95"/><file name="ScriptValidation.php" hash="9f2273ad041f0c6ae1d67a2b1111cb40"/><dir name="System"><dir name="Config"><dir name="Source"><file name="DisplayRecommendation.php" hash="70bb3693b6a98d127e288f172fb79b81"/><file name="Languages.php" hash="eea7f822218c77e79d7a846967e4256c"/><file name="RenderSource.php" hash="612a9bcfef8c11a23e53cd006c633954"/></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="YoochooseController.php" hash="0ce02d730647497ced42d19339034b02"/></dir><file name="ProductsController.php" hash="c671a9390a595ae48df4a64e0ca84544"/><file name="ResultController.php" hash="820f75e120bc3baf5461e4086eb53a05"/></dir><dir name="etc"><file name="adminhtml.xml" hash="eb2bc6290160e21ca92ae377e640a179"/><file name="api2.xml" hash="b5e6e4d319b54dc51021130dc1be52ff"/><file name="config.xml" hash="84a2996b077dcd0b4742577d540f1a87"/><file name="config.xml.orig" hash="84a2996b077dcd0b4742577d540f1a87"/><file name="system.xml" hash="5b44e489b58c97187849ae5c79c4e777"/></dir></dir></dir></target></contents>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  <compatible/>
30
+ <dependencies>
31
+ <required>
32
+ <php>
33
+ <min>5.1.0</min>
34
+ <max>6.0.0</max>
35
+ </php>
36
+ </required>
37
+ </dependencies>
38
  </package>