unbxd_recommendation - Version 1.0.20

Version Notes

Unbxd Recommendation

Download this release

Release Info

Developer ananthesh
Extension unbxd_recommendation
Version 1.0.20
Comparing to
See all releases


Code changes from version 1.0.19 to 1.0.20

app/code/local/Unbxd/Recscore/Helper/Confighelper.php CHANGED
@@ -5,7 +5,8 @@
5
  * @package Unbxd_Recscore
6
  * @author Unbxd Software Pvt. Ltd
7
  */
8
- class Unbxd_Recscore_Helper_Confighelper extends Unbxd_Recscore_Helper_Data {
 
9
 
10
  const SITE_KEY = "site_key";
11
 
@@ -32,13 +33,14 @@ class Unbxd_Recscore_Helper_Confighelper extends Unbxd_Recscore_Helper_Data {
32
  */
33
  public static $data_types = array("text", "longText", "link", "decimal", "number", "datetime");
34
 
35
- public function validateAndSaveKeys($website, $requestBody){
 
36
  $errors = $this->validateKeyParams($requestBody);
37
- if(sizeof($errors) > 0) {
38
  return $errors;
39
  }
40
  $requestParams = json_decode($requestBody, true);
41
- if(!$requestParams) {
42
  $errors['message'] = 'Invalid Request';
43
  return $errors;
44
  }
@@ -47,16 +49,16 @@ class Unbxd_Recscore_Helper_Confighelper extends Unbxd_Recscore_Helper_Data {
47
  ->setData(Unbxd_Recscore_Model_Api_Task_Validatekeys::SITE_KEY, $requestParams[self::SITE_KEY])
48
  ->prepare($website)
49
  ->process();
50
- if(!$response->isSuccess()) {
51
  return $response->getErrors();
52
  }
53
 
54
- $existingSecretKey = Mage::getResourceModel('unbxd_recscore/config')
55
- ->getValue($website->getWebsiteId(), Unbxd_Recscore_Helper_Constants::SECRET_KEY);
56
- $keyAlreadyExists = !is_null($existingSecretKey);
57
- if($keyAlreadyExists) {
58
- $this->flushConfigs($website);
59
- }
60
 
61
  Mage::getResourceModel('unbxd_recscore/config')
62
  ->setValue($website->getWebsiteId(), Unbxd_Recscore_Helper_Constants::SECRET_KEY,
@@ -73,80 +75,89 @@ class Unbxd_Recscore_Helper_Confighelper extends Unbxd_Recscore_Helper_Data {
73
  ->setValue($website->getWebsiteId(),
74
  Unbxd_Recscore_Helper_Constants::USERNAME,
75
  $response[Unbxd_Recscore_Model_Api_Task_Validatekeys::USERNAME]);
76
- $this->saveConfig(Mage::app()->getWebsite(),
77
- array(Unbxd_Recscore_Helper_Constants::API_KEY => $response[Unbxd_Recscore_Model_Api_Task_Validatekeys::API_KEY],
78
- Unbxd_Recscore_Helper_Constants::SITE_KEY => $requestParams[Unbxd_Recscore_Helper_Constants::SITE_KEY]));
79
  return $errors;
80
  }
81
 
82
- public function flushConfigs($website) {
83
- Mage::helper('unbxd_recscore')->log(Zend_Log::DEBUG, 'Flushing all the configs');
84
- $configs = $this->getEngineConfigData('', $website, true);
85
- foreach($configs as $config=>$value) {
86
- Mage::getConfig()->deleteConfig(Unbxd_Recscore_Helper_Constants::UNBXD_CONFIG_PREFIX .
87
- Unbxd_Recscore_Helper_Constants::CONFIG_SEPARATOR .
88
- $config,
89
- 'websites',
90
- (int)$website->getWebsiteId());
91
- }
92
- Mage::getResourceModel('unbxd_recscore/config')->deleteAll($website->getWebsiteId());
 
93
 
94
  }
95
 
96
- public function validateKeyParams($requestBody) {
 
97
  $errors = array();
98
  $requestParams = json_decode($requestBody, true);
99
- if(!$requestParams) {
100
  Mage::helper('unbxd_recscore')->log(Zend_Log::ERR, 'Invalid request with requestBody' . $requestBody);
101
  $errors['message'] = 'Invalid Request';
102
  return $errors;
103
  }
104
- if(!array_key_exists(Unbxd_Recscore_Helper_Constants::SECRET_KEY,$requestParams)){
105
  $errors[Unbxd_Recscore_Helper_Constants::SECRET_KEY] = "Has Empty Data";
106
  }
107
- if(!array_key_exists(Unbxd_Recscore_Helper_Constants::SITE_KEY, $requestParams)) {
108
  $errors[Unbxd_Recscore_Helper_Constants::SITE_KEY] = "Has Empty Data";
109
  }
110
  return $errors;
111
  }
112
 
113
- public function getFeatureFields() {
 
114
  return Unbxd_Recscore_Model_Field::$feature_fields;
115
  }
116
 
117
- public function getAllAttributes($fieldNameAsKey = false) {
 
118
  $attributes = Mage::getSingleton('eav/config')
119
  ->getEntityType(Mage_Catalog_Model_Product::ENTITY)->getAttributeCollection();
120
  $fields = array();
121
- foreach($attributes as $attribute) {
122
  $attributeType = $attribute->getFrontendInput();
123
- $fieldType = $attributeType == 'media_image'?Unbxd_Recscore_Helper_Constants::FIELD_TYPE_IMAGE:
124
- ($attributeType == 'price'?Unbxd_Recscore_Helper_Constants::FIELD_TYPE_NUMBER:
125
- ($attributeType == 'date'?Unbxd_Recscore_Helper_Constants::FIELD_TYPE_DATE:
126
  Unbxd_Recscore_Helper_Constants::FIELD_TYPE_STRING));
127
- $fieldType = ($attribute->getName() == "created_at")?Unbxd_Recscore_Helper_Constants::FIELD_TYPE_DATE:$fieldType;
128
- $fieldType = ($attribute->getName() == "updated_at")?Unbxd_Recscore_Helper_Constants::FIELD_TYPE_DATE:$fieldType;
129
- if($fieldNameAsKey) {
130
- $fields[$attribute->getName()] = array(Unbxd_Recscore_Helper_Constants::FIELD_NAME => $attribute->getName(),
131
- Unbxd_Recscore_Helper_Constants::FIELD_TYPE => $fieldType);
132
- } else {
133
- $fields[] = array(Unbxd_Recscore_Helper_Constants::FIELD_NAME => $attribute->getName(),
134
- Unbxd_Recscore_Helper_Constants::FIELD_TYPE => $fieldType);
135
- }
 
 
 
 
 
 
 
 
 
 
 
136
  }
137
- if($fieldNameAsKey) {
138
- $fields['final_price'] = array(Unbxd_Recscore_Helper_Constants::FIELD_NAME =>"final_price",
139
- Unbxd_Recscore_Helper_Constants::FIELD_TYPE => Unbxd_Recscore_Helper_Constants::FIELD_TYPE_NUMBER);
140
- } else {
141
- $fields[] = array(Unbxd_Recscore_Helper_Constants::FIELD_NAME =>"final_price",
142
- Unbxd_Recscore_Helper_Constants::FIELD_TYPE => Unbxd_Recscore_Helper_Constants::FIELD_TYPE_NUMBER);
143
- }
144
  return $fields;
145
  }
146
 
147
- private function getFieldMapping($fields) {
 
148
  $fieldMapping = array();
149
- foreach($fields as $field) {
150
  $fieldMapping[$field->getFieldName()] = $field;
151
  }
152
  return $fieldMapping;
@@ -156,53 +167,56 @@ class Unbxd_Recscore_Helper_Confighelper extends Unbxd_Recscore_Helper_Data {
156
  * @param $fields
157
  * @return array
158
  */
159
- private function validate($fields) {
 
160
  $errors = array();
161
- if(!is_array($fields)) {
162
- $errors["message"] = "Expecting theInput data should be an array, Given " . gettype($fields);
163
- return $errors;
164
- }
165
- $existingAttributes = $this->getAllAttributes(true);
166
- $featureFields = Mage::getModel('unbxd_recscore/field')->getFeaturedFields();
167
- foreach($fields as $field) {
168
- if(!array_key_exists(Unbxd_Recscore_Model_Field::field_name, $field)) {
169
  $errors["extra"] = "Not Present for all the fields";
170
- continue;
171
  } else if (is_null($field[Unbxd_Recscore_Model_Field::field_name]) ||
172
- $field[Unbxd_Recscore_Model_Field::field_name] =="") {
 
173
  $errors["extra"] = "field Name is empty for some fields";
174
- continue;
175
  }
176
  if (!array_key_exists(Unbxd_Recscore_Model_Field::datatype, $field)) {
177
  $errors[$field[Unbxd_Recscore_Model_Field::field_name]] = "Not Present for all the fields";
178
- } else if (!in_array($field[Unbxd_Recscore_Model_Field::datatype], Unbxd_Recscore_Model_Field::$data_types)){
179
- Mage::helper('unbxd_recscore')->log(Zend_Log::ERR, 'Invalid feature field '.
180
  $field[Unbxd_Recscore_Model_Field::datatype]);
181
  $errors[$field[Unbxd_Recscore_Model_Field::field_name]] = "Invalid datatype specified";
182
  }
183
-
184
- if(array_key_exists($field[Unbxd_Recscore_Model_Field::field_name], $existingAttributes)) {
185
- if(!Mage::getSingleton('unbxd_recscore/field')->validateDatatype($field[Unbxd_Recscore_Model_Field::datatype], $existingAttributes[$field[Unbxd_Recscore_Model_Field::field_name]][Unbxd_Recscore_Helper_Constants::FIELD_TYPE])) {
186
- $errors[$field[Unbxd_Recscore_Model_Field::field_name]] = "Field cannot be mapped to " . $field[Unbxd_Recscore_Model_Field::datatype];
187
- }
188
- }
189
 
190
  if (array_key_exists(Unbxd_Recscore_Model_Field::featured_field, $field)) {
191
- if(!array_key_exists($field[Unbxd_Recscore_Model_Field::featured_field], $featureFields)) {
192
- Mage::helper('unbxd_recscore')->log(Zend_Log::ERR, 'Invalid feature field '.
193
  $field[Unbxd_Recscore_Model_Field::featured_field]);
194
  $errors[$field[Unbxd_Recscore_Model_Field::field_name]] = "Invalid feature field specified";
195
- } else if(!Mage::getSingleton('unbxd_recscore/field')->validateDatatype($featureFields[$field[Unbxd_Recscore_Model_Field::featured_field]]["datatype"], $existingAttributes[$field[Unbxd_Recscore_Model_Field::field_name]][Unbxd_Recscore_Helper_Constants::FIELD_TYPE])){
196
- $errors[$field[Unbxd_Recscore_Model_Field::field_name]] = "Field cannot be mapped to " . $field[Unbxd_Recscore_Model_Field::datatype];
197
- }
198
  }
199
  }
200
  return $errors;
201
  }
202
 
203
- public function deleteFields($fields, $website) {
 
204
  $errors = $this->validate($fields);
205
- if(sizeof($errors) != 0) {
206
  return $errors;
207
  }
208
  $collection = $this->buildFieldCollection($fields, $website);
@@ -214,29 +228,23 @@ class Unbxd_Recscore_Helper_Confighelper extends Unbxd_Recscore_Helper_Data {
214
  * @param $website
215
  * @return array
216
  */
217
- public function saveFields($fields, $website) {
 
218
  $errors = $this->validate($fields);
219
- if(sizeof($errors) != 0) {
220
  return $errors;
221
  }
222
  $collection = $this->buildFieldCollectionToAdd($fields, $website);
223
  $response = Mage::getModel("unbxd_recscore/field")->saveFields($collection);
224
- if(!is_array($response) && $response === true) {
225
- $urlName = Mage::getResourceModel('unbxd_recscore/field')->getFieldByFeatureField(Mage::app()->getWebsite()->getWebsiteId(),
226
- Unbxd_Recscore_Helper_Constants::FEATURE_FIELD_PRODUCT_URL);
227
- $priceName = Mage::getResourceModel('unbxd_recscore/field')->getFieldByFeatureField(Mage::app()->getWebsite()->getWebsiteId(),
228
- Unbxd_Recscore_Helper_Constants::FEATURE_FIELD_PRODUCT_URL);
229
- Mage::helper('unbxd_recscore')->saveConfig(Mage::app()->getWebsite(),
230
- array(Unbxd_Recscore_Helper_Constants::FEATURE_FIELD_PRODUCT_URL => $urlName));
231
- Mage::helper('unbxd_recscore')->saveConfig(Mage::app()->getWebsite(),
232
- array(Unbxd_Recscore_Helper_Constants::FEATURE_FIELD_PRICE => $priceName));
233
-
234
  $this->triggerUpdateFeatureField($website);
235
  }
236
  }
237
 
238
 
239
- public function triggerUpdateFeatureField(Mage_Core_Model_Website $website) {
 
240
  Mage::getResourceModel('unbxd_recscore/config')
241
  ->setValue($website->getWebsiteId(),
242
  Unbxd_Recscore_Helper_Constants::NEED_FEATURE_FIELD_UPDATION,
@@ -249,46 +257,51 @@ class Unbxd_Recscore_Helper_Confighelper extends Unbxd_Recscore_Helper_Data {
249
  * @param Mage_Core_Model_Website $website
250
  * @return void
251
  */
252
- public function triggerFeedUpload(Mage_Core_Model_Website $website) {
 
253
  Mage::getModel('unbxd_recscore/api_task_triggerfeedupload')
254
  ->prepare($website)
255
  ->process();
256
  }
257
 
258
 
259
- private function getFeatureFieldToFieldMapping($fields) {
 
260
  $featureFieldToFieldMapping = array();
261
- foreach($fields as $field) {
262
- if($field instanceof Unbxd_Recscore_Model_Field &&
263
  $field->hasData(Unbxd_Recscore_Model_Field::featured_field) &&
264
- !is_null($field->getData(Unbxd_Recscore_Model_Field::featured_field))) {
 
265
  $featureFieldToFieldMapping[$field[Unbxd_Recscore_Model_Field::featured_field]] = $field;
266
  }
267
  }
268
  return $featureFieldToFieldMapping;
269
  }
270
 
271
- private function buildFieldCollection($fields, $website) {
 
272
  $collection = array();
273
  $fieldMapping = $this->getFieldMapping($this->getFields($fields, $website));
274
- foreach($fields as $field) {
275
  if (!array_key_exists(Unbxd_Recscore_Model_Field::field_name, $field)) {
276
  continue;
277
  }
278
- if(array_key_exists($field[Unbxd_Recscore_Model_Field::field_name], $fieldMapping)) {
279
  $collection[]["delete"] = $fieldMapping[$field[Unbxd_Recscore_Model_Field::field_name]];
280
  }
281
  }
282
  return $collection;
283
  }
284
 
285
- private function buildFieldCollectionToAdd($fields, $website) {
 
286
  $collection = array();
287
  $fieldMapping = $this->getFieldMapping($this->getFields($fields, $website));
288
  $featureFieldToFieldMapping = $this->getFeatureFieldToFieldMapping($fieldMapping);
289
 
290
- foreach($fields as $field) {
291
- if(!array_key_exists(Unbxd_Recscore_Model_Field::field_name, $field)) {
292
  continue;
293
  }
294
  /*
@@ -311,37 +324,35 @@ class Unbxd_Recscore_Helper_Confighelper extends Unbxd_Recscore_Helper_Data {
311
  */
312
 
313
  // case 1
314
- if(array_key_exists($field[Unbxd_Recscore_Model_Field::field_name], $fieldMapping ) &&
315
  $fieldMapping[$field[Unbxd_Recscore_Model_Field::field_name]]->hasData(Unbxd_Recscore_Model_Field::featured_field) &&
316
- !is_null($fieldMapping[$field[Unbxd_Recscore_Model_Field::field_name]]->getData(Unbxd_Recscore_Model_Field::featured_field))) {
 
317
  //case 1 a)
318
  if (array_key_exists(Unbxd_Recscore_Model_Field::featured_field, $field) &&
319
  $field[Unbxd_Recscore_Model_Field::featured_field] ==
320
- $fieldMapping[$field[Unbxd_Recscore_Model_Field::field_name]][Unbxd_Recscore_Model_Field::featured_field]) {
 
321
  continue;
322
- }
323
- // case 1 b)
324
  else if (array_key_exists(Unbxd_Recscore_Model_Field::featured_field, $field)) {
325
  $collection[]["delete"] = $featureFieldToFieldMapping[$field[Unbxd_Recscore_Model_Field::featured_field]];
326
  $collection[]["delete"] = $fieldMapping[$field[Unbxd_Recscore_Model_Field::field_name]];
327
  $fieldModel = Mage::getModel("unbxd_recscore/field");
328
  $fieldModel->setFeaturedField($field[Unbxd_Recscore_Model_Field::featured_field]);
329
- }
330
-
331
- //case 1 c)
332
  else {
333
  $collection[]["delete"] = $fieldMapping[$field[Unbxd_Recscore_Model_Field::field_name]];
334
  $fieldModel = Mage::getModel("unbxd_recscore/field");
335
 
336
  }
337
- } else if(array_key_exists($field[Unbxd_Recscore_Model_Field::field_name], $fieldMapping)) {
338
  //case 2 a)
339
  if (array_key_exists(Unbxd_Recscore_Model_Field::featured_field, $field)) {
340
  $collection[]["delete"] = $fieldMapping[$field[Unbxd_Recscore_Model_Field::field_name]];
341
  $fieldModel = Mage::getModel("unbxd_recscore/field");
342
  $fieldModel->setFeaturedField($field[Unbxd_Recscore_Model_Field::featured_field]);
343
- }
344
- // case 2 b)
345
  else {
346
  $fieldModel = $fieldMapping[$field[Unbxd_Recscore_Model_Field::field_name]];
347
  }
@@ -349,10 +360,10 @@ class Unbxd_Recscore_Helper_Confighelper extends Unbxd_Recscore_Helper_Data {
349
  $fieldModel = Mage::getModel("unbxd_recscore/field");
350
  if (array_key_exists(Unbxd_Recscore_Model_Field::featured_field, $field)) {
351
  $fieldModel->setFeaturedField($field[Unbxd_Recscore_Model_Field::featured_field]);
352
- // case 3 a)
353
- if(array_key_exists($field[Unbxd_Recscore_Model_Field::featured_field], $featureFieldToFieldMapping)) {
354
- $collection[]["delete"] = $featureFieldToFieldMapping[$field[Unbxd_Recscore_Model_Field::featured_field]];
355
- }
356
  }
357
 
358
  }
@@ -372,20 +383,21 @@ class Unbxd_Recscore_Helper_Confighelper extends Unbxd_Recscore_Helper_Data {
372
  * @param $fields
373
  * @return mixed
374
  */
375
- private function getFields($fields, $website) {
 
376
  $inField = array();
377
- foreach($fields as $field) {
378
- if($field[Unbxd_Recscore_Model_Field::field_name] == "") {
379
- continue;
380
- }
381
- $inField[] = "'" .$field[Unbxd_Recscore_Model_Field::field_name]. "'";
382
  }
383
  $collection = Mage::getResourceModel("unbxd_recscore/field_collection");
384
 
385
  $collection->getSelect()
386
- ->where('(' . Unbxd_Recscore_Model_Field::field_name . ' in ('. implode(",", $inField). ')'. " OR ".
387
- Unbxd_Recscore_Model_Field::featured_field. " IS NOT NULL) AND ".
388
- Unbxd_Recscore_Model_Field::website_id . " = " . $website->getWebsiteId());
389
  return $collection->load();
390
  }
391
 
@@ -395,23 +407,25 @@ class Unbxd_Recscore_Helper_Confighelper extends Unbxd_Recscore_Helper_Data {
395
  *
396
  * @return bool| array
397
  */
398
- public function updateFeatureFields(Mage_Core_Model_Website $website) {
 
399
  $response = Mage::getModel("unbxd_recscore/api_task_updatefeaturefields")
400
  ->prepare($website)
401
  ->process();
402
- if(! $response->isSuccess()) {
403
  Mage::log(Zend_Log::ERR,
404
- "Update feature fields failed because of theses errors ".json_encode($response->getErrors()));
405
  return $response->getErrors();
406
  }
407
  return true;
408
  }
409
 
410
- public function getNumberOfDocsInUnbxd(Mage_Core_Model_Website $website) {
 
411
  $response = Mage::getModel('unbxd_recscore/api_task_feeddetails')
412
  ->prepare($website)
413
  ->process();
414
- if($response->isSuccess()) {
415
  $response = $response->getResponse();
416
  $feedInfo = $response[Unbxd_Recscore_Model_Api_Task_Feeddetails::FEEDINFO];
417
  return $feedInfo[Unbxd_Recscore_Model_Api_Task_Feeddetails::NUMDOCS];
@@ -423,31 +437,36 @@ class Unbxd_Recscore_Helper_Confighelper extends Unbxd_Recscore_Helper_Data {
423
  * @param Mage_Core_Model_Website $website
424
  * @return void
425
  */
426
- public function triggerAutoggestIndexing(Mage_Core_Model_Website $website) {
427
- if(Mage::helper('core')->isModuleEnabled('Unbxd_Searchcore') &&
428
- $this->isConfigTrue($website, Unbxd_Recscore_Helper_Constants::AUTOSUGGEST_STATUS)) {
 
 
429
  //trigger Autosuggest
430
- $response = Mage::getModel('unbxd_recscore/api_task_autosuggestindex')
431
- ->prepare($website)
432
- ->process();
433
  }
434
  }
435
 
436
- public function getCategoryExclusion(Mage_Core_Model_Website $website) {
437
- $conf = Mage::helper('unbxd_recscore')->getEngineConfigData(Unbxd_Recscore_Helper_Constants::EXCLUDE_CATEGORY, $website, true);
438
- $categoryExclusionConf = json_decode($conf[Unbxd_Recscore_Helper_Constants::EXCLUDE_CATEGORY], true);
439
- if(!is_array($categoryExclusionConf)) {
440
- return array();
441
- }
442
- $categoryToBeExcluded = array();
443
- foreach($categoryExclusionConf as $eachExclusion) {
444
- $categoryToBeExcluded[] = (string)$eachExclusion;
445
- }
446
- return $categoryToBeExcluded;
 
447
  }
448
 
449
- public function getConfigData($name) {
450
- return (string)Mage::getConfig()->getNode("default/" . Unbxd_Recscore_Helper_Constants::UNBXD_CONFIG_PREFIX . "/" .$name);
 
451
  }
452
  }
 
453
  ?>
5
  * @package Unbxd_Recscore
6
  * @author Unbxd Software Pvt. Ltd
7
  */
8
+ class Unbxd_Recscore_Helper_Confighelper extends Unbxd_Recscore_Helper_Data
9
+ {
10
 
11
  const SITE_KEY = "site_key";
12
 
33
  */
34
  public static $data_types = array("text", "longText", "link", "decimal", "number", "datetime");
35
 
36
+ public function validateAndSaveKeys($website, $requestBody)
37
+ {
38
  $errors = $this->validateKeyParams($requestBody);
39
+ if (sizeof($errors) > 0) {
40
  return $errors;
41
  }
42
  $requestParams = json_decode($requestBody, true);
43
+ if (!$requestParams) {
44
  $errors['message'] = 'Invalid Request';
45
  return $errors;
46
  }
49
  ->setData(Unbxd_Recscore_Model_Api_Task_Validatekeys::SITE_KEY, $requestParams[self::SITE_KEY])
50
  ->prepare($website)
51
  ->process();
52
+ if (!$response->isSuccess()) {
53
  return $response->getErrors();
54
  }
55
 
56
+ $existingSecretKey = Mage::getResourceModel('unbxd_recscore/config')
57
+ ->getValue($website->getWebsiteId(), Unbxd_Recscore_Helper_Constants::SECRET_KEY);
58
+ $keyAlreadyExists = !is_null($existingSecretKey);
59
+ if ($keyAlreadyExists) {
60
+ $this->flushConfigs($website);
61
+ }
62
 
63
  Mage::getResourceModel('unbxd_recscore/config')
64
  ->setValue($website->getWebsiteId(), Unbxd_Recscore_Helper_Constants::SECRET_KEY,
75
  ->setValue($website->getWebsiteId(),
76
  Unbxd_Recscore_Helper_Constants::USERNAME,
77
  $response[Unbxd_Recscore_Model_Api_Task_Validatekeys::USERNAME]);
78
+ $this->saveConfig(Mage::app()->getWebsite(),
79
+ array(Unbxd_Recscore_Helper_Constants::API_KEY => $response[Unbxd_Recscore_Model_Api_Task_Validatekeys::API_KEY],
80
+ Unbxd_Recscore_Helper_Constants::SITE_KEY => $requestParams[Unbxd_Recscore_Helper_Constants::SITE_KEY]));
81
  return $errors;
82
  }
83
 
84
+ public function flushConfigs($website)
85
+ {
86
+ Mage::helper('unbxd_recscore')->log(Zend_Log::DEBUG, 'Flushing all the configs');
87
+ $configs = $this->getEngineConfigData('', $website, true);
88
+ foreach ($configs as $config => $value) {
89
+ Mage::getConfig()->deleteConfig(Unbxd_Recscore_Helper_Constants::UNBXD_CONFIG_PREFIX .
90
+ Unbxd_Recscore_Helper_Constants::CONFIG_SEPARATOR .
91
+ $config,
92
+ 'websites',
93
+ (int)$website->getWebsiteId());
94
+ }
95
+ Mage::getResourceModel('unbxd_recscore/config')->deleteAll($website->getWebsiteId());
96
 
97
  }
98
 
99
+ public function validateKeyParams($requestBody)
100
+ {
101
  $errors = array();
102
  $requestParams = json_decode($requestBody, true);
103
+ if (!$requestParams) {
104
  Mage::helper('unbxd_recscore')->log(Zend_Log::ERR, 'Invalid request with requestBody' . $requestBody);
105
  $errors['message'] = 'Invalid Request';
106
  return $errors;
107
  }
108
+ if (!array_key_exists(Unbxd_Recscore_Helper_Constants::SECRET_KEY, $requestParams)) {
109
  $errors[Unbxd_Recscore_Helper_Constants::SECRET_KEY] = "Has Empty Data";
110
  }
111
+ if (!array_key_exists(Unbxd_Recscore_Helper_Constants::SITE_KEY, $requestParams)) {
112
  $errors[Unbxd_Recscore_Helper_Constants::SITE_KEY] = "Has Empty Data";
113
  }
114
  return $errors;
115
  }
116
 
117
+ public function getFeatureFields()
118
+ {
119
  return Unbxd_Recscore_Model_Field::$feature_fields;
120
  }
121
 
122
+ public function getAllAttributes($fieldNameAsKey = false)
123
+ {
124
  $attributes = Mage::getSingleton('eav/config')
125
  ->getEntityType(Mage_Catalog_Model_Product::ENTITY)->getAttributeCollection();
126
  $fields = array();
127
+ foreach ($attributes as $attribute) {
128
  $attributeType = $attribute->getFrontendInput();
129
+ $fieldType = $attributeType == 'media_image' ? Unbxd_Recscore_Helper_Constants::FIELD_TYPE_IMAGE :
130
+ ($attributeType == 'price' ? Unbxd_Recscore_Helper_Constants::FIELD_TYPE_NUMBER :
131
+ ($attributeType == 'date' ? Unbxd_Recscore_Helper_Constants::FIELD_TYPE_DATE :
132
  Unbxd_Recscore_Helper_Constants::FIELD_TYPE_STRING));
133
+ $fieldType = ($attribute->getName() == "created_at") ? Unbxd_Recscore_Helper_Constants::FIELD_TYPE_DATE : $fieldType;
134
+ $fieldType = ($attribute->getName() == "updated_at") ? Unbxd_Recscore_Helper_Constants::FIELD_TYPE_DATE : $fieldType;
135
+ if ($fieldNameAsKey) {
136
+ $fields[$attribute->getName()] = array(Unbxd_Recscore_Helper_Constants::FIELD_NAME => $attribute->getName(),
137
+ Unbxd_Recscore_Helper_Constants::FIELD_TYPE => $fieldType);
138
+ } else {
139
+ $fields[] = array(Unbxd_Recscore_Helper_Constants::FIELD_NAME => $attribute->getName(),
140
+ Unbxd_Recscore_Helper_Constants::FIELD_TYPE => $fieldType);
141
+ }
142
+ }
143
+ if ($fieldNameAsKey) {
144
+ $fields['final_price'] = array(Unbxd_Recscore_Helper_Constants::FIELD_NAME => "final_price",
145
+ Unbxd_Recscore_Helper_Constants::FIELD_TYPE => Unbxd_Recscore_Helper_Constants::FIELD_TYPE_NUMBER);
146
+ $fields['type_id'] = array(Unbxd_Recscore_Helper_Constants::FIELD_NAME => "type_id",
147
+ Unbxd_Recscore_Helper_Constants::FIELD_TYPE => Unbxd_Recscore_Helper_Constants::FIELD_TYPE_STRING);
148
+ } else {
149
+ $fields[] = array(Unbxd_Recscore_Helper_Constants::FIELD_NAME => "final_price",
150
+ Unbxd_Recscore_Helper_Constants::FIELD_TYPE => Unbxd_Recscore_Helper_Constants::FIELD_TYPE_NUMBER);
151
+ $fields[] = array(Unbxd_Recscore_Helper_Constants::FIELD_NAME => "type_id",
152
+ Unbxd_Recscore_Helper_Constants::FIELD_TYPE => Unbxd_Recscore_Helper_Constants::FIELD_TYPE_STRING);
153
  }
 
 
 
 
 
 
 
154
  return $fields;
155
  }
156
 
157
+ private function getFieldMapping($fields)
158
+ {
159
  $fieldMapping = array();
160
+ foreach ($fields as $field) {
161
  $fieldMapping[$field->getFieldName()] = $field;
162
  }
163
  return $fieldMapping;
167
  * @param $fields
168
  * @return array
169
  */
170
+ private function validate($fields)
171
+ {
172
  $errors = array();
173
+ if (!is_array($fields)) {
174
+ $errors["message"] = "Expecting theInput data should be an array, Given " . gettype($fields);
175
+ return $errors;
176
+ }
177
+ $existingAttributes = $this->getAllAttributes(true);
178
+ $featureFields = Mage::getModel('unbxd_recscore/field')->getFeaturedFields();
179
+ foreach ($fields as $field) {
180
+ if (!array_key_exists(Unbxd_Recscore_Model_Field::field_name, $field)) {
181
  $errors["extra"] = "Not Present for all the fields";
182
+ continue;
183
  } else if (is_null($field[Unbxd_Recscore_Model_Field::field_name]) ||
184
+ $field[Unbxd_Recscore_Model_Field::field_name] == ""
185
+ ) {
186
  $errors["extra"] = "field Name is empty for some fields";
187
+ continue;
188
  }
189
  if (!array_key_exists(Unbxd_Recscore_Model_Field::datatype, $field)) {
190
  $errors[$field[Unbxd_Recscore_Model_Field::field_name]] = "Not Present for all the fields";
191
+ } else if (!in_array($field[Unbxd_Recscore_Model_Field::datatype], Unbxd_Recscore_Model_Field::$data_types)) {
192
+ Mage::helper('unbxd_recscore')->log(Zend_Log::ERR, 'Invalid feature field ' .
193
  $field[Unbxd_Recscore_Model_Field::datatype]);
194
  $errors[$field[Unbxd_Recscore_Model_Field::field_name]] = "Invalid datatype specified";
195
  }
196
+
197
+ if (array_key_exists($field[Unbxd_Recscore_Model_Field::field_name], $existingAttributes)) {
198
+ if (!Mage::getSingleton('unbxd_recscore/field')->validateDatatype($field[Unbxd_Recscore_Model_Field::datatype], $existingAttributes[$field[Unbxd_Recscore_Model_Field::field_name]][Unbxd_Recscore_Helper_Constants::FIELD_TYPE])) {
199
+ $errors[$field[Unbxd_Recscore_Model_Field::field_name]] = "Field cannot be mapped to " . $field[Unbxd_Recscore_Model_Field::datatype];
200
+ }
201
+ }
202
 
203
  if (array_key_exists(Unbxd_Recscore_Model_Field::featured_field, $field)) {
204
+ if (!array_key_exists($field[Unbxd_Recscore_Model_Field::featured_field], $featureFields)) {
205
+ Mage::helper('unbxd_recscore')->log(Zend_Log::ERR, 'Invalid feature field ' .
206
  $field[Unbxd_Recscore_Model_Field::featured_field]);
207
  $errors[$field[Unbxd_Recscore_Model_Field::field_name]] = "Invalid feature field specified";
208
+ } else if (!Mage::getSingleton('unbxd_recscore/field')->validateDatatype($featureFields[$field[Unbxd_Recscore_Model_Field::featured_field]]["datatype"], $existingAttributes[$field[Unbxd_Recscore_Model_Field::field_name]][Unbxd_Recscore_Helper_Constants::FIELD_TYPE])) {
209
+ $errors[$field[Unbxd_Recscore_Model_Field::field_name]] = "Field cannot be mapped to " . $field[Unbxd_Recscore_Model_Field::datatype];
210
+ }
211
  }
212
  }
213
  return $errors;
214
  }
215
 
216
+ public function deleteFields($fields, $website)
217
+ {
218
  $errors = $this->validate($fields);
219
+ if (sizeof($errors) != 0) {
220
  return $errors;
221
  }
222
  $collection = $this->buildFieldCollection($fields, $website);
228
  * @param $website
229
  * @return array
230
  */
231
+ public function saveFields($fields, $website)
232
+ {
233
  $errors = $this->validate($fields);
234
+ if (sizeof($errors) != 0) {
235
  return $errors;
236
  }
237
  $collection = $this->buildFieldCollectionToAdd($fields, $website);
238
  $response = Mage::getModel("unbxd_recscore/field")->saveFields($collection);
239
+ if (!is_array($response) && $response === true) {
240
+ Mage::getSingleton('unbxd_recscore/field')->rebuildConfigCache($website);
 
 
 
 
 
 
 
 
241
  $this->triggerUpdateFeatureField($website);
242
  }
243
  }
244
 
245
 
246
+ public function triggerUpdateFeatureField(Mage_Core_Model_Website $website)
247
+ {
248
  Mage::getResourceModel('unbxd_recscore/config')
249
  ->setValue($website->getWebsiteId(),
250
  Unbxd_Recscore_Helper_Constants::NEED_FEATURE_FIELD_UPDATION,
257
  * @param Mage_Core_Model_Website $website
258
  * @return void
259
  */
260
+ public function triggerFeedUpload(Mage_Core_Model_Website $website)
261
+ {
262
  Mage::getModel('unbxd_recscore/api_task_triggerfeedupload')
263
  ->prepare($website)
264
  ->process();
265
  }
266
 
267
 
268
+ private function getFeatureFieldToFieldMapping($fields)
269
+ {
270
  $featureFieldToFieldMapping = array();
271
+ foreach ($fields as $field) {
272
+ if ($field instanceof Unbxd_Recscore_Model_Field &&
273
  $field->hasData(Unbxd_Recscore_Model_Field::featured_field) &&
274
+ !is_null($field->getData(Unbxd_Recscore_Model_Field::featured_field))
275
+ ) {
276
  $featureFieldToFieldMapping[$field[Unbxd_Recscore_Model_Field::featured_field]] = $field;
277
  }
278
  }
279
  return $featureFieldToFieldMapping;
280
  }
281
 
282
+ private function buildFieldCollection($fields, $website)
283
+ {
284
  $collection = array();
285
  $fieldMapping = $this->getFieldMapping($this->getFields($fields, $website));
286
+ foreach ($fields as $field) {
287
  if (!array_key_exists(Unbxd_Recscore_Model_Field::field_name, $field)) {
288
  continue;
289
  }
290
+ if (array_key_exists($field[Unbxd_Recscore_Model_Field::field_name], $fieldMapping)) {
291
  $collection[]["delete"] = $fieldMapping[$field[Unbxd_Recscore_Model_Field::field_name]];
292
  }
293
  }
294
  return $collection;
295
  }
296
 
297
+ private function buildFieldCollectionToAdd($fields, $website)
298
+ {
299
  $collection = array();
300
  $fieldMapping = $this->getFieldMapping($this->getFields($fields, $website));
301
  $featureFieldToFieldMapping = $this->getFeatureFieldToFieldMapping($fieldMapping);
302
 
303
+ foreach ($fields as $field) {
304
+ if (!array_key_exists(Unbxd_Recscore_Model_Field::field_name, $field)) {
305
  continue;
306
  }
307
  /*
324
  */
325
 
326
  // case 1
327
+ if (array_key_exists($field[Unbxd_Recscore_Model_Field::field_name], $fieldMapping) &&
328
  $fieldMapping[$field[Unbxd_Recscore_Model_Field::field_name]]->hasData(Unbxd_Recscore_Model_Field::featured_field) &&
329
+ !is_null($fieldMapping[$field[Unbxd_Recscore_Model_Field::field_name]]->getData(Unbxd_Recscore_Model_Field::featured_field))
330
+ ) {
331
  //case 1 a)
332
  if (array_key_exists(Unbxd_Recscore_Model_Field::featured_field, $field) &&
333
  $field[Unbxd_Recscore_Model_Field::featured_field] ==
334
+ $fieldMapping[$field[Unbxd_Recscore_Model_Field::field_name]][Unbxd_Recscore_Model_Field::featured_field]
335
+ ) {
336
  continue;
337
+ } // case 1 b)
 
338
  else if (array_key_exists(Unbxd_Recscore_Model_Field::featured_field, $field)) {
339
  $collection[]["delete"] = $featureFieldToFieldMapping[$field[Unbxd_Recscore_Model_Field::featured_field]];
340
  $collection[]["delete"] = $fieldMapping[$field[Unbxd_Recscore_Model_Field::field_name]];
341
  $fieldModel = Mage::getModel("unbxd_recscore/field");
342
  $fieldModel->setFeaturedField($field[Unbxd_Recscore_Model_Field::featured_field]);
343
+ } //case 1 c)
 
 
344
  else {
345
  $collection[]["delete"] = $fieldMapping[$field[Unbxd_Recscore_Model_Field::field_name]];
346
  $fieldModel = Mage::getModel("unbxd_recscore/field");
347
 
348
  }
349
+ } else if (array_key_exists($field[Unbxd_Recscore_Model_Field::field_name], $fieldMapping)) {
350
  //case 2 a)
351
  if (array_key_exists(Unbxd_Recscore_Model_Field::featured_field, $field)) {
352
  $collection[]["delete"] = $fieldMapping[$field[Unbxd_Recscore_Model_Field::field_name]];
353
  $fieldModel = Mage::getModel("unbxd_recscore/field");
354
  $fieldModel->setFeaturedField($field[Unbxd_Recscore_Model_Field::featured_field]);
355
+ } // case 2 b)
 
356
  else {
357
  $fieldModel = $fieldMapping[$field[Unbxd_Recscore_Model_Field::field_name]];
358
  }
360
  $fieldModel = Mage::getModel("unbxd_recscore/field");
361
  if (array_key_exists(Unbxd_Recscore_Model_Field::featured_field, $field)) {
362
  $fieldModel->setFeaturedField($field[Unbxd_Recscore_Model_Field::featured_field]);
363
+ // case 3 a)
364
+ if (array_key_exists($field[Unbxd_Recscore_Model_Field::featured_field], $featureFieldToFieldMapping)) {
365
+ $collection[]["delete"] = $featureFieldToFieldMapping[$field[Unbxd_Recscore_Model_Field::featured_field]];
366
+ }
367
  }
368
 
369
  }
383
  * @param $fields
384
  * @return mixed
385
  */
386
+ private function getFields($fields, $website)
387
+ {
388
  $inField = array();
389
+ foreach ($fields as $field) {
390
+ if ($field[Unbxd_Recscore_Model_Field::field_name] == "") {
391
+ continue;
392
+ }
393
+ $inField[] = "'" . $field[Unbxd_Recscore_Model_Field::field_name] . "'";
394
  }
395
  $collection = Mage::getResourceModel("unbxd_recscore/field_collection");
396
 
397
  $collection->getSelect()
398
+ ->where('(' . Unbxd_Recscore_Model_Field::field_name . ' in (' . implode(",", $inField) . ')' . " OR " .
399
+ Unbxd_Recscore_Model_Field::featured_field . " IS NOT NULL) AND " .
400
+ Unbxd_Recscore_Model_Field::website_id . " = " . $website->getWebsiteId());
401
  return $collection->load();
402
  }
403
 
407
  *
408
  * @return bool| array
409
  */
410
+ public function updateFeatureFields(Mage_Core_Model_Website $website)
411
+ {
412
  $response = Mage::getModel("unbxd_recscore/api_task_updatefeaturefields")
413
  ->prepare($website)
414
  ->process();
415
+ if (!$response->isSuccess()) {
416
  Mage::log(Zend_Log::ERR,
417
+ "Update feature fields failed because of theses errors " . json_encode($response->getErrors()));
418
  return $response->getErrors();
419
  }
420
  return true;
421
  }
422
 
423
+ public function getNumberOfDocsInUnbxd(Mage_Core_Model_Website $website)
424
+ {
425
  $response = Mage::getModel('unbxd_recscore/api_task_feeddetails')
426
  ->prepare($website)
427
  ->process();
428
+ if ($response->isSuccess()) {
429
  $response = $response->getResponse();
430
  $feedInfo = $response[Unbxd_Recscore_Model_Api_Task_Feeddetails::FEEDINFO];
431
  return $feedInfo[Unbxd_Recscore_Model_Api_Task_Feeddetails::NUMDOCS];
437
  * @param Mage_Core_Model_Website $website
438
  * @return void
439
  */
440
+ public function triggerAutoggestIndexing(Mage_Core_Model_Website $website)
441
+ {
442
+ if (Mage::helper('core')->isModuleEnabled('Unbxd_Searchcore') &&
443
+ $this->isConfigTrue($website, Unbxd_Recscore_Helper_Constants::AUTOSUGGEST_STATUS)
444
+ ) {
445
  //trigger Autosuggest
446
+ $response = Mage::getModel('unbxd_recscore/api_task_autosuggestindex')
447
+ ->prepare($website)
448
+ ->process();
449
  }
450
  }
451
 
452
+ public function getCategoryExclusion(Mage_Core_Model_Website $website)
453
+ {
454
+ $conf = Mage::helper('unbxd_recscore')->getEngineConfigData(Unbxd_Recscore_Helper_Constants::EXCLUDE_CATEGORY, $website, true);
455
+ $categoryExclusionConf = json_decode($conf[Unbxd_Recscore_Helper_Constants::EXCLUDE_CATEGORY], true);
456
+ if (!is_array($categoryExclusionConf)) {
457
+ return array();
458
+ }
459
+ $categoryToBeExcluded = array();
460
+ foreach ($categoryExclusionConf as $eachExclusion) {
461
+ $categoryToBeExcluded[] = (string)$eachExclusion;
462
+ }
463
+ return $categoryToBeExcluded;
464
  }
465
 
466
+ public function getConfigData($name)
467
+ {
468
+ return (string)Mage::getConfig()->getNode("default/" . Unbxd_Recscore_Helper_Constants::UNBXD_CONFIG_PREFIX . "/" . $name);
469
  }
470
  }
471
+
472
  ?>
app/code/local/Unbxd/Recscore/Helper/Constants.php CHANGED
@@ -33,6 +33,12 @@ class Unbxd_Recscore_Helper_Constants extends Mage_Core_Helper_Abstract {
33
 
34
  const FEATURE_FIELD_PRODUCT_URL = 'productUrl';
35
 
 
 
 
 
 
 
36
  const AUTOSUGGEST_STATUS = 'autosuggest_status';
37
 
38
  const AUTOSUGGEST_SKIN = 'autosuggest_skin';
@@ -67,7 +73,7 @@ class Unbxd_Recscore_Helper_Constants extends Mage_Core_Helper_Abstract {
67
 
68
  const AUTOSUGGEST_TEMPLATE_2COLUMN_RIGHT = '2column-right';
69
 
70
- const AUTOSUGGEST_TEMPLATE_1COLUMN_ADD_TO_CART = '1column-add-to-cart';
71
 
72
  const AUTOSUGGEST_SIDECONTENT = 'autosuggest_sidecontent';
73
 
33
 
34
  const FEATURE_FIELD_PRODUCT_URL = 'productUrl';
35
 
36
+ const FEATURE_FIELD_CATEGORY = 'category';
37
+
38
+ const FEATURE_FIELD_BRAND = 'brand';
39
+
40
+ const FEATURE_FIELD_TITLE = 'title';
41
+
42
  const AUTOSUGGEST_STATUS = 'autosuggest_status';
43
 
44
  const AUTOSUGGEST_SKIN = 'autosuggest_skin';
73
 
74
  const AUTOSUGGEST_TEMPLATE_2COLUMN_RIGHT = '2column-right';
75
 
76
+ const AUTOSUGGEST_TEMPLATE_1COLUMN_ADD_TO_CART = '1column-addToCart';
77
 
78
  const AUTOSUGGEST_SIDECONTENT = 'autosuggest_sidecontent';
79
 
app/code/local/Unbxd/Recscore/Helper/Feedhelper.php CHANGED
@@ -38,6 +38,7 @@ class Unbxd_Recscore_Helper_Feedhelper extends Unbxd_Recscore_Helper_Data {
38
  $this->categoryMap[$category_id] = $category;
39
  $parentCategories = $category->getParentCategories();
40
  foreach($parentCategories as $parentCategory) {
 
41
  $this->categoryMap[$parentCategory->getId()] = $parentCategory;
42
  }
43
  return $this->categoryMap[$category_id];
@@ -88,10 +89,10 @@ class Unbxd_Recscore_Helper_Feedhelper extends Unbxd_Recscore_Helper_Data {
88
  return $this->attributeToTypeMap;
89
  }
90
  }
91
-
92
  public function isAttributePresent($attributeName) {
93
- $fieldMap = $this->getAttributeMapping();
94
- return array_key_exists( $attributeName, $fieldMap);
95
  }
96
 
97
  /**
@@ -108,6 +109,11 @@ class Unbxd_Recscore_Helper_Feedhelper extends Unbxd_Recscore_Helper_Data {
108
  }
109
  }
110
 
 
 
 
 
 
111
  /*
112
  * function to check whether the field is a multiSelect/select or not,
113
  * This is optimized method, where it doesn't make a database call to get fieldType
@@ -125,7 +131,8 @@ class Unbxd_Recscore_Helper_Feedhelper extends Unbxd_Recscore_Helper_Data {
125
  $attributeName == Unbxd_Recscore_Model_Resource_Field::CATEGORY_IDS_NAME ||
126
  $attributeName == Unbxd_Recscore_Model_Resource_Field::CAT_LEVEL_1_NAME ||
127
  $attributeName == Unbxd_Recscore_Model_Resource_Field::CAT_LEVEL_2_NAME ||
128
- $attributeName == Unbxd_Recscore_Model_Resource_Field::CAT_LEVEL_3_NAME){
 
129
  return true;
130
  }
131
  return false;
@@ -200,6 +207,6 @@ class Unbxd_Recscore_Helper_Feedhelper extends Unbxd_Recscore_Helper_Data {
200
  $this->_filters = Mage::getResourceModel('unbxd_recscore/config')->getFilters($website);
201
  }
202
  return $this->_filters;
203
- }
204
 
205
  }
38
  $this->categoryMap[$category_id] = $category;
39
  $parentCategories = $category->getParentCategories();
40
  foreach($parentCategories as $parentCategory) {
41
+ $parentCategory = Mage::getModel('catalog/category')->load($parentCategory->getId());
42
  $this->categoryMap[$parentCategory->getId()] = $parentCategory;
43
  }
44
  return $this->categoryMap[$category_id];
89
  return $this->attributeToTypeMap;
90
  }
91
  }
92
+
93
  public function isAttributePresent($attributeName) {
94
+ $fieldMap = $this->getAttributeMapping();
95
+ return array_key_exists( $attributeName, $fieldMap);
96
  }
97
 
98
  /**
109
  }
110
  }
111
 
112
+ function endsWith($haystack, $needle) {
113
+ // search forward starting from end minus needle length characters
114
+ return $needle === "" || (($temp = strlen($haystack) - strlen($needle)) >= 0 && strpos($haystack, $needle, $temp) !== FALSE);
115
+ }
116
+
117
  /*
118
  * function to check whether the field is a multiSelect/select or not,
119
  * This is optimized method, where it doesn't make a database call to get fieldType
131
  $attributeName == Unbxd_Recscore_Model_Resource_Field::CATEGORY_IDS_NAME ||
132
  $attributeName == Unbxd_Recscore_Model_Resource_Field::CAT_LEVEL_1_NAME ||
133
  $attributeName == Unbxd_Recscore_Model_Resource_Field::CAT_LEVEL_2_NAME ||
134
+ $attributeName == Unbxd_Recscore_Model_Resource_Field::CAT_LEVEL_3_NAME ||
135
+ $this->endsWith($attributeName, 'Associated')){
136
  return true;
137
  }
138
  return false;
207
  $this->_filters = Mage::getResourceModel('unbxd_recscore/config')->getFilters($website);
208
  }
209
  return $this->_filters;
210
+ }
211
 
212
  }
app/code/local/Unbxd/Recscore/Model/Api/Task/Triggerfeedupload.php CHANGED
@@ -21,12 +21,13 @@ class Unbxd_Recscore_Model_Api_Task_Triggerfeedupload extends Unbxd_Recscore_Mod
21
  }
22
 
23
  protected function prepareUrl() {
24
- static::$url = Mage::getBaseUrl()."unbxd/config/productsync";
25
  return $this;
26
  }
27
 
28
  protected function prepareParams(Mage_Core_Model_Website $website) {
29
  $this->setData("site", $website->getName());
 
30
  return $this;
31
  }
32
 
21
  }
22
 
23
  protected function prepareUrl() {
24
+ static::$url = Mage::getBaseUrl()."recscore/config/productsync";
25
  return $this;
26
  }
27
 
28
  protected function prepareParams(Mage_Core_Model_Website $website) {
29
  $this->setData("site", $website->getName());
30
+ $this->setData("auth", Mage::getSingleton('unbxd_recscore/auth')->getAuthKey());
31
  return $this;
32
  }
33
 
app/code/local/Unbxd/Recscore/Model/Feed/Feedcreator.php CHANGED
@@ -2,12 +2,14 @@
2
 
3
  class Unbxd_Recscore_Model_Feed_Feedcreator {
4
 
5
- var $fileName;
6
- var $fields;
7
- var $taxonomyFlag;
8
- const PAGE_SIZE = 500;
9
- var $_fullupload;
10
- var $_copyFields = array();
 
 
11
 
12
 
13
  public function __construct() {
@@ -16,10 +18,23 @@ class Unbxd_Recscore_Model_Feed_Feedcreator {
16
 
17
  public function init(Mage_Core_Model_Website $website, $fileName) {
18
  $this->_setFields($website);
19
- $this->_setCopyFields($website);
20
  $this->fileName = $fileName;
21
  }
22
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  /**
24
  * Method to set the full upload
25
  * @param bool $value
@@ -40,23 +55,23 @@ class Unbxd_Recscore_Model_Feed_Feedcreator {
40
  return $this->_fullupload;
41
  }
42
 
43
- /**
44
- * method to create the feed
45
- **/
46
- public function createFeed($fileName, Mage_Core_Model_Website $website, $currentDate){
47
- $this->init($website, $fileName);
48
- if($this->_createFile()){
49
- $this->log("started writing header");
50
-
51
- if(!$this->_writeFeedContent($website, $currentDate)){
52
- return false;
53
- }
54
-
55
- } else {
56
- return false;
57
- }
58
- return true;
59
- }
60
 
61
 
62
 
@@ -70,23 +85,23 @@ class Unbxd_Recscore_Model_Feed_Feedcreator {
70
  * @return bool
71
  */
72
  protected function _writeFeedContent(Mage_Core_Model_Website $website, $currentDate) {
73
- if(!$this->_appendTofile('{"feed":')) {
74
- $this->log("Error writing feed tag");
75
- return false;
76
- }
77
 
78
- if(!$this->_writeCatalogContent($website, $currentDate)) {
79
- $this->log("Error writing catalog tag");
80
- return false;
81
- }
82
 
83
- if(!$this->_appendTofile("}")) {
84
- $this->log("Error writing closing feed tag");
85
- return false;
86
- }
87
 
88
- return true;
89
- }
90
 
91
  /**
92
  * Method to trigger only the catalog content
@@ -96,18 +111,18 @@ class Unbxd_Recscore_Model_Feed_Feedcreator {
96
  * @return bool
97
  */
98
  protected function _writeCatalogContent(Mage_Core_Model_Website $website, $currentDate) {
99
- if(!$this->_appendTofile('{"catalog":{')) {
100
- $this->log("Error writing closing catalog tag");
101
- return false;
102
- }
103
- if(!$this->_writeSchemaContent()) {
104
- return false;
105
- }
106
 
107
- if(!$this->_appendTofile(",")) {
108
- $this->log("Error while adding comma in catalog");
109
- return false;
110
- }
111
 
112
  $fromDate = Mage::getResourceSingleton('unbxd_recscore/config')
113
  ->getValue($website->getWebsiteId(), Unbxd_Recscore_Model_Config::LAST_UPLOAD_TIME);
@@ -115,39 +130,45 @@ class Unbxd_Recscore_Model_Feed_Feedcreator {
115
  $fromDate = "1970-01-01 00:00:00";
116
  }
117
  // If both of them are unsuccessful, then tag it as unsuccessful
118
- if(!($this->_writeAddProductsContent($website, $fromDate, $currentDate)
119
  || $this->_writeDeleteProductsContent($website, $fromDate, $currentDate))) {
120
- return false;
121
- }
122
 
123
  Mage::getModel('unbxd_recscore/sync')->markItSynced($website->getWebsiteId(), $currentDate);
124
 
125
 
126
- if(!$this->_appendTofile("}")) {
127
- $this->log("Error writing closing catalog tag");
128
- return false;
129
- }
130
  /*
131
  if(!$this->_writeTaxonomyContents($site)) {
132
  return false;
133
  }*/
134
 
135
- if(!$this->_appendTofile("}")) {
136
- $this->log("Error writing closing feed tag");
137
- return false;
138
- }
139
 
140
- return true;
141
- }
142
 
143
  /**
144
  * Method to trigger to write the schema content
145
  * @return mixed
146
  */
147
  protected function _writeSchemaContent() {
148
- return $this->_appendTofile('"schema":'.
149
  Mage::getSingleton('unbxd_recscore/feed_jsonbuilder_schemabuilder')->getSchema($this->fields));
150
- }
 
 
 
 
 
 
151
 
152
  /**
153
  * method to get the collection to add
@@ -184,7 +205,7 @@ class Unbxd_Recscore_Model_Feed_Feedcreator {
184
  ->load();
185
  $collection = Mage::getResourceModel('unbxd_recscore/product_collection');
186
  foreach($products as $eachProduct) {
187
- $product = Mage_Catalog_Model_Product();
188
  $product->setEntityId($eachProduct->getProductId());
189
  $collection->addItem($product);
190
  }
@@ -193,7 +214,7 @@ class Unbxd_Recscore_Model_Feed_Feedcreator {
193
 
194
  protected function _writeDeleteProductsContent(Mage_Core_Model_Website $website, $fromDate, $currentDate) {
195
  if($this->isFullUpload()) {
196
- return true;
197
  }
198
  $collection1 = $this->_getCatalogCollectionToDelete($website);
199
  $collection2 = Mage::getResourceModel('unbxd_recscore/product_collection')
@@ -219,7 +240,7 @@ class Unbxd_Recscore_Model_Feed_Feedcreator {
219
  $collection = $this->_getCatalogCollectionToAdd($website, $fromDate, $currentDate);
220
  return $this->_writeProducts($website, $collection);
221
 
222
- }
223
 
224
  /**
225
  * Method to process the collection
@@ -229,11 +250,11 @@ class Unbxd_Recscore_Model_Feed_Feedcreator {
229
  * @param bool $loadAll
230
  * @return mixed
231
  */
232
- protected function _processCollection($collection , $pageNum,
233
- $operation = Unbxd_Recscore_Model_Feed_Tags::ADD, $loadAll = false) {
234
  if(!$loadAll) {
235
  $collection->clear();
236
- $collection->getSelect()->limit(self::PAGE_SIZE, ($pageNum) * self::PAGE_SIZE);
237
  $collection->load();
238
  }
239
  if($operation == Unbxd_Recscore_Model_Feed_Tags::ADD) {
@@ -243,49 +264,62 @@ class Unbxd_Recscore_Model_Feed_Feedcreator {
243
  }
244
 
245
  protected function _writeProducts(Mage_Core_Model_Website $website, $collection,
246
- $operation = Unbxd_Recscore_Model_Feed_Tags::ADD, $loadAllAtOnce = false) {
247
- $pageNum = 0;
 
248
  $this->log('started writing products');
249
  $firstLoop = true;
250
- while(true){
251
- $collection = $this->_processCollection($collection, $pageNum++ , $operation, $loadAllAtOnce);
 
252
 
253
- if(count($collection) == 0){
254
- if($pageNum == 1){
255
  $this->log("No products found");
256
  throw new Exception("No Products found");
257
  }
258
  break;
259
  }
260
 
261
- if(!$firstLoop && $loadAllAtOnce) {
262
  break;
263
- } else if(!$firstLoop) {
264
- if(!$this->_appendTofile(Unbxd_Recscore_Model_Feed_Tags::COMMA)) {
265
  $this->log("Error while addings items separator");
266
  return false;
267
  }
268
  } else {
269
  // If it is the first loop adding json tag
270
- if(!$this->_appendTofile(Mage::getSingleton('unbxd_recscore/feed_tags')->getKey($operation) .
271
- Unbxd_Recscore_Model_Feed_Tags::COLON. Unbxd_Recscore_Model_Feed_Tags::OBJ_START.
272
  Mage::getSingleton('unbxd_recscore/feed_tags')->getKey($operation) .
273
- Unbxd_Recscore_Model_Feed_Tags::COLON.Unbxd_Recscore_Model_Feed_Tags::ARRAY_START)) {
 
 
 
 
 
274
  $this->log("Error while adding items tag");
275
  return false;
276
  }
277
  }
278
  $content = Mage::getSingleton('unbxd_recscore/feed_jsonbuilder_productbuilder')
279
  ->getProducts($website, $collection, $this->fields, $this->_copyFields);
280
- if(!$this->_appendTofile($content)){
281
  $this->log("Error while addings items");
282
  return false;
283
  }
284
- $this->log('Added '.($pageNum) * self::PAGE_SIZE.' products');
285
  $firstLoop = false;
 
 
 
 
 
 
286
  }
287
- if(!$this->_appendTofile(Unbxd_Recscore_Model_Feed_Tags::ARRAY_END .
288
- Unbxd_Recscore_Model_Feed_Tags::OBJ_END)) {
 
289
  $this->log("Error writing closing items tag");
290
  return false;
291
  }
@@ -293,20 +327,20 @@ class Unbxd_Recscore_Model_Feed_Feedcreator {
293
  return true;
294
  }
295
 
296
- protected function _writeTaxonomyContents($site){
297
 
298
- $collection=$this->getTaxonomyMappingCollection();
299
- // get total size
300
- //set the time limit to infinite
301
- ignore_user_abort(true);
302
- set_time_limit(0);
303
- $pageNum = 0;
304
- $this->log('started writing taxonomy tree');
305
 
306
- if(!$this->_appendTofile(',"'. 'taxonomy' . '":{ "tree":[')) {
307
- $this->log("Error while adding tree tag");
308
- return false;
309
- }
310
 
311
  $content=Mage::getSingleton('unbxd_recscore/feed_jsonbuilder_taxonomybuilder')
312
  ->createTaxonomyFeed($site);
@@ -320,12 +354,12 @@ class Unbxd_Recscore_Model_Feed_Feedcreator {
320
  if(!$this->_appendTofile("]")) {
321
  $this->log("Error writing closing tree tag");
322
  return false;
323
- }
324
 
325
- if(!$this->_appendTofile(',"mapping":[')) {
326
- $this->log("Error writing opening mapping tag");
327
- return false;
328
- }
329
 
330
  $content=Mage::getSingleton('unbxd_recscore/feed_jsonbuilder_taxonomybuilder')->createMappingFeed($collection);
331
  $status=$this->_appendTofile($content);
@@ -336,26 +370,26 @@ class Unbxd_Recscore_Model_Feed_Feedcreator {
336
  }
337
 
338
  if(!$this->appendTofile(']}')) {
339
- $this->log("Error writing closing mapping tag");
340
- return false;
341
- }
342
  $this->log('Added all categories');
343
- return true;
344
- }
345
-
346
- protected function _setCopyFields(Mage_Core_Model_Website $website) {
347
- $this->_copyFields = array();
348
- $copyFields = Mage::getModel('unbxd_recscore/field')->getCopyFields($website);
349
- foreach($copyFields as $fieldName => $copyField) {
350
- if(array_key_exists($copyField, $this->fields)) {
351
- $this->_copyFields[$fieldName] = $copyField;
352
- }
353
- }
354
- $this->_copyFields[Mage::getModel('unbxd_recscore/field')->getImageUrlFieldName()] = "imageUrl";
355
- }
356
-
357
-
358
- protected function _setFields(Mage_Core_Model_Website $website) {
359
  $fields = Mage::getResourceModel("unbxd_recscore/field_collection")->getFields($website);
360
  $featureFields = Mage::getModel('unbxd_recscore/field')->getFeaturedFields();
361
  foreach($fields as $eachfield) {
@@ -365,13 +399,13 @@ class Unbxd_Recscore_Model_Feed_Feedcreator {
365
  }
366
  if(!is_null($eachfield->getFeaturedField()) &&
367
  array_key_exists($eachfield->getFeaturedField(), $featureFields)) {
368
- if($eachfield->getFeaturedField() == "imageUrl") {
369
- $this->fields["imageUrl"] = $featureFields[$eachfield->getFeaturedField()];
370
- $this->fields[$eachfield->getFieldName()] = Mage::getModel('unbxd_recscore/field')->getField('longText', "false", "false");
371
- $this->fields["imageUrl"][Unbxd_Recscore_Model_Feed_Jsonbuilder_Productbuilder::GENERATE_IMAGE] = "1";
372
- } else {
373
- $this->fields[$eachfield->getFieldName()] = $featureFields[$eachfield->getFeaturedField()];
374
- }
375
  continue;
376
  }
377
  $field = array();
@@ -382,47 +416,47 @@ class Unbxd_Recscore_Model_Feed_Feedcreator {
382
  ->isMultiSelect($eachfield->getFieldName());
383
  $this->fields[$eachfield->getFieldName()] = $field;
384
  }
385
- $this->fields["entity_id"] = Mage::getModel('unbxd_recscore/field')->getField('longText', "false", "false");
386
- $this->_setImageConf($website);
387
-
388
- }
389
-
390
- protected function _setImageConf(Mage_Core_Model_Website $website) {
391
- $imageFields = Mage::getModel('unbxd_recscore/field')->getImageFields($website);
392
- foreach($this->fields as $fieldName => $fieldConf) {
393
- if(array_key_exists($fieldName, $imageFields)) {
394
- $this->fields[$fieldName][Unbxd_Recscore_Model_Feed_Jsonbuilder_Productbuilder::GENERATE_IMAGE] = '1';
395
- }
396
- }
397
- }
398
-
399
- /**
400
- * Function to initialize to feed creation process
401
- */
402
- protected function _createFile(){
403
- return Mage::getSingleton('unbxd_recscore/feed_filemanager')->createFile($this->fileName);
404
- }
405
 
406
  protected function _appendTofile($data){
407
- return Mage::getSingleton('unbxd_recscore/feed_filemanager')->appendTofile($this->fileName, $data);
408
- }
409
 
410
  protected function log($message) {
411
- Mage::helper('unbxd_recscore')->log(Zend_Log::DEBUG, $message);
412
- }
413
 
414
- public function getTaxonomyMappingCollection() {
415
- try{
416
  $adapter = Mage::getSingleton('core/resource')->getConnection('core_read');
417
  return $adapter->query("select catalog_category_product_index.product_id as entity_id,GROUP_CONCAT(catalog_category_product_index.category_id SEPARATOR ',') as category_id FROM catalog_category_product_index
418
  join catalog_product_entity where catalog_category_product_index.product_id = catalog_product_entity.entity_id
419
  group by catalog_category_product_index.product_id");
420
  } catch(Exception $e) {
421
- $this->log($e->getMessage());
422
- }
423
 
424
-
425
- }
426
 
427
  }
428
- ?>
2
 
3
  class Unbxd_Recscore_Model_Feed_Feedcreator {
4
 
5
+ var $fileName;
6
+ var $fields;
7
+ var $taxonomyFlag;
8
+ var $pageSize = 500;
9
+ var $_fullupload;
10
+ var $_copyFields = array();
11
+ var $page = 0;
12
+ var $limit = -1;
13
 
14
 
15
  public function __construct() {
18
 
19
  public function init(Mage_Core_Model_Website $website, $fileName) {
20
  $this->_setFields($website);
21
+ $this->_setCopyFields($website);
22
  $this->fileName = $fileName;
23
  }
24
 
25
+ public function setPage($page = 0) {
26
+ $this->page = (int)$page;
27
+ return $this;
28
+ }
29
+
30
+ public function setLimit($limit = 500) {
31
+ $this->limit = (int)$limit;
32
+ if($limit < $this->pageSize) {
33
+ $this->pageSize = (int)$limit;
34
+ }
35
+ return $this;
36
+ }
37
+
38
  /**
39
  * Method to set the full upload
40
  * @param bool $value
55
  return $this->_fullupload;
56
  }
57
 
58
+ /**
59
+ * method to create the feed
60
+ **/
61
+ public function createFeed($fileName, Mage_Core_Model_Website $website, $currentDate){
62
+ $this->init($website, $fileName);
63
+ if($this->_createFile()){
64
+ $this->log("started writing header");
65
+
66
+ if(!$this->_writeFeedContent($website, $currentDate)){
67
+ return false;
68
+ }
69
+
70
+ } else {
71
+ return false;
72
+ }
73
+ return true;
74
+ }
75
 
76
 
77
 
85
  * @return bool
86
  */
87
  protected function _writeFeedContent(Mage_Core_Model_Website $website, $currentDate) {
88
+ if(!$this->_appendTofile('{"feed":')) {
89
+ $this->log("Error writing feed tag");
90
+ return false;
91
+ }
92
 
93
+ if(!$this->_writeCatalogContent($website, $currentDate)) {
94
+ $this->log("Error writing catalog tag");
95
+ return false;
96
+ }
97
 
98
+ if(!$this->_appendTofile("}")) {
99
+ $this->log("Error writing closing feed tag");
100
+ return false;
101
+ }
102
 
103
+ return true;
104
+ }
105
 
106
  /**
107
  * Method to trigger only the catalog content
111
  * @return bool
112
  */
113
  protected function _writeCatalogContent(Mage_Core_Model_Website $website, $currentDate) {
114
+ if(!$this->_appendTofile('{"catalog":{')) {
115
+ $this->log("Error writing closing catalog tag");
116
+ return false;
117
+ }
118
+ if(!$this->_writeSchemaContent()) {
119
+ return false;
120
+ }
121
 
122
+ if(!$this->_appendTofile(",")) {
123
+ $this->log("Error while adding comma in catalog");
124
+ return false;
125
+ }
126
 
127
  $fromDate = Mage::getResourceSingleton('unbxd_recscore/config')
128
  ->getValue($website->getWebsiteId(), Unbxd_Recscore_Model_Config::LAST_UPLOAD_TIME);
130
  $fromDate = "1970-01-01 00:00:00";
131
  }
132
  // If both of them are unsuccessful, then tag it as unsuccessful
133
+ if(!($this->_writeAddProductsContent($website, $fromDate, $currentDate)
134
  || $this->_writeDeleteProductsContent($website, $fromDate, $currentDate))) {
135
+ return false;
136
+ }
137
 
138
  Mage::getModel('unbxd_recscore/sync')->markItSynced($website->getWebsiteId(), $currentDate);
139
 
140
 
141
+ if(!$this->_appendTofile("}")) {
142
+ $this->log("Error writing closing catalog tag");
143
+ return false;
144
+ }
145
  /*
146
  if(!$this->_writeTaxonomyContents($site)) {
147
  return false;
148
  }*/
149
 
150
+ if(!$this->_appendTofile("}")) {
151
+ $this->log("Error writing closing feed tag");
152
+ return false;
153
+ }
154
 
155
+ return true;
156
+ }
157
 
158
  /**
159
  * Method to trigger to write the schema content
160
  * @return mixed
161
  */
162
  protected function _writeSchemaContent() {
163
+ return $this->_appendTofile('"schema":'.
164
  Mage::getSingleton('unbxd_recscore/feed_jsonbuilder_schemabuilder')->getSchema($this->fields));
165
+ }
166
+
167
+ public function getSize(Mage_Core_Model_Website $website, $fromDate, $currentDate) {
168
+ $collection = $this->_getCatalogCollectionToAdd($website, $fromDate, $currentDate);
169
+ return $collection->getSize();
170
+
171
+ }
172
 
173
  /**
174
  * method to get the collection to add
205
  ->load();
206
  $collection = Mage::getResourceModel('unbxd_recscore/product_collection');
207
  foreach($products as $eachProduct) {
208
+ $product = new Mage_Catalog_Model_Product();
209
  $product->setEntityId($eachProduct->getProductId());
210
  $collection->addItem($product);
211
  }
214
 
215
  protected function _writeDeleteProductsContent(Mage_Core_Model_Website $website, $fromDate, $currentDate) {
216
  if($this->isFullUpload()) {
217
+ return true;
218
  }
219
  $collection1 = $this->_getCatalogCollectionToDelete($website);
220
  $collection2 = Mage::getResourceModel('unbxd_recscore/product_collection')
240
  $collection = $this->_getCatalogCollectionToAdd($website, $fromDate, $currentDate);
241
  return $this->_writeProducts($website, $collection);
242
 
243
+ }
244
 
245
  /**
246
  * Method to process the collection
250
  * @param bool $loadAll
251
  * @return mixed
252
  */
253
+ protected function _processCollection($collection , $pageNum,
254
+ $operation = Unbxd_Recscore_Model_Feed_Tags::ADD, $loadAll = false) {
255
  if(!$loadAll) {
256
  $collection->clear();
257
+ $collection->getSelect()->limit($this->pageSize, ($pageNum) * $this->pageSize);
258
  $collection->load();
259
  }
260
  if($operation == Unbxd_Recscore_Model_Feed_Tags::ADD) {
264
  }
265
 
266
  protected function _writeProducts(Mage_Core_Model_Website $website, $collection,
267
+ $operation = Unbxd_Recscore_Model_Feed_Tags::ADD, $loadAllAtOnce = false)
268
+ {
269
+ $pageNum = $this->page;
270
  $this->log('started writing products');
271
  $firstLoop = true;
272
+ $totalSize = 0;
273
+ while (true) {
274
+ $collection = $this->_processCollection($collection, $pageNum++, $operation, $loadAllAtOnce);
275
 
276
+ if (count($collection) == 0) {
277
+ if ($pageNum == 1) {
278
  $this->log("No products found");
279
  throw new Exception("No Products found");
280
  }
281
  break;
282
  }
283
 
284
+ if (!$firstLoop && $loadAllAtOnce) {
285
  break;
286
+ } else if (!$firstLoop) {
287
+ if (!$this->_appendTofile(Unbxd_Recscore_Model_Feed_Tags::COMMA)) {
288
  $this->log("Error while addings items separator");
289
  return false;
290
  }
291
  } else {
292
  // If it is the first loop adding json tag
293
+ if (!$this->_appendTofile(
 
294
  Mage::getSingleton('unbxd_recscore/feed_tags')->getKey($operation) .
295
+ Unbxd_Recscore_Model_Feed_Tags::COLON . Unbxd_Recscore_Model_Feed_Tags::OBJ_START .
296
+ Unbxd_Recscore_Model_Feed_Tags::DOUBLE_QUOTE .
297
+ Unbxd_Recscore_Model_Feed_Tags::ITEMS .
298
+ Unbxd_Recscore_Model_Feed_Tags::DOUBLE_QUOTE .
299
+ Unbxd_Recscore_Model_Feed_Tags::COLON . Unbxd_Recscore_Model_Feed_Tags::ARRAY_START)
300
+ ) {
301
  $this->log("Error while adding items tag");
302
  return false;
303
  }
304
  }
305
  $content = Mage::getSingleton('unbxd_recscore/feed_jsonbuilder_productbuilder')
306
  ->getProducts($website, $collection, $this->fields, $this->_copyFields);
307
+ if (!$this->_appendTofile($content)) {
308
  $this->log("Error while addings items");
309
  return false;
310
  }
311
+ $this->log('Added ' . ($pageNum) * $this->pageSize . ' products');
312
  $firstLoop = false;
313
+ if ($this->limit != -1) {
314
+ $totalSize += $this->pageSize;
315
+ if ($totalSize >= $this->limit) {
316
+ break;
317
+ }
318
+ }
319
  }
320
+ if (!$this->_appendTofile(Unbxd_Recscore_Model_Feed_Tags::ARRAY_END .
321
+ Unbxd_Recscore_Model_Feed_Tags::OBJ_END)
322
+ ) {
323
  $this->log("Error writing closing items tag");
324
  return false;
325
  }
327
  return true;
328
  }
329
 
330
+ protected function _writeTaxonomyContents($site){
331
 
332
+ $collection=$this->getTaxonomyMappingCollection();
333
+ // get total size
334
+ //set the time limit to infinite
335
+ ignore_user_abort(true);
336
+ set_time_limit(0);
337
+ $pageNum = 0;
338
+ $this->log('started writing taxonomy tree');
339
 
340
+ if(!$this->_appendTofile(',"'. 'taxonomy' . '":{ "tree":[')) {
341
+ $this->log("Error while adding tree tag");
342
+ return false;
343
+ }
344
 
345
  $content=Mage::getSingleton('unbxd_recscore/feed_jsonbuilder_taxonomybuilder')
346
  ->createTaxonomyFeed($site);
354
  if(!$this->_appendTofile("]")) {
355
  $this->log("Error writing closing tree tag");
356
  return false;
357
+ }
358
 
359
+ if(!$this->_appendTofile(',"mapping":[')) {
360
+ $this->log("Error writing opening mapping tag");
361
+ return false;
362
+ }
363
 
364
  $content=Mage::getSingleton('unbxd_recscore/feed_jsonbuilder_taxonomybuilder')->createMappingFeed($collection);
365
  $status=$this->_appendTofile($content);
370
  }
371
 
372
  if(!$this->appendTofile(']}')) {
373
+ $this->log("Error writing closing mapping tag");
374
+ return false;
375
+ }
376
  $this->log('Added all categories');
377
+ return true;
378
+ }
379
+
380
+ protected function _setCopyFields(Mage_Core_Model_Website $website) {
381
+ $this->_copyFields = array();
382
+ $copyFields = Mage::getModel('unbxd_recscore/field')->getCopyFields($website);
383
+ foreach($copyFields as $fieldName => $copyField) {
384
+ if(array_key_exists($copyField, $this->fields)) {
385
+ $this->_copyFields[$fieldName] = $copyField;
386
+ }
387
+ }
388
+ $this->_copyFields[Mage::getModel('unbxd_recscore/field')->getImageUrlFieldName()] = "imageUrl";
389
+ }
390
+
391
+
392
+ protected function _setFields(Mage_Core_Model_Website $website) {
393
  $fields = Mage::getResourceModel("unbxd_recscore/field_collection")->getFields($website);
394
  $featureFields = Mage::getModel('unbxd_recscore/field')->getFeaturedFields();
395
  foreach($fields as $eachfield) {
399
  }
400
  if(!is_null($eachfield->getFeaturedField()) &&
401
  array_key_exists($eachfield->getFeaturedField(), $featureFields)) {
402
+ if($eachfield->getFeaturedField() == "imageUrl") {
403
+ $this->fields["imageUrl"] = $featureFields[$eachfield->getFeaturedField()];
404
+ $this->fields[$eachfield->getFieldName()] = Mage::getModel('unbxd_recscore/field')->getField('longText', "false", "false");
405
+ $this->fields["imageUrl"][Unbxd_Recscore_Model_Feed_Jsonbuilder_Productbuilder::GENERATE_IMAGE] = "1";
406
+ } else {
407
+ $this->fields[$eachfield->getFieldName()] = $featureFields[$eachfield->getFeaturedField()];
408
+ }
409
  continue;
410
  }
411
  $field = array();
416
  ->isMultiSelect($eachfield->getFieldName());
417
  $this->fields[$eachfield->getFieldName()] = $field;
418
  }
419
+ $this->fields["entity_id"] = Mage::getModel('unbxd_recscore/field')->getField('longText', "false", "false");
420
+ $this->_setImageConf($website);
421
+
422
+ }
423
+
424
+ protected function _setImageConf(Mage_Core_Model_Website $website) {
425
+ $imageFields = Mage::getModel('unbxd_recscore/field')->getImageFields($website);
426
+ foreach($this->fields as $fieldName => $fieldConf) {
427
+ if(array_key_exists($fieldName, $imageFields)) {
428
+ $this->fields[$fieldName][Unbxd_Recscore_Model_Feed_Jsonbuilder_Productbuilder::GENERATE_IMAGE] = '1';
429
+ }
430
+ }
431
+ }
432
+
433
+ /**
434
+ * Function to initialize to feed creation process
435
+ */
436
+ protected function _createFile(){
437
+ return Mage::getSingleton('unbxd_recscore/feed_filemanager')->createFile($this->fileName);
438
+ }
439
 
440
  protected function _appendTofile($data){
441
+ return Mage::getSingleton('unbxd_recscore/feed_filemanager')->appendTofile($this->fileName, $data);
442
+ }
443
 
444
  protected function log($message) {
445
+ Mage::helper('unbxd_recscore')->log(Zend_Log::DEBUG, $message);
446
+ }
447
 
448
+ public function getTaxonomyMappingCollection() {
449
+ try{
450
  $adapter = Mage::getSingleton('core/resource')->getConnection('core_read');
451
  return $adapter->query("select catalog_category_product_index.product_id as entity_id,GROUP_CONCAT(catalog_category_product_index.category_id SEPARATOR ',') as category_id FROM catalog_category_product_index
452
  join catalog_product_entity where catalog_category_product_index.product_id = catalog_product_entity.entity_id
453
  group by catalog_category_product_index.product_id");
454
  } catch(Exception $e) {
455
+ $this->log($e->getMessage());
456
+ }
457
 
458
+
459
+ }
460
 
461
  }
462
+ ?>
app/code/local/Unbxd/Recscore/Model/Feed/Feedmanager.php CHANGED
@@ -131,80 +131,122 @@ class Unbxd_Recscore_Model_Feed_Feedmanager {
131
  }
132
  }
133
 
134
- /**
135
- * method to initiate feed uploading to the unbxd servers
136
- **/
137
- public function process($isFullUpload = true, Mage_Core_Model_Website $website){
138
-
139
- $this->log('Feed Uploading request recieved');
140
- $response = $this->init($website, $isFullUpload);
141
- if(is_array($response)){
142
- return $response;
143
- }
144
- $currentDate = date('Y-m-d H:i:s');
145
- $this->_triggerSearchComplete($website);
146
-
147
- // check the lock, that if already indexing is happening
148
- if(!$isFullUpload ||
149
- !Mage::getResourceModel("unbxd_recscore/config")->isLock($website->getWebsiteId())) {
150
-
151
- $this->log('site '. $website->getName() .' is acquiring feed lock');
152
- if($isFullUpload) {
153
- Mage::getResourceSingleton("unbxd_recscore/config")
154
- ->setValue($website->getWebsiteId(),
155
- Unbxd_Recscore_Model_Config::FEED_STATUS,
156
- Unbxd_Recscore_Helper_Constants::FEED_STATUS_UPLOADING);
157
- Mage::getResourceModel('unbxd_recscore/config')->lockSite($website->getWebsiteId());
158
- }
159
- try {
160
- // create the feed
161
- $status = Mage::getSingleton('unbxd_recscore/feed_feedcreator')
162
- ->setFullUpload($isFullUpload)
163
- ->createFeed($this->fileName, $website, $currentDate);
164
- $this->log('unbxd Datafeeder finished creating file');
165
- }catch (Exception $e) {
166
- $this->log('Caught exception: '. $e->getMessage());
167
- $status = false;
168
- $errorMsg = $e->getMessage();
169
- }
170
-
171
- if($status){
172
- $status=$this->_pushFeed($isFullUpload);
173
- if($status){
174
- Mage::getResourceSingleton("unbxd_recscore/config")
 
 
175
  ->setValue($website->getWebsiteId(),
176
  Unbxd_Recscore_Model_Config::LAST_UPLOAD_TIME, $currentDate);
177
  $this->updateFeatureFields($website);
178
- }
179
- }
180
 
181
 
182
- if($isFullUpload) {
183
  // unlock the feed once everything is completed
184
  Mage::getResourceModel('unbxd_recscore/config')->unLockSite($website->getWebsiteId());
185
- } else {
186
  //In case of incremental feed delete the feed
187
- // Mage::getSingleton('unbxd_recscore/filemanager')->deleteFile($this->fileName);
188
  }
189
 
190
- $this->log('site ' . $website->getName() .' has been unlocked');
191
- if($status) {
192
- Mage::getResourceSingleton("unbxd_recscore/config")
193
- ->setValue($website->getWebsiteId(),
194
- Unbxd_Recscore_Model_Config::FEED_STATUS,
195
- Unbxd_Recscore_Helper_Constants::FEED_STATUS_UPLOADED_SUCCESSFULLY);
196
- return array('success' => true, 'message' => 'File uploaded successfully');
197
  }
198
- Mage::getResourceSingleton("unbxd_recscore/config")
199
- ->setValue($website->getWebsiteId(),
200
- Unbxd_Recscore_Model_Config::FEED_STATUS,
201
- Unbxd_Recscore_Helper_Constants::FEED_STATUS_UPLOADED_FAILED);
202
- return array('success' => false, 'message' => isset($errorMsg)?$errorMsg:'Unexpected error, please contact support');
203
- } else {
204
- $this->log('Feed Uploading failed because site has been locked');
205
  return array('success' => false, 'message' => 'Feed is already being processed');
206
- }
207
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
208
 
209
  public function log($message) {
210
  Mage::helper('unbxd_recscore')->log(Zend_Log::DEBUG, $message);
131
  }
132
  }
133
 
134
+ /**
135
+ * method to initiate feed uploading to the unbxd servers
136
+ **/
137
+ public function process($isFullUpload = true, Mage_Core_Model_Website $website)
138
+ {
139
+
140
+ $this->log('Feed Uploading request recieved');
141
+ $response = $this->init($website, $isFullUpload);
142
+ if (is_array($response)) {
143
+ return $response;
144
+ }
145
+ $currentDate = date('Y-m-d H:i:s');
146
+ $this->_triggerSearchComplete($website);
147
+
148
+ // check the lock, that if already indexing is happening
149
+ if (!$isFullUpload ||
150
+ !Mage::getResourceModel("unbxd_recscore/config")->isLock($website->getWebsiteId())
151
+ ) {
152
+
153
+ $this->log('site ' . $website->getName() . ' is acquiring feed lock');
154
+ if ($isFullUpload) {
155
+ Mage::getResourceSingleton("unbxd_recscore/config")
156
+ ->setValue($website->getWebsiteId(),
157
+ Unbxd_Recscore_Model_Config::FEED_STATUS,
158
+ Unbxd_Recscore_Helper_Constants::FEED_STATUS_UPLOADING);
159
+ Mage::getResourceModel('unbxd_recscore/config')->lockSite($website->getWebsiteId());
160
+ }
161
+ try {
162
+ // create the feed
163
+ $status = Mage::getSingleton('unbxd_recscore/feed_feedcreator')
164
+ ->setFullUpload($isFullUpload)
165
+ ->createFeed($this->fileName, $website, $currentDate);
166
+ $this->log('unbxd Datafeeder finished creating file');
167
+ } catch (Exception $e) {
168
+ $this->log('Caught exception: ' . $e->getMessage());
169
+ $status = false;
170
+ $errorMsg = $e->getMessage();
171
+ }
172
+
173
+ if ($status) {
174
+ $status = $this->_pushFeed($isFullUpload);
175
+ if ($status) {
176
+ Mage::getResourceSingleton("unbxd_recscore/config")
177
  ->setValue($website->getWebsiteId(),
178
  Unbxd_Recscore_Model_Config::LAST_UPLOAD_TIME, $currentDate);
179
  $this->updateFeatureFields($website);
180
+ }
181
+ }
182
 
183
 
184
+ if ($isFullUpload) {
185
  // unlock the feed once everything is completed
186
  Mage::getResourceModel('unbxd_recscore/config')->unLockSite($website->getWebsiteId());
187
+ } else {
188
  //In case of incremental feed delete the feed
189
+ // Mage::getSingleton('unbxd_recscore/filemanager')->deleteFile($this->fileName);
190
  }
191
 
192
+ $this->log('site ' . $website->getName() . ' has been unlocked');
193
+ if ($status) {
194
+ Mage::getResourceSingleton("unbxd_recscore/config")
195
+ ->setValue($website->getWebsiteId(),
196
+ Unbxd_Recscore_Model_Config::FEED_STATUS,
197
+ Unbxd_Recscore_Helper_Constants::FEED_STATUS_UPLOADED_SUCCESSFULLY);
198
+ return array('success' => true, 'message' => 'File uploaded successfully');
199
  }
200
+ Mage::getResourceSingleton("unbxd_recscore/config")
201
+ ->setValue($website->getWebsiteId(),
202
+ Unbxd_Recscore_Model_Config::FEED_STATUS,
203
+ Unbxd_Recscore_Helper_Constants::FEED_STATUS_UPLOADED_FAILED);
204
+ return array('success' => false, 'message' => isset($errorMsg) ? $errorMsg : 'Unexpected error, please contact support');
205
+ } else {
206
+ $this->log('Feed Uploading failed because site has been locked');
207
  return array('success' => false, 'message' => 'Feed is already being processed');
208
+ }
209
+ }
210
+
211
+ public function getProducts(Mage_Core_Model_Website $website, $page = 0, $limit = 500) {
212
+ $response = $this->init($website, true);
213
+ if (is_array($response)) {
214
+ return $response;
215
+ }
216
+ $currentDate = date('Y-m-d H:i:s');
217
+ $this->_triggerSearchComplete($website);
218
+ Mage::getSingleton('unbxd_recscore/feed_filemanager')->setNoFile(true);
219
+
220
+ try {
221
+ // create the feed
222
+ $status = Mage::getSingleton('unbxd_recscore/feed_feedcreator')
223
+ ->setFullUpload(true)
224
+ ->setPage($page)
225
+ ->setLimit($limit)
226
+ ->createFeed($this->fileName, $website, $currentDate);
227
+ $this->log('unbxd Datafeeder finished creating file');
228
+ } catch (Exception $e) {
229
+ $this->log('Caught exception: ' . $e->getMessage());
230
+ $status = false;
231
+ $errorMsg = $e->getMessage();
232
+ }
233
+ if($status) {
234
+ return Mage::getSingleton('unbxd_recscore/feed_filemanager')->getContent($this->fileName);
235
+ } else {
236
+ return json_encode(array('message' =>$errorMsg, 'success'=> false));
237
+ }
238
+
239
+ }
240
+
241
+ public function getSize(Mage_Core_Model_Website $website)
242
+ {
243
+ $fromdate="1970-01-01 00:00:00";
244
+ $currentData = date('Y-m-d H:i:s');
245
+ return Mage::getSingleton('unbxd_recscore/feed_feedcreator')
246
+ ->setFullUpload(true)
247
+ ->getSize($website, $fromdate, $currentData);
248
+
249
+ }
250
 
251
  public function log($message) {
252
  Mage::helper('unbxd_recscore')->log(Zend_Log::DEBUG, $message);
app/code/local/Unbxd/Recscore/Model/Feed/Filemanager.php CHANGED
@@ -1,9 +1,22 @@
1
  <?php
2
 
3
  class Unbxd_Recscore_Model_Feed_Filemanager {
 
 
 
4
 
5
 
6
- var $logFileName;
 
 
 
 
 
 
 
 
 
 
7
 
8
  public function __construct(){
9
  $this->logFileName = Mage::getBaseDir('log').DS.'generic.log';
@@ -13,46 +26,59 @@ class Unbxd_Recscore_Model_Feed_Filemanager {
13
  $this->logFileName = Mage::getBaseDir('log').DS.$logFileName;
14
  }
15
 
16
- /**
17
- * @param $file
18
- * @return bool
19
- */
20
- public function createFile($file){
21
- try{
22
- $f=fopen($file,'w');
23
-
24
- fclose($f);
25
- if(!file_exists($file)) {
26
- $this->log("UNBXD_MODULE:Couldn't create the file");
27
- return false;
28
- }
29
- $this->log("UNBXD_MODULE: created the file");
30
- return true;
31
- } catch (Exception $ex) {
32
- $this->log("UNBXD_MODULE:Error while creating the file");
33
- $this->log($ex->getMessage());
34
- return false;
35
- }
36
- }
 
 
 
 
37
 
38
  /**
39
  * @param $fileName
40
  * @param $content
41
  * @return bool
42
  */
43
- public function appendTofile($fileName, $content){
44
- try {
45
- if(file_put_contents($fileName, $content, FILE_APPEND)) {
46
- return true;
47
- } else {
48
- return false;
49
- }
50
- } catch(Exception $ex) {
51
- $this->log("UNBXD_MODULE:Error while appending the contents to feed file");
52
- $this->log($ex->getMessage());
53
- return false;
54
- }
55
- }
 
 
 
 
 
 
 
 
 
56
 
57
  /**
58
  * method to log
@@ -72,5 +98,7 @@ class Unbxd_Recscore_Model_Feed_Filemanager {
72
  public function deleteFile($file){
73
  unlink($file);
74
  }
 
 
75
  }
76
  ?>
1
  <?php
2
 
3
  class Unbxd_Recscore_Model_Feed_Filemanager {
4
+ var $logFileName;
5
+ var $_noFile = false;
6
+ var $_data = array();
7
 
8
 
9
+ public function setNoFile($value = true)
10
+ {
11
+ if ($value) {
12
+ $this->_noFile = true;
13
+ }
14
+ }
15
+
16
+ public function getContent($key)
17
+ {
18
+ return array_key_exists($key, $this->_data) ? $this->_data[$key] : "";
19
+ }
20
 
21
  public function __construct(){
22
  $this->logFileName = Mage::getBaseDir('log').DS.'generic.log';
26
  $this->logFileName = Mage::getBaseDir('log').DS.$logFileName;
27
  }
28
 
29
+ /**
30
+ * @param $file
31
+ * @return bool
32
+ */
33
+ public function createFile($file)
34
+ {
35
+ try {
36
+ if ($this->_noFile) {
37
+ return true;
38
+ }
39
+ $f = fopen($file, 'w');
40
+
41
+ fclose($f);
42
+ if (!file_exists($file)) {
43
+ $this->log("UNBXD_MODULE:Couldn't create the file");
44
+ return false;
45
+ }
46
+ $this->log("UNBXD_MODULE: created the file");
47
+ return true;
48
+ } catch (Exception $ex) {
49
+ $this->log("UNBXD_MODULE:Error while creating the file");
50
+ $this->log($ex->getMessage());
51
+ return false;
52
+ }
53
+ }
54
 
55
  /**
56
  * @param $fileName
57
  * @param $content
58
  * @return bool
59
  */
60
+ public function appendTofile($fileName, $content)
61
+ {
62
+ try {
63
+ if (!$this->_noFile) {
64
+ if (file_put_contents($fileName, $content, FILE_APPEND)) {
65
+ return true;
66
+ } else {
67
+ return false;
68
+ }
69
+ } else {
70
+ if (!array_key_exists($fileName, $this->_data)) {
71
+ $this->_data[$fileName] = "";
72
+ }
73
+ $this->_data[$fileName] = $this->_data[$fileName] . $content;
74
+ return true;
75
+ }
76
+ } catch (Exception $ex) {
77
+ $this->log("UNBXD_MODULE:Error while appending the contents to feed file");
78
+ $this->log($ex->getMessage());
79
+ return false;
80
+ }
81
+ }
82
 
83
  /**
84
  * method to log
98
  public function deleteFile($file){
99
  unlink($file);
100
  }
101
+
102
+
103
  }
104
  ?>
app/code/local/Unbxd/Recscore/Model/Feed/Jsonbuilder/Productbuilder.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
 
3
  class Unbxd_Recscore_Model_Feed_Jsonbuilder_Productbuilder extends
4
- Unbxd_Recscore_Model_Feed_Jsonbuilder_Jsonbuilder {
5
 
6
  const NUMBER = "number";
7
  const DECIMAL = "decimal";
@@ -11,165 +11,171 @@ class Unbxd_Recscore_Model_Feed_Jsonbuilder_Productbuilder extends
11
  const GENERATE_IMAGE = "generate_image";
12
  static $CATEGORY_EXCLUSION_LIST = array();
13
 
14
- /**
15
- * @return Unbxd_Recscore_Helper_Feedhelper
16
- */
17
- protected function _getFeedHelper() {
18
- return Mage::helper('unbxd_recscore/feedhelper');
19
- }
20
-
21
- /**
22
- * Given product collection, gives the products in unbxd formatted json
23
- * @param $website
24
- * @param $collection
25
- * @param $fields
26
- * @return string
27
- */
28
- public function getProducts($website, $collection, $fields, $copyFields) {
29
  $this->_changeTheme(Mage::getStoreConfig('design/package/name', $website->getDefaultStore()->getCode()),
30
- Mage::getStoreConfig('design/package/theme', $website->getDefaultStore()->getCode()));
31
  self::$CATEGORY_EXCLUSION_LIST = Mage::helper('unbxd_recscore/confighelper')->getCategoryExclusion($website);
32
  $content='';
33
  $firstLoop = true;
34
- foreach($collection as $product) {
35
- if($this->skipProduct($website, $product)) {
36
- continue;
37
- }
38
  if(!$firstLoop) {
39
- $content = $content . ",";
40
- }
41
 
42
  $productArray = $this->getProduct($website, $product, $fields, $copyFields);
43
  $productArray = $this->postProcessProduct($productArray, $fields, false);
44
- $content=$content.json_encode($productArray);
45
- $firstLoop = false;
46
- }
47
-
48
- return rtrim($content, ",");
49
  }
50
 
51
- /**
52
- * Method to check whether the product to be skipped or not depending on the filters
53
- * @param Mage_Core_Model_Website $website
54
- * @param $product
55
- * @return bool
56
- */
57
- public function skipProduct(Mage_Core_Model_Website $website, $product) {
58
- $filters = $this->_getFeedHelper()->getFilters($website);
59
- foreach($filters as $key=>$filter) {
60
- if($this->_getFeedHelper()->isMultiSelect($key)) {
61
- $values = $this->_getMultiSelectAttribute($key, $product);
62
- if(!is_array($values)) {
63
- return false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
64
  }
65
- if(in_array($filter, $values)) {
66
- return true;
67
- }
68
- } else if($this->_getFeedHelper()->getFieldType($key) == 'price') {
69
- $temp = explode(Unbxd_Recscore_Helper_Constants::FILTER_RANGE_DELIMITER,$filter);
70
- if(sizeof($temp) >=2) {
71
- $from = int($temp[0]);
72
- $to = int($temp[1]);
73
- } else {
74
- return false;
75
- }
76
-
77
- if(int($product->getData($key)) > $from && int($product->getData($key)) < $to) {
78
- return true;
79
- }
80
- } else {
81
- if($filter == $product->getData($key)) {
82
- return true;
83
- }
84
- }
85
- }
86
- return false;
87
- }
88
-
89
- /**
90
- * Method to handle Fields
91
- */
92
- protected function _handleFields($columnHeader, $unbxdFieldName, $product, &$productArray, $fields, $childProduct) {
93
- $columndata = $product->getData($columnHeader);
94
- if($columnHeader=="entity_id"){
95
- $uniqueIdField = 'uniqueId'.(($childProduct)?'Associated':'');
96
- $productArray[$uniqueIdField] = $columndata;
97
  }
98
- if($columnHeader=="url_path"){
99
- // handling the url
100
- $productArray[$unbxdFieldName] = $product->getProductUrl();
101
- } else if ($this->_getFeedHelper()->isImage($columnHeader)) {
102
- // handling tthe images
103
- $attributeValue = $this->_getImage($columnHeader, $unbxdFieldName, $product, $fields);
104
- if(!is_null($attributeValue)) {
105
- $productArray[$unbxdFieldName] = $attributeValue;
106
- }
107
- } else if( $fields[$unbxdFieldName][Unbxd_Recscore_Model_Field::multivalued]){
108
- // handling the array/ multiselect attribute
109
- $attributeValue = $this->_getMultiSelectAttribute($columnHeader, $product);
110
- if(!is_null($attributeValue)) {
111
- $productArray[$unbxdFieldName] = $attributeValue;
112
- }
113
- } else if (!is_null($columndata) && $columndata != ""){
114
- //adding the normal attribute
115
- $productArray[$unbxdFieldName] = $columndata;
 
 
 
 
 
 
 
 
 
 
 
116
  }
117
- }
118
-
119
- /**
120
- * method to get the product in json
121
- * @param Mage_Core_Model_Website $website
122
- * @param $product
123
- * @param $fields
124
- * @param bool $childProduct
125
- * @return array
126
- */
127
- public function getProduct(Mage_Core_Model_Website $website, $product, $fields, $copyFields, $childProduct = false) {
128
  $productArray =array();
129
 
130
  foreach($product->getData('') as $columnHeader=>$columndata){
131
-
132
  $unbxdFieldName = $this->getUnbxdFieldName($columnHeader, $childProduct);
133
  if(isset($unbxdFieldName) && $unbxdFieldName != "" && !array_key_exists($unbxdFieldName, $fields)) {
134
  continue;
135
  }
136
- $this->_handleFields($columnHeader, $unbxdFieldName, $product, $productArray, $fields, $childProduct);
137
  if(array_key_exists($columnHeader, $copyFields)) {
138
- $this->_handleFields($columnHeader, $copyFields[$columnHeader], $product, $productArray, $fields, $childProduct);
139
  }
140
- }
141
  if(!$childProduct) {
142
 
143
- if($this->_getFeedHelper()
144
- ->isConfigTrue($website, Unbxd_Recscore_Helper_Constants::INCLUDE_CHILD_PRODUCT)) {
145
- $productArray = $this->addChildrens($product, $fields, $productArray);
146
- }
147
 
148
  $category = $this->_getCategoryAttribute($product);
149
  // adding the category
150
  $productArray = $category + $productArray;
151
 
152
- $productArray[Unbxd_Recscore_Model_Resource_Field::AVAILABILITY] =
153
- $product->isSalable()? "true": "false";
 
 
 
 
 
 
154
 
155
  }
156
  return $productArray;
157
  }
158
 
159
- /**
160
- * method to get category content in xml given the product object
161
- * @param $product
162
- * @return array
163
- */
164
- protected function _getCategoryAttribute($product){
165
- $cats = $product->getCategoryIds();
166
- $categoryIds = array();
167
- $category = array();
168
- $categoryData = array();
169
  foreach ($cats as $categoryId) {
170
  $_cat = $this->_getFeedHelper()->getCategory($categoryId);
171
  if($_cat == null) {
172
- continue;
173
  }
174
  $categoryName = $_cat->getName();
175
  if($categoryName == null || $categoryName == "" || !$_cat->getIsActive() ) {
@@ -179,37 +185,38 @@ class Unbxd_Recscore_Model_Feed_Jsonbuilder_Productbuilder extends
179
  $category[] = $categoryName;
180
  }
181
 
182
- for($level =1; $level <=4 ; $level++) {
183
- $levelCategories = $this->_getFeedHelper()
184
- ->getCategoryOnLevel($categoryIds, $level);
185
 
186
- if (sizeof($levelCategories) > 0) {
187
- $categoryData['categoryLevel' . $level] = array_values(array_diff($levelCategories, self::$CATEGORY_EXCLUSION_LIST));
188
- $categoryData['catlevel' . $level . 'Name'] = $levelCategories[0];
189
- $category = array_merge($category, $levelCategories);
190
- }
191
- }
192
 
193
  $categoryData[Unbxd_Recscore_Model_Resource_Field::CATEGORY_IDS_NAME] = $categoryIds;
194
- $categoryData[Unbxd_Recscore_Model_Resource_Field::CATEGORY_NAME] = array_values(array_diff($category, self::$CATEGORY_EXCLUSION_LIST));
195
-
196
  return $categoryData;
197
- }
198
-
199
- /**
200
- * method to returns as an array of values given the fieldName and the product
201
- * @param $fieldName
202
- * @param $product
203
- * @return array|null
204
- */
205
- protected function _getMultiSelectAttribute($fieldName, $product) {
206
  $data = explode(",", $product->getData($fieldName));
207
  $valueAsAnArray = array();
208
  foreach($data as $eachdata){
209
  $attributeValue = Mage::getResourceSingleton("unbxd_recscore/attribute")
210
- ->getAttributeValue($fieldName, trim($eachdata), $product);
211
  if(!is_null($attributeValue) && $attributeValue != "" && $attributeValue != "Use Config") {
212
  $valueAsAnArray[] = $attributeValue;
 
213
  }
214
  }
215
  if(sizeof($valueAsAnArray) > 0) {
@@ -218,31 +225,31 @@ class Unbxd_Recscore_Model_Feed_Jsonbuilder_Productbuilder extends
218
  return null;
219
  }
220
 
221
- protected function _changeTheme($packageName, $themeName) {
222
- Mage::getDesign()->setArea('frontend')
223
- ->setPackageName($packageName)
224
- ->setTheme($themeName);
225
- }
226
-
227
- /**
228
- * Method given the fieldName and product, returns full image url
229
- * @param $fieldName
230
- * @param $unbxdFieldName
231
- * @param $product
232
- * @param $fields
233
- * @return string
234
- */
235
- protected function _getImage($fieldName, $unbxdFieldName, $product, $fields) {
236
  if(array_key_exists(self::GENERATE_IMAGE, $fields[$unbxdFieldName]) &&
237
- $fields[$unbxdFieldName][self::GENERATE_IMAGE] == "1") {
238
- try {
239
- return (string)Mage::helper('catalog/image')->init($product, $fieldName)
240
- ->resize(155, 155);
241
- } catch (Exception $e) {
242
- error_log("Error while fetching the image" . $e->getMessage());
243
- }
244
- }
245
- return $product->getData($fieldName);
246
  }
247
 
248
  /*
@@ -254,7 +261,7 @@ class Unbxd_Recscore_Model_Feed_Jsonbuilder_Productbuilder extends
254
  } else {
255
  $unbxdFieldName = $columnHeader;
256
  }
257
- return $unbxdFieldName;
258
  //return $this->renameConflictedFeatureFields($unbxdFieldName);
259
  }
260
 
@@ -269,38 +276,38 @@ class Unbxd_Recscore_Model_Feed_Jsonbuilder_Productbuilder extends
269
  }
270
 
271
  /**
272
- * gives the children in form of array
273
- */
274
- public function addChildrens($product, $fields, $productArray) {
275
-
276
  $type = $product->getData('type_id');
277
  if ($type == "configurable" || $type == "grouped" ) {
278
  $associatedProducts = array();
279
  $conf = Mage::getModel('catalog/product_type_configurable')->setProduct($product);
280
- $childrens = $conf->getUsedProductCollection()
281
- ->addAttributeToSelect('*')
282
- ->addFilterByRequiredOptions()
283
- ->joinField("qtyAssociated", "cataloginventory_stock_item", 'qty', 'product_id=entity_id', null, 'left');
284
- foreach ($childrens as $children)
285
- {
286
- $childProduct = $this->getProduct($children, $fields, true);
287
- if(isset($childProduct) && sizeof($childProduct) > 0 ) {
288
- $childProduct = $this->postProcessProduct($childProduct, $fields, true);
289
- $associatedProducts[] = $childProduct;
290
- }
291
- }
292
- if( sizeof($associatedProducts) > 0) {
293
- $productArray["associatedProducts"] = $associatedProducts;
294
- }
295
- return $productArray;
296
  } else {
297
  return $productArray;
298
  }
299
  }
300
 
301
  /**
302
- * process the prodcut
303
- */
304
  public function postProcessProduct($product, $fields, $isChild=false) {
305
  if($isChild) {
306
  $product = $this->convertMultivalued($product);
@@ -390,11 +397,11 @@ class Unbxd_Recscore_Model_Feed_Jsonbuilder_Productbuilder extends
390
  */
391
  public function convertMultivalued($product, $fields = null) {
392
  foreach($product as $field=>$value) {
393
- if((is_null($fields) ||
394
- (($field != "associatedProducts") &&
395
- array_key_exists(Unbxd_Recscore_Model_Field::multivalued,$fields[$field]) &&
396
- $fields[$field][Unbxd_Recscore_Model_Field::multivalued])) &&
397
- !is_array($value)) {
398
 
399
  $valueAsAnArray = array();
400
  $valueAsAnArray[] = $value;
1
  <?php
2
 
3
  class Unbxd_Recscore_Model_Feed_Jsonbuilder_Productbuilder extends
4
+ Unbxd_Recscore_Model_Feed_Jsonbuilder_Jsonbuilder {
5
 
6
  const NUMBER = "number";
7
  const DECIMAL = "decimal";
11
  const GENERATE_IMAGE = "generate_image";
12
  static $CATEGORY_EXCLUSION_LIST = array();
13
 
14
+ /**
15
+ * @return Unbxd_Recscore_Helper_Feedhelper
16
+ */
17
+ protected function _getFeedHelper() {
18
+ return Mage::helper('unbxd_recscore/feedhelper');
19
+ }
20
+
21
+ /**
22
+ * Given product collection, gives the products in unbxd formatted json
23
+ * @param $website
24
+ * @param $collection
25
+ * @param $fields
26
+ * @return string
27
+ */
28
+ public function getProducts($website, $collection, $fields, $copyFields) {
29
  $this->_changeTheme(Mage::getStoreConfig('design/package/name', $website->getDefaultStore()->getCode()),
30
+ Mage::getStoreConfig('design/package/theme', $website->getDefaultStore()->getCode()));
31
  self::$CATEGORY_EXCLUSION_LIST = Mage::helper('unbxd_recscore/confighelper')->getCategoryExclusion($website);
32
  $content='';
33
  $firstLoop = true;
34
+ foreach($collection as $product) {
35
+ if($this->skipProduct($website, $product)) {
36
+ continue;
37
+ }
38
  if(!$firstLoop) {
39
+ $content = $content . ",";
40
+ }
41
 
42
  $productArray = $this->getProduct($website, $product, $fields, $copyFields);
43
  $productArray = $this->postProcessProduct($productArray, $fields, false);
44
+ $content=$content.json_encode($productArray);
45
+ $firstLoop = false;
46
+ }
47
+
48
+ return rtrim($content, ",");
49
  }
50
 
51
+ /**
52
+ * Method to check whether the product to be skipped or not depending on the filters
53
+ * @param Mage_Core_Model_Website $website
54
+ * @param $product
55
+ * @return bool
56
+ */
57
+ public function skipProduct(Mage_Core_Model_Website $website, $product) {
58
+ $filters = $this->_getFeedHelper()->getFilters($website);
59
+ foreach($filters as $key=>$filter) {
60
+ if($this->_getFeedHelper()->isMultiSelect($key)) {
61
+ $values = $this->_getMultiSelectAttribute($key, $product);
62
+ if(!is_array($values)) {
63
+ return false;
64
+ }
65
+ if(in_array($filter, $values)) {
66
+ return true;
67
+ }
68
+ } else if($this->_getFeedHelper()->getFieldType($key) == 'price') {
69
+ $temp = explode(Unbxd_Recscore_Helper_Constants::FILTER_RANGE_DELIMITER,$filter);
70
+ if(sizeof($temp) >=2) {
71
+ $from = int($temp[0]);
72
+ $to = int($temp[1]);
73
+ } else {
74
+ return false;
75
+ }
76
+
77
+ if(int($product->getData($key)) > $from && int($product->getData($key)) < $to) {
78
+ return true;
79
+ }
80
+ } else {
81
+ if($filter == $product->getData($key)) {
82
+ return true;
83
+ }
84
+ }
85
  }
86
+ return false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
87
  }
88
+
89
+ /**
90
+ * Method to handle Fields
91
+ */
92
+ protected function _handleFields($columnHeader, $unbxdFieldName, $product, &$productArray, $fields, $childProduct) {
93
+ $columndata = $product->getData($columnHeader);
94
+ if($columnHeader=="entity_id"){
95
+ $uniqueIdField = 'uniqueId'.(($childProduct)?'Associated':'');
96
+ $productArray[$uniqueIdField] = $columndata;
97
+ }
98
+ if($columnHeader=="url_path"){
99
+ // handling the url
100
+ $productArray[$unbxdFieldName] = $product->getProductUrl();
101
+ } else if ($this->_getFeedHelper()->isImage($columnHeader)) {
102
+ // handling tthe images
103
+ $attributeValue = $this->_getImage($columnHeader, $unbxdFieldName, $product, $fields);
104
+ if(!is_null($attributeValue)) {
105
+ $productArray[$unbxdFieldName] = $attributeValue;
106
+ }
107
+ } else if( $fields[$unbxdFieldName][Unbxd_Recscore_Model_Field::multivalued]){
108
+ // handling the array/ multiselect attribute
109
+ $attributeValue = $this->_getMultiSelectAttribute($columnHeader, $product);
110
+ if(!is_null($attributeValue)) {
111
+ $productArray[$unbxdFieldName] = $attributeValue;
112
+ }
113
+ } else if (!is_null($columndata) && $columndata != ""){
114
+ //adding the normal attribute
115
+ $productArray[$unbxdFieldName] = $columndata;
116
+ }
117
  }
118
+
119
+ /**
120
+ * method to get the product in json
121
+ * @param Mage_Core_Model_Website $website
122
+ * @param $product
123
+ * @param $fields
124
+ * @param bool $childProduct
125
+ * @return array
126
+ */
127
+ public function getProduct(Mage_Core_Model_Website $website, $product, $fields, $copyFields, $childProduct = false) {
 
128
  $productArray =array();
129
 
130
  foreach($product->getData('') as $columnHeader=>$columndata){
131
+
132
  $unbxdFieldName = $this->getUnbxdFieldName($columnHeader, $childProduct);
133
  if(isset($unbxdFieldName) && $unbxdFieldName != "" && !array_key_exists($unbxdFieldName, $fields)) {
134
  continue;
135
  }
136
+ $this->_handleFields($columnHeader, $unbxdFieldName, $product, $productArray, $fields, $childProduct);
137
  if(array_key_exists($columnHeader, $copyFields)) {
138
+ $this->_handleFields($columnHeader, $copyFields[$columnHeader], $product, $productArray, $fields, $childProduct);
139
  }
140
+ }
141
  if(!$childProduct) {
142
 
143
+ if($this->_getFeedHelper()
144
+ ->isConfigTrue($website, Unbxd_Recscore_Helper_Constants::INCLUDE_CHILD_PRODUCT)) {
145
+ $productArray = $this->addChildrens($website, $product, $fields, $copyFields, $productArray);
146
+ }
147
 
148
  $category = $this->_getCategoryAttribute($product);
149
  // adding the category
150
  $productArray = $category + $productArray;
151
 
152
+ $productArray[Unbxd_Recscore_Model_Resource_Field::AVAILABILITY] =
153
+ $product->isSalable()? "true": "false";
154
+ if(array_key_exists('final_price', $fields)) {
155
+ $productArray['final_price'] = $product->getFinalPrice();
156
+ }
157
+ if(array_key_exists('url_path', $fields)) {
158
+ $productArray['url_path'] = $product->getProductUrl();
159
+ }
160
 
161
  }
162
  return $productArray;
163
  }
164
 
165
+ /**
166
+ * method to get category content in xml given the product object
167
+ * @param $product
168
+ * @return array
169
+ */
170
+ protected function _getCategoryAttribute($product){
171
+ $cats = $product->getCategoryIds();
172
+ $categoryIds = array();
173
+ $category = array();
174
+ $categoryData = array();
175
  foreach ($cats as $categoryId) {
176
  $_cat = $this->_getFeedHelper()->getCategory($categoryId);
177
  if($_cat == null) {
178
+ continue;
179
  }
180
  $categoryName = $_cat->getName();
181
  if($categoryName == null || $categoryName == "" || !$_cat->getIsActive() ) {
185
  $category[] = $categoryName;
186
  }
187
 
188
+ for($level =1; $level <=4 ; $level++) {
189
+ $levelCategories = $this->_getFeedHelper()
190
+ ->getCategoryOnLevel($categoryIds, $level+1);
191
 
192
+ if (sizeof($levelCategories) > 0) {
193
+ $categoryData['categoryLevel' . $level] = array_values(array_diff($levelCategories, self::$CATEGORY_EXCLUSION_LIST));
194
+ $categoryData['catlevel' . $level . 'Name'] = $levelCategories[0];
195
+ $category = array_merge($category, $levelCategories);
196
+ }
197
+ }
198
 
199
  $categoryData[Unbxd_Recscore_Model_Resource_Field::CATEGORY_IDS_NAME] = $categoryIds;
200
+ $categoryData[Unbxd_Recscore_Model_Resource_Field::CATEGORY_NAME] = array_values(array_unique(array_diff($category, self::$CATEGORY_EXCLUSION_LIST)));
201
+
202
  return $categoryData;
203
+ }
204
+
205
+ /**
206
+ * method to returns as an array of values given the fieldName and the product
207
+ * @param $fieldName
208
+ * @param $product
209
+ * @return array|null
210
+ */
211
+ protected function _getMultiSelectAttribute($fieldName, $product) {
212
  $data = explode(",", $product->getData($fieldName));
213
  $valueAsAnArray = array();
214
  foreach($data as $eachdata){
215
  $attributeValue = Mage::getResourceSingleton("unbxd_recscore/attribute")
216
+ ->getAttributeValue($fieldName, trim($eachdata), $product);
217
  if(!is_null($attributeValue) && $attributeValue != "" && $attributeValue != "Use Config") {
218
  $valueAsAnArray[] = $attributeValue;
219
+
220
  }
221
  }
222
  if(sizeof($valueAsAnArray) > 0) {
225
  return null;
226
  }
227
 
228
+ protected function _changeTheme($packageName, $themeName) {
229
+ Mage::getDesign()->setArea('frontend')
230
+ ->setPackageName($packageName)
231
+ ->setTheme($themeName);
232
+ }
233
+
234
+ /**
235
+ * Method given the fieldName and product, returns full image url
236
+ * @param $fieldName
237
+ * @param $unbxdFieldName
238
+ * @param $product
239
+ * @param $fields
240
+ * @return string
241
+ */
242
+ protected function _getImage($fieldName, $unbxdFieldName, $product, $fields) {
243
  if(array_key_exists(self::GENERATE_IMAGE, $fields[$unbxdFieldName]) &&
244
+ $fields[$unbxdFieldName][self::GENERATE_IMAGE] == "1") {
245
+ try {
246
+ return (string)Mage::helper('catalog/image')->init($product, $fieldName)
247
+ ->resize(155, 155);
248
+ } catch (Exception $e) {
249
+ error_log("Error while fetching the image" . $e->getMessage());
250
+ }
251
+ }
252
+ return $product->getData($fieldName);
253
  }
254
 
255
  /*
261
  } else {
262
  $unbxdFieldName = $columnHeader;
263
  }
264
+ return $unbxdFieldName;
265
  //return $this->renameConflictedFeatureFields($unbxdFieldName);
266
  }
267
 
276
  }
277
 
278
  /**
279
+ * gives the children in form of array
280
+ */
281
+ public function addChildrens(Mage_Core_Model_Website $website, $product, $fields, $copyFields, $productArray) {
282
+
283
  $type = $product->getData('type_id');
284
  if ($type == "configurable" || $type == "grouped" ) {
285
  $associatedProducts = array();
286
  $conf = Mage::getModel('catalog/product_type_configurable')->setProduct($product);
287
+ $childrens = $conf->getUsedProductCollection()
288
+ ->addAttributeToSelect('*')
289
+ ->addFilterByRequiredOptions()
290
+ ->joinField("qtyAssociated", "cataloginventory_stock_item", 'qty', 'product_id=entity_id', null, 'left');
291
+ foreach ($childrens as $children)
292
+ {
293
+ $childProduct = $this->getProduct($website, $children, $fields, $copyFields, true);
294
+ if(isset($childProduct) && sizeof($childProduct) > 0 ) {
295
+ $childProduct = $this->postProcessProduct($childProduct, $fields, true);
296
+ $associatedProducts[] = $childProduct;
297
+ }
298
+ }
299
+ if( sizeof($associatedProducts) > 0) {
300
+ $productArray["associatedProducts"] = $associatedProducts;
301
+ }
302
+ return $productArray;
303
  } else {
304
  return $productArray;
305
  }
306
  }
307
 
308
  /**
309
+ * process the prodcut
310
+ */
311
  public function postProcessProduct($product, $fields, $isChild=false) {
312
  if($isChild) {
313
  $product = $this->convertMultivalued($product);
397
  */
398
  public function convertMultivalued($product, $fields = null) {
399
  foreach($product as $field=>$value) {
400
+ if((is_null($fields) ||
401
+ (($field != "associatedProducts") &&
402
+ array_key_exists(Unbxd_Recscore_Model_Field::multivalued,$fields[$field]) &&
403
+ $fields[$field][Unbxd_Recscore_Model_Field::multivalued])) &&
404
+ !is_array($value)) {
405
 
406
  $valueAsAnArray = array();
407
  $valueAsAnArray[] = $value;
app/code/local/Unbxd/Recscore/Model/Feed/Tags.php CHANGED
@@ -10,6 +10,8 @@ class Unbxd_Recscore_Model_Feed_Tags {
10
 
11
  const ADD = 'add';
12
 
 
 
13
  const DELETE = 'delete';
14
 
15
  const OBJ_START = '{';
@@ -29,4 +31,4 @@ class Unbxd_Recscore_Model_Feed_Tags {
29
  public function getKey($key) {
30
  return self::DOUBLE_QUOTE . $key . self::DOUBLE_QUOTE;
31
  }
32
- }
10
 
11
  const ADD = 'add';
12
 
13
+ const ITEMS = 'items';
14
+
15
  const DELETE = 'delete';
16
 
17
  const OBJ_START = '{';
31
  public function getKey($key) {
32
  return self::DOUBLE_QUOTE . $key . self::DOUBLE_QUOTE;
33
  }
34
+ }
app/code/local/Unbxd/Recscore/Model/Field.php CHANGED
@@ -7,7 +7,8 @@
7
  * @package Unbxd_Recscore
8
  * @author Unbxd Software Pvt. Ltd
9
  */
10
- class Unbxd_Recscore_Model_Field extends Mage_Core_Model_Abstract {
 
11
 
12
  /**
13
  * field name column in db
@@ -48,9 +49,9 @@
48
  * @var array
49
  */
50
  public static $data_types = array(Unbxd_Recscore_Helper_Constants::UNBXD_DATATYPE_TEXT, Unbxd_Recscore_Helper_Constants::UNBXD_DATATYPE_LONGTEXT,
51
- Unbxd_Recscore_Helper_Constants::UNBXD_DATATYPE_LINK, Unbxd_Recscore_Helper_Constants::UNBXD_DATATYPE_NUMBER,
52
- Unbxd_Recscore_Helper_Constants::UNBXD_DATATYPE_DECIMAL, Unbxd_Recscore_Helper_Constants::UNBXD_DATATYPE_DATE);
53
-
54
 
55
  public static $displayableFeatureFields = array('title', 'price',
56
  'brand', 'color', 'size', 'imageUrl', 'productUrl');
@@ -62,11 +63,11 @@
62
  * @return void
63
  */
64
  protected function _construct()
65
- {
66
- $this->_init('unbxd_recscore/field');
67
  Unbxd_Recscore_Model_Field::$featurefields = $this->getFeaturedFields();
68
 
69
- }
70
 
71
 
72
  /**
@@ -74,21 +75,22 @@
74
  *
75
  * @return void
76
  */
77
- public function saveFields($collection) {
 
78
  $this->_getResource()->beginTransaction();
79
  try {
80
  foreach ($collection as $data) {
81
- if(sizeof($data) > 0) {
82
- if(array_key_exists("add", $data)) {
83
- $data["add"]->save();
84
- } else if (array_key_exists("delete", $data)) {
85
- $data["delete"]->delete();
 
86
  }
87
- }
88
  }
89
 
90
  $this->_getResource()->commit();
91
- } catch(Exception $e) {
92
  $this->_getResource()->rollBack();
93
  Mage::helper("unbxd_recscore")->log(Zend_Log::ERR, "Saving fields failed because " . $e->getMessage());
94
  return array('OTHERS' => $e->getMessage());
@@ -100,13 +102,14 @@
100
  /*
101
  * method to get the featured fields
102
  */
103
- public function getFeaturedFields() {
 
104
  $featuredFields = array();
105
- $featuredFields["uniqueId"]=$this->getField("text", "false", "false");
106
- $featuredFields["sellingPrice"]=$this->getField("decimal", "false", "false");
107
- $featuredFields["discount"]=$this->getField("decimal", "false", "false");
108
- $featuredFields["rating"]=$this->getField("decimal", "false", "false");
109
- $featuredFields["brandId"]=$this->getField("text", "false", "false");
110
  $featuredFields[Unbxd_Recscore_Model_Resource_Field::CAT_LEVEL_1_NAME] =
111
  $this->getField("text", "false", "false");
112
  $featuredFields[Unbxd_Recscore_Model_Resource_Field::CAT_LEVEL_2_NAME] =
@@ -124,97 +127,215 @@
124
  $featuredFields[Unbxd_Recscore_Model_Resource_Field::CAT_LEVEL_4] =
125
  $this->getField("text", "true", "false");
126
  $featuredFields["category"] = $this->getField("text", "true", "true");
127
- $featuredFields["subCategory"]=$this->getField("text", "true", "true");
128
- $featuredFields["color"]=$this->getField("text", "true", "false");
129
- $featuredFields["size"]=$this->getField("text", "true", "false");
130
- $featuredFields["availability"]=$this->getField("bool", "false", "false");
131
- $featuredFields["description"]=$this->getField("longText", "false", "false");
132
- $featuredFields["imageUrl"]=$this->getField("link", "true", "false");
133
- $featuredFields["productUrl"]=$this->getField("link", "false", "false");
134
- $featuredFields["brand"]=$this->getField("text", "false", "true");
135
- $featuredFields["price"]=$this->getField("decimal", "false", "false");
136
- $featuredFields["title"]=$this->getField("text", "false", "true");
137
- $featuredFields["gender"]=$this->getField("text", "false", "false");
138
- $featuredFields["unbxdVisibility"]=$this->getField("text", "false", "false");
139
  return $featuredFields;
140
  }
141
 
142
- public function getField($dataType, $multiValued, $autosuggest) {
143
- return array( self::status => 1, self::datatype => $dataType,
144
- self::multivalued => ($multiValued=="true")?1:0,
145
- self::autosuggest => ($autosuggest=="true")?1:0 );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
146
 
 
 
 
 
 
147
  }
148
 
149
- public function getPriceFieldName() {
150
- $priceFieldConfig =
151
- Mage::helper('unbxd_recscore')->getEngineConfigData(Unbxd_Recscore_Helper_Constants::FEATURE_FIELD_PRICE);
152
- return $priceFieldConfig[Unbxd_Recscore_Helper_Constants::FEATURE_FIELD_PRICE];
 
153
  }
154
 
155
- public function getImageUrlFieldName() {
156
- $imageUrlFieldName = $this->_getResource()->getFieldByFeatureField(Mage::app()->getWebsite()->getWebsiteId(),
157
- Unbxd_Recscore_Helper_Constants::FEATURE_FIELD_IMAGE_URL);
158
- return $imageUrlFieldName;
159
- }
 
 
160
 
161
- public function getProductUrlFieldName() {
162
- $fieldConfig =
163
- Mage::helper('unbxd_recscore')
164
- ->getEngineConfigData(Unbxd_Recscore_Helper_Constants::FEATURE_FIELD_PRODUCT_URL);
165
- return $fieldConfig[Unbxd_Recscore_Helper_Constants::FEATURE_FIELD_PRODUCT_URL];
 
 
 
 
 
 
 
166
 
167
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
168
 
169
- public function getImageFields($website) {
170
- $conf = Mage::helper('unbxd_recscore')->getEngineConfigData(Unbxd_Recscore_Helper_Constants::FIELD_CONF, $website, true);
171
  $fieldConf = json_decode($conf[Unbxd_Recscore_Helper_Constants::FIELD_CONF], true);
172
- if(!is_array($fieldConf)) {
173
- return array();
 
 
 
 
 
 
 
174
  }
175
- $imageFields = array();
176
- foreach($fieldConf as $field => $conf ) {
177
- if(!is_array($conf) || !array_key_exists('image_full', $conf)) {
178
- continue;
179
- }
180
- $imageFields[$field] = Mage::helper('unbxd_recscore')->isConfigTrue($website, 'image_full')?true:false;
181
- }
182
- return $imageFields;
183
- }
184
-
185
- public function getCopyFields($website) {
186
- $conf = Mage::helper('unbxd_recscore')->getEngineConfigData(Unbxd_Recscore_Helper_Constants::FIELD_CONF, $website, true);
187
-
188
- $fieldConf = json_decode($conf[Unbxd_Recscore_Helper_Constants::FIELD_CONF], true);
189
- if(!is_array($fieldConf)) {
190
- return array();
191
- }
192
- $imageFields = array();
193
- foreach($fieldConf as $field => $conf ) {
194
- if(!is_array($conf) || !array_key_exists('copy_field', $conf)) {
195
- continue;
196
- }
197
- $imageFields[$field] = $conf['copy_field'];
198
- }
199
- return $imageFields;
200
- }
201
-
202
- public function validateDatatype($unbxdDatatype, $magentoDatatype) {
203
- if($unbxdDatatype == Unbxd_Recscore_Helper_Constants::UNBXD_DATATYPE_TEXT || $unbxdDatatype == Unbxd_Recscore_Helper_Constants::UNBXD_DATATYPE_LONGTEXT ||
204
- $unbxdDatatype == Unbxd_Recscore_Helper_Constants::UNBXD_DATATYPE_LINK) {
205
- return true;
206
- }
207
- if($unbxdDatatype == Unbxd_Recscore_Helper_Constants::UNBXD_DATATYPE_NUMBER && $magentoDatatype == Unbxd_Recscore_Helper_Constants::FIELD_TYPE_NUMBER) {
208
- return true;
209
- }
210
- if($unbxdDatatype == Unbxd_Recscore_Helper_Constants::UNBXD_DATATYPE_DECIMAL && $magentoDatatype == Unbxd_Recscore_Helper_Constants::FIELD_TYPE_NUMBER) {
211
- return true;
212
- }
213
- if($unbxdDatatype == Unbxd_Recscore_Helper_Constants::UNBXD_DATATYPE_DATE && $magentoDatatype == Unbxd_Recscore_Helper_Constants::FIELD_TYPE_DATE) {
214
- return true;
215
- }
216
- return false;
217
- }
218
  }
219
 
220
  ?>
7
  * @package Unbxd_Recscore
8
  * @author Unbxd Software Pvt. Ltd
9
  */
10
+ class Unbxd_Recscore_Model_Field extends Mage_Core_Model_Abstract
11
+ {
12
 
13
  /**
14
  * field name column in db
49
  * @var array
50
  */
51
  public static $data_types = array(Unbxd_Recscore_Helper_Constants::UNBXD_DATATYPE_TEXT, Unbxd_Recscore_Helper_Constants::UNBXD_DATATYPE_LONGTEXT,
52
+ Unbxd_Recscore_Helper_Constants::UNBXD_DATATYPE_LINK, Unbxd_Recscore_Helper_Constants::UNBXD_DATATYPE_NUMBER,
53
+ Unbxd_Recscore_Helper_Constants::UNBXD_DATATYPE_DECIMAL, Unbxd_Recscore_Helper_Constants::UNBXD_DATATYPE_DATE);
54
+
55
 
56
  public static $displayableFeatureFields = array('title', 'price',
57
  'brand', 'color', 'size', 'imageUrl', 'productUrl');
63
  * @return void
64
  */
65
  protected function _construct()
66
+ {
67
+ $this->_init('unbxd_recscore/field');
68
  Unbxd_Recscore_Model_Field::$featurefields = $this->getFeaturedFields();
69
 
70
+ }
71
 
72
 
73
  /**
75
  *
76
  * @return void
77
  */
78
+ public function saveFields($collection)
79
+ {
80
  $this->_getResource()->beginTransaction();
81
  try {
82
  foreach ($collection as $data) {
83
+ if (sizeof($data) > 0) {
84
+ if (array_key_exists("add", $data)) {
85
+ $data["add"]->save();
86
+ } else if (array_key_exists("delete", $data)) {
87
+ $data["delete"]->delete();
88
+ }
89
  }
 
90
  }
91
 
92
  $this->_getResource()->commit();
93
+ } catch (Exception $e) {
94
  $this->_getResource()->rollBack();
95
  Mage::helper("unbxd_recscore")->log(Zend_Log::ERR, "Saving fields failed because " . $e->getMessage());
96
  return array('OTHERS' => $e->getMessage());
102
  /*
103
  * method to get the featured fields
104
  */
105
+ public function getFeaturedFields()
106
+ {
107
  $featuredFields = array();
108
+ $featuredFields["uniqueId"] = $this->getField("text", "false", "false");
109
+ $featuredFields["sellingPrice"] = $this->getField("decimal", "false", "false");
110
+ $featuredFields["discount"] = $this->getField("decimal", "false", "false");
111
+ $featuredFields["rating"] = $this->getField("decimal", "false", "false");
112
+ $featuredFields["brandId"] = $this->getField("text", "false", "false");
113
  $featuredFields[Unbxd_Recscore_Model_Resource_Field::CAT_LEVEL_1_NAME] =
114
  $this->getField("text", "false", "false");
115
  $featuredFields[Unbxd_Recscore_Model_Resource_Field::CAT_LEVEL_2_NAME] =
127
  $featuredFields[Unbxd_Recscore_Model_Resource_Field::CAT_LEVEL_4] =
128
  $this->getField("text", "true", "false");
129
  $featuredFields["category"] = $this->getField("text", "true", "true");
130
+ $featuredFields["subCategory"] = $this->getField("text", "true", "true");
131
+ $featuredFields["color"] = $this->getField("text", "true", "false");
132
+ $featuredFields["size"] = $this->getField("text", "true", "false");
133
+ $featuredFields["availability"] = $this->getField("bool", "false", "false");
134
+ $featuredFields["description"] = $this->getField("longText", "false", "false");
135
+ $featuredFields["imageUrl"] = $this->getField("link", "true", "false");
136
+ $featuredFields["productUrl"] = $this->getField("link", "false", "false");
137
+ $featuredFields["brand"] = $this->getField("text", "false", "true");
138
+ $featuredFields["price"] = $this->getField("decimal", "false", "false");
139
+ $featuredFields["title"] = $this->getField("text", "false", "true");
140
+ $featuredFields["gender"] = $this->getField("text", "false", "false");
141
+ $featuredFields["unbxdVisibility"] = $this->getField("text", "false", "false");
142
  return $featuredFields;
143
  }
144
 
145
+ public function getField($dataType, $multiValued, $autosuggest)
146
+ {
147
+ return array(self::status => 1, self::datatype => $dataType,
148
+ self::multivalued => ($multiValued == "true") ? 1 : 0,
149
+ self::autosuggest => ($autosuggest == "true") ? 1 : 0);
150
+
151
+ }
152
+
153
+ public function rebuildConfigCache(Mage_Core_Model_Website $website) {
154
+ $this->setBrandFieldName($website);
155
+ $this->setCategoryFieldName($website);
156
+ $this->setImageUrlFieldName($website);
157
+ $this->setPriceFieldName($website);
158
+ $this->setProductUrlFieldName($website);
159
+ $this->setTitleFieldName($website);
160
+ }
161
+
162
+ public function getPriceFieldName()
163
+ {
164
+ $priceFieldConfig =
165
+ Mage::helper('unbxd_recscore')->getEngineConfigData(Unbxd_Recscore_Helper_Constants::FEATURE_FIELD_PRICE);
166
+ if (array_key_exists(Unbxd_Recscore_Helper_Constants::FEATURE_FIELD_PRICE, $priceFieldConfig)) {
167
+ return $priceFieldConfig[Unbxd_Recscore_Helper_Constants::FEATURE_FIELD_PRICE];
168
+ }
169
+ $this->rebuildConfigCache(Mage::app()->getWebsite());
170
+ $priceField = $this->_getResource()->getFieldByFeatureField(Mage::app()->getWebsite()->getWebsiteId(),
171
+ Unbxd_Recscore_Helper_Constants::FEATURE_FIELD_PRICE);
172
+ return $priceField;
173
+ }
174
 
175
+ public function setPriceFieldName(Mage_Core_Model_Website $website) {
176
+ $priceName = $this->getResource()->getFieldByFeatureField($website->getWebsiteId(),
177
+ Unbxd_Recscore_Helper_Constants::FEATURE_FIELD_PRICE);
178
+ Mage::helper('unbxd_recscore')->saveConfig($website,
179
+ array(Unbxd_Recscore_Helper_Constants::FEATURE_FIELD_PRICE => $priceName));
180
  }
181
 
182
+ public function getImageUrlFieldName()
183
+ {
184
+ $imageUrlFieldName = $this->_getResource()->getFieldByFeatureField(Mage::app()->getWebsite()->getWebsiteId(),
185
+ Unbxd_Recscore_Helper_Constants::FEATURE_FIELD_IMAGE_URL);
186
+ return $imageUrlFieldName;
187
  }
188
 
189
+ public function setImageUrlFieldName(Mage_Core_Model_Website $website)
190
+ {
191
+ $imageField = $this->getResource()->getFieldByFeatureField($website->getWebsiteId(),
192
+ Unbxd_Recscore_Helper_Constants::FEATURE_FIELD_IMAGE_URL);
193
+ Mage::helper('unbxd_recscore')->saveConfig($website,
194
+ array(Unbxd_Recscore_Helper_Constants::FEATURE_FIELD_IMAGE_URL => $imageField));
195
+ }
196
 
197
+ public function getProductUrlFieldName()
198
+ {
199
+ $fieldConfig =
200
+ Mage::helper('unbxd_recscore')
201
+ ->getEngineConfigData(Unbxd_Recscore_Helper_Constants::FEATURE_FIELD_PRODUCT_URL);
202
+ if(array_key_exists(Unbxd_Recscore_Helper_Constants::FEATURE_FIELD_PRODUCT_URL, $fieldConfig)) {
203
+ return $fieldConfig[Unbxd_Recscore_Helper_Constants::FEATURE_FIELD_PRODUCT_URL];
204
+ }
205
+ $this->rebuildConfigCache(Mage::app()->getWebsite());
206
+ $productUrl = $this->_getResource()->getFieldByFeatureField(Mage::app()->getWebsite()->getWebsiteId(),
207
+ Unbxd_Recscore_Helper_Constants::FEATURE_FIELD_PRODUCT_URL);
208
+ return $productUrl;
209
 
210
+ }
211
+
212
+ public function setProductUrlFieldName(Mage_Core_Model_Website $website)
213
+ {
214
+ $productUrlField = $this->getResource()->getFieldByFeatureField($website->getWebsiteId(),
215
+ Unbxd_Recscore_Helper_Constants::FEATURE_FIELD_PRODUCT_URL);
216
+ Mage::helper('unbxd_recscore')->saveConfig($website,
217
+ array(Unbxd_Recscore_Helper_Constants::FEATURE_FIELD_PRODUCT_URL => $productUrlField));
218
+ }
219
+
220
+ public function getCategoryFieldName()
221
+ {
222
+ $fieldConfig =
223
+ Mage::helper('unbxd_searchcore')
224
+ ->getEngineConfigData(Unbxd_Recscore_Helper_Constants::FEATURE_FIELD_CATEGORY);
225
+ if(array_key_exists(Unbxd_Recscore_Helper_Constants::FEATURE_FIELD_CATEGORY, $fieldConfig)) {
226
+ return $fieldConfig[Unbxd_Recscore_Helper_Constants::FEATURE_FIELD_CATEGORY];
227
+ }
228
+ $this->rebuildConfigCache(Mage::app()->getWebsite());
229
+ $categoryField = $this->_getResource()->getFieldByFeatureField(Mage::app()->getWebsite()->getWebsiteId(),
230
+ Unbxd_Recscore_Helper_Constants::FEATURE_FIELD_CATEGORY);
231
+ return $categoryField;
232
+ }
233
+
234
+ public function setCategoryFieldName(Mage_Core_Model_Website $website)
235
+ {
236
+ $categortField = $this->getResource()->getFieldByFeatureField($website->getWebsiteId(),
237
+ Unbxd_Recscore_Helper_Constants::FEATURE_FIELD_CATEGORY);
238
+ Mage::helper('unbxd_recscore')->saveConfig($website,
239
+ array(Unbxd_Recscore_Helper_Constants::FEATURE_FIELD_CATEGORY => $categortField));
240
+ }
241
+
242
+ public function getBrandFieldName()
243
+ {
244
+ $fieldConfig =
245
+ Mage::helper('unbxd_searchcore')
246
+ ->getEngineConfigData(Unbxd_Recscore_Helper_Constants::FEATURE_FIELD_BRAND);
247
+ if(array_key_exists(Unbxd_Recscore_Helper_Constants::FEATURE_FIELD_BRAND, $fieldConfig)) {
248
+ return $fieldConfig[Unbxd_Recscore_Helper_Constants::FEATURE_FIELD_BRAND];
249
+ }
250
+ $this->rebuildConfigCache(Mage::app()->getWebsite());
251
+ $brandField = $this->_getResource()->getFieldByFeatureField(Mage::app()->getWebsite()->getWebsiteId(),
252
+ Unbxd_Recscore_Helper_Constants::FEATURE_FIELD_BRAND);
253
+ return $brandField;
254
+ }
255
+
256
+ public function setBrandFieldName(Mage_Core_Model_Website $website)
257
+ {
258
+ $brandField = $this->getResource()->getFieldByFeatureField($website->getWebsiteId(),
259
+ Unbxd_Recscore_Helper_Constants::FEATURE_FIELD_BRAND);
260
+ Mage::helper('unbxd_recscore')->saveConfig($website,
261
+ array(Unbxd_Recscore_Helper_Constants::FEATURE_FIELD_BRAND => $brandField));
262
+ }
263
+
264
+ public function getTitleFieldName()
265
+ {
266
+ $fieldConfig =
267
+ Mage::helper('unbxd_searchcore')
268
+ ->getEngineConfigData(Unbxd_Recscore_Helper_Constants::FEATURE_FIELD_TITLE);
269
+ if(array_key_exists(Unbxd_Recscore_Helper_Constants::FEATURE_FIELD_TITLE, $fieldConfig)) {
270
+ return $fieldConfig[Unbxd_Recscore_Helper_Constants::FEATURE_FIELD_TITLE];
271
+ }
272
+ $this->rebuildConfigCache(Mage::app()->getWebsite());
273
+ $titleField = $this->_getResource()->getFieldByFeatureField(Mage::app()->getWebsite()->getWebsiteId(),
274
+ Unbxd_Recscore_Helper_Constants::FEATURE_FIELD_TITLE);
275
+ return $titleField;
276
+ }
277
+
278
+ public function setTitleFieldName(Mage_Core_Model_Website $website)
279
+ {
280
+ $titleField = $this->getResource()->getFieldByFeatureField($website->getWebsiteId(),
281
+ Unbxd_Recscore_Helper_Constants::FEATURE_FIELD_TITLE);
282
+ Mage::helper('unbxd_recscore')->saveConfig($website,
283
+ array(Unbxd_Recscore_Helper_Constants::FEATURE_FIELD_TITLE => $titleField));
284
+ }
285
+
286
+ public function getImageFields($website)
287
+ {
288
+ $conf = Mage::helper('unbxd_recscore')->getEngineConfigData(Unbxd_Recscore_Helper_Constants::FIELD_CONF, $website, true);
289
+ $fieldConf = json_decode($conf[Unbxd_Recscore_Helper_Constants::FIELD_CONF], true);
290
+ if (!is_array($fieldConf)) {
291
+ return array();
292
+ }
293
+ $imageFields = array();
294
+ foreach ($fieldConf as $field => $conf) {
295
+ if (!is_array($conf) || !array_key_exists('image_full', $conf)) {
296
+ continue;
297
+ }
298
+ $imageFields[$field] = Mage::helper('unbxd_recscore')->isConfigTrue($website, 'image_full') ? true : false;
299
+ }
300
+ return $imageFields;
301
+ }
302
+
303
+ public function getCopyFields($website)
304
+ {
305
+ $conf = Mage::helper('unbxd_recscore')->getEngineConfigData(Unbxd_Recscore_Helper_Constants::FIELD_CONF, $website, true);
306
 
 
 
307
  $fieldConf = json_decode($conf[Unbxd_Recscore_Helper_Constants::FIELD_CONF], true);
308
+ if (!is_array($fieldConf)) {
309
+ return array();
310
+ }
311
+ $imageFields = array();
312
+ foreach ($fieldConf as $field => $conf) {
313
+ if (!is_array($conf) || !array_key_exists('copy_field', $conf)) {
314
+ continue;
315
+ }
316
+ $imageFields[$field] = $conf['copy_field'];
317
  }
318
+ return $imageFields;
319
+ }
320
+
321
+ public function validateDatatype($unbxdDatatype, $magentoDatatype)
322
+ {
323
+ if ($unbxdDatatype == Unbxd_Recscore_Helper_Constants::UNBXD_DATATYPE_TEXT || $unbxdDatatype == Unbxd_Recscore_Helper_Constants::UNBXD_DATATYPE_LONGTEXT ||
324
+ $unbxdDatatype == Unbxd_Recscore_Helper_Constants::UNBXD_DATATYPE_LINK
325
+ ) {
326
+ return true;
327
+ }
328
+ if ($unbxdDatatype == Unbxd_Recscore_Helper_Constants::UNBXD_DATATYPE_NUMBER && $magentoDatatype == Unbxd_Recscore_Helper_Constants::FIELD_TYPE_NUMBER) {
329
+ return true;
330
+ }
331
+ if ($unbxdDatatype == Unbxd_Recscore_Helper_Constants::UNBXD_DATATYPE_DECIMAL && $magentoDatatype == Unbxd_Recscore_Helper_Constants::FIELD_TYPE_NUMBER) {
332
+ return true;
333
+ }
334
+ if ($unbxdDatatype == Unbxd_Recscore_Helper_Constants::UNBXD_DATATYPE_DATE && $magentoDatatype == Unbxd_Recscore_Helper_Constants::FIELD_TYPE_DATE) {
335
+ return true;
336
+ }
337
+ return false;
338
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
339
  }
340
 
341
  ?>
app/code/local/Unbxd/Recscore/Model/Observer.php CHANGED
@@ -154,5 +154,9 @@ class Unbxd_Recscore_Model_Observer {
154
  Mage::getSingleton('unbxd_recscore/sync')->addProduct($_item);
155
  return $this;
156
  }
 
 
 
 
157
  }
158
  ?>
154
  Mage::getSingleton('unbxd_recscore/sync')->addProduct($_item);
155
  return $this;
156
  }
157
+
158
+ public function saleOrderCancel(Varien_Event_Observer $observer) {
159
+
160
+ }
161
  }
162
  ?>
app/code/local/Unbxd/Recscore/Model/Resource/Product/Collection.php CHANGED
@@ -12,7 +12,7 @@ class Unbxd_Recscore_Model_Resource_Product_Collection extends
12
  return false;
13
  }
14
 
15
- /**
16
  * Join Product Price Table | Ensuring left join happens
17
  *
18
  * @return Mage_Catalog_Model_Resource_Product_Collection
@@ -80,7 +80,7 @@ class Unbxd_Recscore_Model_Resource_Product_Collection extends
80
  protected function _addBasicFilterToUpload(Mage_Core_Model_Website $website)
81
  {
82
  $adapter = Mage::getSingleton("core/resource");
83
- $visiblityCondition = array('in' => array(2,3,4));
84
  $_catalogInventoryTable = method_exists($adapter, 'getTableName')
85
  ? $adapter->getTableName('cataloginventory_stock_item') : 'catalog_category_product_index';
86
 
@@ -94,7 +94,7 @@ class Unbxd_Recscore_Model_Resource_Product_Collection extends
94
 
95
  if (!Mage::helper('unbxd_recscore')
96
  ->isConfigTrue($website, Unbxd_Recscore_Helper_Constants::INCLUDE_OUT_OF_STOCK)) {
97
- Mage::getModel('cataloginventory/stock_status')->addStockStatusToProducts($this);
98
  }
99
 
100
  Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($this);
@@ -111,7 +111,6 @@ class Unbxd_Recscore_Model_Resource_Product_Collection extends
111
  $this->_addBasicFilterToUpload($website);
112
  return $this;
113
  }
114
-
115
  }
116
 
117
  ?>
12
  return false;
13
  }
14
 
15
+ /**
16
  * Join Product Price Table | Ensuring left join happens
17
  *
18
  * @return Mage_Catalog_Model_Resource_Product_Collection
80
  protected function _addBasicFilterToUpload(Mage_Core_Model_Website $website)
81
  {
82
  $adapter = Mage::getSingleton("core/resource");
83
+ $visiblityCondition = array('in' => array(2,3,4));
84
  $_catalogInventoryTable = method_exists($adapter, 'getTableName')
85
  ? $adapter->getTableName('cataloginventory_stock_item') : 'catalog_category_product_index';
86
 
94
 
95
  if (!Mage::helper('unbxd_recscore')
96
  ->isConfigTrue($website, Unbxd_Recscore_Helper_Constants::INCLUDE_OUT_OF_STOCK)) {
97
+ Mage::getSingleton('cataloginventory/stock')->addInStockFilterToCollection($this);
98
  }
99
 
100
  Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($this);
111
  $this->_addBasicFilterToUpload($website);
112
  return $this;
113
  }
 
114
  }
115
 
116
  ?>
app/code/local/Unbxd/Recscore/controllers/CatalogController.php CHANGED
@@ -81,4 +81,41 @@ class Unbxd_Recscore_CatalogController extends Mage_Core_Controller_Front_Action
81
  'errors' => array('message' => 'Invalid method'))));
82
  }
83
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
84
  }
81
  'errors' => array('message' => 'Invalid method'))));
82
  }
83
  }
84
+
85
+ /**
86
+ * Method to get the products in bunches
87
+ * @void
88
+ */
89
+ public function productsAction(){
90
+ $website = $this->_prepare();
91
+ if (is_null($website)) {
92
+ return;
93
+ }
94
+ ignore_user_abort(true);
95
+ set_time_limit(0);
96
+ $page = $this->getRequest()->getParam('start', 0);
97
+ $limit = $this->getRequest()->getParam('limit', 500);
98
+ $isFullUpload = true;
99
+ $feedMgr = Mage::getSingleton('unbxd_recscore/feed_feedmanager');
100
+ if(array_key_exists('incremental', $_REQUEST)) {
101
+ $isFullUpload = false;
102
+ }
103
+
104
+ $response = $feedMgr->getProducts($website, $page, $limit);
105
+ $this->getResponse()->setBody($response);
106
+ return;
107
+ }
108
+
109
+ public function sizeAction()
110
+ {
111
+ $website = $this->_prepare();
112
+ if (is_null($website)) {
113
+ return;
114
+ }
115
+ $feedMgr = Mage::getSingleton('unbxd_recscore/feed_feedmanager');
116
+ $size = $feedMgr->getSize($website);
117
+ $response = json_encode(array('size'=> $size));
118
+ $this->getResponse()->setBody($response);
119
+ return;
120
+ }
121
  }
app/code/local/Unbxd/Recscore/etc/config.xml CHANGED
@@ -1,7 +1,7 @@
1
  <config>
2
  <modules>
3
  <Unbxd_Recscore>
4
- <version>1.0.19</version>
5
  </Unbxd_Recscore>
6
  </modules>
7
  <admin>
1
  <config>
2
  <modules>
3
  <Unbxd_Recscore>
4
+ <version>1.0.20</version>
5
  </Unbxd_Recscore>
6
  </modules>
7
  <admin>
app/code/local/Unbxd/Recscore/sql/unbxd_recscore_setup/mysql4-install-1.0.0.php CHANGED
@@ -82,6 +82,7 @@ VALUES
82
  ({$websiteId}, 'categoryIds', 'longText', 0, NULL, 1, 0),
83
  ({$websiteId}, 'category', 'text', 0, 'category', 1, 0),
84
  ({$websiteId}, 'uniqueId', 'longText', 0, NULL, 0, 0),
 
85
  ({$websiteId}, 'entity_id', 'longText', 0, NULL, 0, 0)
86
  ON DUPLICATE KEY UPDATE `field_name`=`field_name`;";
87
  $installer->run($insertQuery);
82
  ({$websiteId}, 'categoryIds', 'longText', 0, NULL, 1, 0),
83
  ({$websiteId}, 'category', 'text', 0, 'category', 1, 0),
84
  ({$websiteId}, 'uniqueId', 'longText', 0, NULL, 0, 0),
85
+ ({$websiteId}, 'type_id', 'longText', 0, NULL, 0, 0),
86
  ({$websiteId}, 'entity_id', 'longText', 0, NULL, 0, 0)
87
  ON DUPLICATE KEY UPDATE `field_name`=`field_name`;";
88
  $installer->run($insertQuery);
app/design/frontend/base/default/template/unbxd/recscore/tracker.phtml CHANGED
@@ -37,6 +37,7 @@ if(typeof UnbxdWidgetsConf == 'undefined' || UnbxdWidgetsConf == null) {
37
  (function(){
38
  if(typeof Unbxd === 'undefined')
39
  Unbxd = {};
 
40
  Unbxd.getBaseUrl = function(){
41
  return "<?php echo Mage::getBaseUrl(); ?>";
42
  }
37
  (function(){
38
  if(typeof Unbxd === 'undefined')
39
  Unbxd = {};
40
+
41
  Unbxd.getBaseUrl = function(){
42
  return "<?php echo Mage::getBaseUrl(); ?>";
43
  }
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>unbxd_recommendation</name>
4
- <version>1.0.19</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
@@ -10,9 +10,9 @@
10
  <description>recommendation module</description>
11
  <notes>Unbxd Recommendation</notes>
12
  <authors><author><name>ananthesh</name><user>ananthesh</user><email>ananthesh@unbxd.com</email></author><author><name>praveen</name><user>praveen</user><email>praveen@unbxd.com</email></author></authors>
13
- <date>2015-04-20</date>
14
- <time>15:40:33</time>
15
- <contents><target name="magelocal"><dir name="Unbxd"><dir name="Recscore"><dir name="Helper"><file name="Analyticshelper.php" hash="542b918b05b6c87db3023fc572c1d7c1"/><file name="Confighelper.php" hash="6adab52f595a5eb9bf90f2d3d0458a05"/><file name="Constants.php" hash="d29695379df5144e1e25daaefa80195d"/><file name="Data.php" hash="e751a36a214ee58ec38ecc1067c2c3e9"/><file name="Feedhelper.php" hash="d5efc95a27b3ceda50b472a47247fa76"/></dir><dir name="Model"><dir name="Api"><file name="Request.php" hash="676864d597e13b12d31a6cd6282cff54"/><file name="Response.php" hash="c439b162f3160d7716d85605d740cf88"/><dir name="Task"><file name="Analyticsimpression.php" hash="8930d9e47f705ffa940ac07e31c02636"/><file name="Autosuggestindex.php" hash="00974e65f6c3c1756f5910f7fe5c3a00"/><file name="Feeddetails.php" hash="cda43137d4a235b0932f76aecde5828d"/><file name="Searchimpression.php" hash="43637475a8a573b2520a98e9679a4dd7"/><file name="Searchsetup.php" hash="fd8ce5aae3bc3c438a86daf72b149f5d"/><file name="Supportmail.php" hash="6f7296d6734173bc1f1d5083b35fc480"/><file name="Trackcart.php" hash="39af0962835e296428a1d302c163d7b2"/><file name="Trackorder.php" hash="018d609541ae41f3dd253c58b9ce88fb"/><file name="Triggerfeedupload.php" hash="326315ae8b3c212c685c11a8c9cbbcef"/><file name="Updatefeaturefields.php" hash="61dfda139f10fadad1e8a20939718da0"/><file name="Validatekeys.php" hash="d52331bcdfa0dfc35d9f99e32b4cefc7"/></dir><file name="Task.php" hash="2c2fd0997bc9880b2a323ee6eb5844d3"/></dir><file name="Auth.php" hash="73d2cc68b49fe6157554477439cd7d74"/><file name="Config.php" hash="543e4c8a0964fd349c346e136569a5f7"/><dir name="Feed"><file name="Feedcreator.php" hash="d808a88d14407d2a5df2ddd5af3fbf74"/><file name="Feedmanager.php" hash="2ead0f80ec03e1c5c7ddbfe97244cf49"/><file name="Filemanager.php" hash="59518b8d93fdcde900fd0f2ee9214546"/><dir name="Jsonbuilder"><file name="Jsonbuilder.php" hash="99fc05491593875c66b0521b2321ecd0"/><file name="Productbuilder.php" hash="dd4018df88da3490f3402175cf87868d"/><file name="Schemabuilder.php" hash="8a379b9bc7c4659305ab3b5d1de1df2e"/><file name="Taxonomybuilder.php" hash="ad5d295eb7bce69b091cd5301083430d"/></dir><file name="Tags.php" hash="0ecc841c3789a04fe55051bb3078a555"/></dir><file name="Field.php" hash="61ba0edc9863e1835864c34e563aa71c"/><file name="Observer.php" hash="4bc9c9391090e2887a38cb36291b6a7c"/><dir name="Resource"><file name="Attribute.php" hash="f6de7ea7abb828ef1fb6a6dfcbd69840"/><dir name="Config"><file name="Collection.php" hash="38112097263b29f67c4358af1e123972"/></dir><file name="Config.php" hash="92d3fcff7df0285c788dceb28f51912a"/><dir name="Field"><file name="Collection.php" hash="411a7c8be674d58e9b779af9a927999f"/></dir><file name="Field.php" hash="a666ab6d8f47a8777a3b8bbea455a22c"/><dir name="Product"><file name="Collection.php" hash="818612ca5f0d75852a84e870cbfe8e07"/></dir><dir name="Sync"><file name="Collection.php" hash="4a2391d2b27b5b1e6050f37fb995d668"/></dir><file name="Sync.php" hash="03eff6cbdb28353b653c02d4aa88d932"/></dir><dir name="State"><file name="Analytics.php" hash="83954d983dd817054345987bc7f32da3"/><file name="Catalog.php" hash="a4f3a96ceb0fa963e73bcbf6bd83ca60"/><file name="Credentials.php" hash="23b0dd01df50a8b661d28b4ba2bd4437"/><file name="Response.php" hash="deef3350e040a2b91c8e80d83646d30f"/></dir><file name="State.php" hash="3b52977417f686a34d6b161447c0b87f"/><file name="Statemgr.php" hash="02007603f045cac1958066761f3622a6"/><file name="Sync.php" hash="215f637e29a358fcaf44235f041d101b"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="IndexController.php" hash="2373a8ecea10134a3d683321c281c571"/></dir><file name="CatalogController.php" hash="f76ce6821a9bf2fab01ae3e5555c508d"/><file name="ConfigController.php" hash="7c51f060e0d14f3b19026bde760dba99"/></dir><dir name="etc"><file name="adminhtml.xml" hash="0f588fe72cddfafc7b46b3ff58a0a940"/><file name="config.xml" hash="62b11718eab5bb0cc191c03c1806d10b"/></dir><dir name="sql"><dir name="unbxd_recscore_setup"><file name="mysql4-install-1.0.0.php" hash="5953cbbc0097b4d68fa4b030606295de"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Unbxd_Recommendation.xml" hash="58c2a5d99d2eb3a779fd0e953a4fd6c3"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="unbxd"><file name="recscore.xml" hash="b426e9786d866cca461dce509cca2e6e"/></dir></dir><dir name="template"><dir name="unbxd"><dir name="recscore"><file name="tracker.phtml" hash="de7621954871b4010327374268259ce8"/><dir name="tracking"><file name="product.phtml" hash="a1ad56a8eb7e53e7ed483324d3f15a70"/></dir></dir></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><dir name="unbxd"><file name="recscore.xml" hash="007a71be9c73216557423017f9b22e88"/></dir></dir><dir name="template"><dir name="unbxd"><file name="recommendation.phtml" hash="903df82526c4b8569de80c96c818aad8"/></dir></dir></dir></dir></dir></target><target name="mageweb"><dir name="js"><dir name="unbxd"><dir name="recscore"><file name="app.js" hash="5790870aa32c641bbad8d064fd41b610"/><file name="embed.js" hash="ae0665e583a2579a2609f27f07f36551"/><file name="jquery.js" hash="52d16e147b5346147d0f3269cd4d0f80"/><file name="unbxdAnalytics.js" hash="98738dccf6a9e9378e79ca6931d9d3c1"/></dir></dir></dir><dir name="skin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="unbxd"><dir name="recscore"><dir><dir name="css"><file name="app.css" hash="b2e6cac84e88747ed286e719d1a45e99"/><file name="app1.css" hash="d0b0f148bdf44d46bcee3e4ae4668cb6"/><file name="bootstrap-switch.css" hash="b97cfbfa50ef0ef787261b5f925e506a"/><file name="bootstrap-them.css" hash="df854606e8bfb38abe58305c389301ae"/><file name="bootstrap.css" hash="92a3eb9b3fb1137b16bf8dca5907ffd6"/><file name="chosen.css" hash="2329f7f776c2b97a80a134c34c9eebd5"/><file name="colpick.css" hash="84eb0f762c33ede63bb4ed417b011a9d"/><file name="magento-app.css" hash="33b7d3e29d3906d21e882f8706ff7c7c"/><file name="unbxd-magento.css" hash="27657f8446948753277dad346325c4a3"/></dir><dir name="img"><file name="Custom-platform.png" hash="5290665e9ca24170ed6b4923bd635377"/><file name="DONE.png" hash="82ea09757c6f6ba582b2089a166686ec"/><file name="HEXAGON-Only.png" hash="cc44d0bcef0cbc24e00d08e3a76552c5"/><file name="Magento-small.png" hash="7a528e2dd969bec618acd410ae660727"/><file name="Magento.png" hash="a1006f3044d6cfe6dd6f4e982344ab4f"/><file name="Powered_by_unbxd copy.png" hash="b29f1ac74821c62af18ef2dea3a22265"/><file name="X-popup-hover.png" hash="f74653bfca79cbc1c262752b5f44d4c3"/><file name="X-popup.png" hash="63c9f5c8256e8ecfe76db8ddb8d9aaa0"/><file name="X-pricing.png" hash="979c2c9456732a8935d8e77f502de58e"/><file name="active.png" hash="ce09792133584f533c7a0a2227ff05c9"/><file name="add-actv.png" hash="f990f99e6c3bc5819087e02621e71a2d"/><file name="add-icon.png" hash="7add622ec65c42898fab1fb5e2e64533"/><file name="add-inactv.png" hash="9fb163e67fc1271534dbede05bd75d31"/><file name="add-raw-hover.png" hash="4a44e58502e00e8d73fc00b7988e8621"/><file name="add-raw.png" hash="442cc58d8176e0b580f409df4f18c89e"/><file name="add-rule.png" hash="de395f293ed3bd1f5e3e79ee80e0296e"/><file name="add.png" hash="317559b8877b4ab171c92e253fbae814"/><file name="api_int_info.png" hash="62efde0dc39f78b8d36ac140e4922fa8"/><file name="arrow-2.png" hash="6eb510a6c6753812d1c0b7ad3792c68d"/><file name="arrow-calendar-down.png" hash="cfcc798220b0655588b1ebc92bb2cd9e"/><file name="arrow-calendar-down1.png" hash="e1d78aa977aefd3dbd0d077265465a53"/><file name="arrow-down-disabled.jpg" hash="728761548b495cac219d9497f8d6bc88"/><file name="arrow-down-enabled.jpg" hash="79bf179fb24de528068cc34e0112bc5d"/><file name="arrow-down-white.jpg" hash="556e356570a1e9ed97b13fcbd028997e"/><file name="arrow-down-white1.jpg" hash="c1b42e8d9d6c79265085d0c297e215c0"/><file name="arrow-down-white2.jpg" hash="c1b42e8d9d6c79265085d0c297e215c0"/><file name="arrow-down.png" hash="13794ac6416e435d6b2fa0b54f48b488"/><file name="arrow-gray.png" hash="ef922786b71b9e8c7206dc3a3e55ec30"/><file name="arrow-inactive.png" hash="ea8df964b3bb238c34e2a92ac3819b1b"/><file name="arrow-left-inactive.png" hash="02dceab03c4629eda64caa32f76dd21f"/><file name="arrow-left-white.jpg" hash="99c322cfc458b3d9545335084263f7c0"/><file name="arrow-left.jpg" hash="d9c30f6cd57f2cdd382a1bcdbfa38507"/><file name="arrow-left.png" hash="2259b06fca6ea640c26d2208afd02fb5"/><file name="arrow-mail-developer).png" hash="6dd3f45435f140731481878b80a54e59"/><file name="arrow-right-blue.png" hash="33ad361548417c181dfbc05a7fbb78a9"/><file name="arrow-right-gray.jpg" hash="829ba35fb3b3598fcab2dd03dfd8bcaa"/><file name="arrow-right-inactive.png" hash="a8adf91679f6fcc1fcbbfebd87212bf7"/><file name="arrow-right-white.jpg" hash="fafacf3d7bc94986a26024565621b509"/><file name="arrow-right.jpg" hash="96af89ff4e0ebf1134361573b6a431b3"/><file name="arrow-right.png" hash="055276cac55edeb3eb4281f15a7ee404"/><file name="arrow-up-black.png" hash="668b1a36fb27af19739b0de2ee804bfc"/><file name="arrow-up-disabled.jpg" hash="d15535c2924f1e9ae570da0fc61d2e14"/><file name="arrow-up-enabled.jpg" hash="820c6e3175bf1774077cbf2ef0f00a5a"/><file name="arrow-up-red.png" hash="9e4fa614690acba2402e8fb774c1760a"/><file name="arrow-up-white.jpg" hash="6f4804c59bdfd728095e0d2c86c486e4"/><file name="arrow-up-white1.jpg" hash="017b0d2695a4d6b9534cae7af5883464"/><file name="arrow-up.png" hash="b4380ef5bdaad86d2eddeb69bfc51e5c"/><file name="arrow-white.png" hash="a62374550e967153b2f5f6c782770175"/><file name="arrow.png" hash="2dfdf0abf10326d73b8c39bd3f6da413"/><file name="arrow_grey.png" hash="9a4fc1c1022f8ecfeadf8e25da0f8240"/><file name="arrow_white.png" hash="794ff95721a9586ae3b9290a4a53ebbe"/><file name="authenticated.png" hash="9eac2025c82fcf60c822d7d4690ca98c"/><file name="back.png" hash="72f60077f20dc52553e069f641b42099"/><file name="bg.jpg" hash="4a2f6fda25f44f7009e9a22ccf90e330"/><file name="big-arrow-gray.jpg" hash="efb30594788c366bf9b007945b197071"/><file name="bigcommerce.png" hash="bb6801e63d1198f8ec1458e69d9d4eff"/><file name="black-right-small.jpg" hash="699a5af08c69fd5c3b57aaa9fed7cfaa"/><file name="black-right-thick.jpg" hash="707c1a0806947351564de4391e9ef885"/><file name="blue-selected.png" hash="e4246debbabc085b10572bd5aa4b0982"/><file name="breadcrumb_arrow.png" hash="631196f2801711df3ff31557c8287290"/><file name="btn-arrow-top.png" hash="75d77e80995b2b3b42043db3fe7e152b"/><file name="btn-arrow.png" hash="ee2543a2011a57b2b58db30cf62d0219"/><file name="button-arrow-blue.png" hash="b82160ad78e789b5702c7eb9a2dd3c7b"/><file name="button-arrow-grey.png" hash="cb339368b9409741e28dc31f6400f5f0"/><file name="button-arrow-red.png" hash="499819820395cfbcf03318107049a634"/><file name="cancel.png" hash="dea3ab86b5f6980886b8148b6dbc0804"/><file name="card-image.jpg" hash="543c66027f8d3718ab2f6930454c5324"/><file name="card-image1.jpg" hash="6469c85cb7133c89c514b5d932ec61d3"/><file name="card-image2.jpg" hash="816ceb38837684da077e08132d95aa08"/><file name="card-image3.jpg" hash="b65e704ae1cd2e88da5237e5e72e8ca8"/><file name="checkmark.png" hash="76c700530ee10b42763c1df6f85279b1"/><file name="chosen-sprite.png" hash="25b9acb1b504c95c6b95c33986b7317e"/><file name="close-analytics.png" hash="421ee870c5e070a6a03819eb2716fd1f"/><file name="close-round.png" hash="adafdcb7fde56b8af0e9b843ff7e19bb"/><file name="close.png" hash="fe130e3473e31d6f73127fed8d693539"/><file name="color-pic-black.png" hash="b9c18ff6fab0fc8bd1112b13a94d2477"/><file name="color-pic.png" hash="5ac6b53fdd57080a2df5a171bdb03aae"/><file name="congrats-magento.png" hash="2c02d7b82e1c5a8e2491f7892929b0fd"/><file name="congrats.png" hash="2c02d7b82e1c5a8e2491f7892929b0fd"/><file name="copy-black.png" hash="11abed4721d04c70531356777e828e0f"/><file name="copy-white.png" hash="6f188394d6619b61b51a7ede4c29ec0e"/><file name="cros.png" hash="25dee21cf8d50963fa3cf9300d0b93c0"/><file name="cross-2.png" hash="027fa6cdc450c378984376924003ca88"/><file name="custom-color-selected.png" hash="41b299f7d3d6964b45ced6c0b2209bfe"/><file name="custom-color.png" hash="4638d52f8ae7c8db0463500abeda4126"/><file name="custom-temp-1.png" hash="1e74a0ab64f7bce768e864a8ac43c1b8"/><file name="custom-temp-2.png" hash="456b7998744c5b272bc05f981ab79d73"/><file name="custom-temp-3.png" hash="3606aede791d32c3c9481d5bbc82847e"/><file name="custom-temp-4.png" hash="89d45791dfff0ca4f1ad94a4b1ec2661"/><file name="cvv-number.jpg" hash="3c3e97a31a009afcd3c26f7529db5cf1"/><file name="delete-raw-hover.png" hash="7bd9eeb7059b5946e2686415797417c7"/><file name="delete-raw.png" hash="43a13c96e2a261c309c151eb4ef975fc"/><file name="delete-red.png" hash="73386fe1e477b0a30c2ab9f9f11df94b"/><file name="delete.png" hash="55019546183a6d4bf7fce6ecc6a00b36"/><file name="detect.png" hash="b74ba51e28f7a15e8214c18cbdd4e407"/><file name="dot-border.png" hash="208feb3ba398f27536213749e1e621a3"/><file name="down-arrow.png" hash="25ce0545a9cc87f1d9e1b7b80be93876"/><file name="down-black.png" hash="d99de4c90283294c30f1670cf1a52f40"/><file name="down-gray.png" hash="3a75b2ef9452e1e3dd8e06ffab68456b"/><file name="drop-down.png" hash="3674841edf7320d3d84c708f50df1741"/><file name="dropdown-arrow.png" hash="e78ccea5d0bda5dbebcd5bbee4b93f64"/><file name="edit-magento.png" hash="efa37bbf88091ce8d7b68e8115d1fdde"/><file name="edit.png" hash="15f83e074edf79a9da13fbe74f47dfbd"/><file name="eye-hover.png" hash="b52a441b87c99d5cda61125669b33724"/><file name="eye.png" hash="8b7a3637232dad5710a8b36f69e2ad5d"/><file name="favicon.png" hash="1e52374b5ed35864d8fa9f15e2cd30c2"/><file name="fill.png" hash="ae2fd7902f99b1efc9531b006cdca186"/><file name="green-selected.png" hash="ef1ab5c6209c8e5293b2ce4867fd023d"/><file name="grey-selected.png" hash="b6a83c93171b89a6f7f466aa47ac4717"/><file name="group-arrow.png" hash="579edf9c51115a4c74061af86620edb7"/><file name="help.png" hash="4ef8bda62d42054e27218cfcd958c577"/><file name="icon-analytics.png" hash="c4b7b57118d1c912207ac8d34e3e6d5f"/><file name="icon-info.png" hash="cfa3beb50e89263c2da97d40f64da177"/><file name="icon-widget.png" hash="89fbad7748cb956a65896ddeda18a57c"/><file name="info-icon-big.png" hash="8b881f8b5950131b96f337247fe59b4f"/><file name="info-small.png" hash="a47a6287c9af33f42cd78762c9d5862f"/><file name="install.png" hash="6b378698d96ab32f89efc23fc24333da"/><file name="integration-gray.png" hash="e1428587806c6e90872cb8e325e1bb0f"/><file name="introduction-gray.png" hash="003c564c948c374ade90bfcef89088e9"/><file name="left-black.png" hash="ac4d88a6ddfefcdf75dcef4384bdf90e"/><file name="left-gray.png" hash="b229e9f7144f1d80f73f1dac6f689401"/><file name="level-arrow-active.png" hash="8905e738238c090bed0c259266159374"/><file name="level-arrow.png" hash="9a4fc1c1022f8ecfeadf8e25da0f8240"/><file name="link-arrow.png" hash="61fb4c9e922c3c6427fea1484eab2474"/><file name="list_bullet.png" hash="a6dda6a7e38ced1ea368d2265434e53f"/><file name="loader-16x16.gif" hash="778e6b9e73274330dae0dab8104948a0"/><file name="loader-24x24.gif" hash="e403534956d055d636b3a5fa813b82b7"/><file name="loader-32x32.gif" hash="510f6441c74b9f098ea99cc11d0c4e89"/><file name="loader.gif" hash="fd1345456c4a685afb42b67c25354ca2"/><file name="loader_black.gif" hash="5bfd8de3193a5fc2e5b472f57df1408f"/><file name="lock-image.jpg" hash="6081155d7fcbb5d8c4d34a344f0bbd97"/><file name="logo-unbxd.png" hash="82024b1f5e10ac130489103e8bf08d2b"/><file name="logo.png" hash="1c0087551ac1c41493868b5d409b7dda"/><file name="mail-box.png" hash="25dae3efa5200ee176dd0aa825fa1d5b"/><file name="mail-id-sprite.png" hash="3a06a0e11e74c7a66f7f0f1aae082fcf"/><file name="mail-new.png" hash="8a3fe01ecd87ea7e93b239f2add8a52a"/><file name="mail.png" hash="f1a1039b5ebdc17cb40b2d79ca3937e9"/><file name="minus.jpg" hash="0fd79f174562ffa46348b445c85c930c"/><file name="minus.png" hash="bc691a8f2761f1d1c4a379f665d03480"/><file name="nav-highlight-arrow.png" hash="9806317c711b22c08a6247960c10fb26"/><file name="not-detected.png" hash="2e63b320f3f8a6c004c71bc1b02c1473"/><file name="oops.png" hash="03eca8b24324df38fd4c734843a2abbb"/><file name="or.png" hash="e6e8b2d42f8dedf2078e3d9f38e6070d"/><file name="orange-selected.png" hash="296963f455ad925de437581fa07be306"/><file name="orange.png" hash="2e2089e5c3e867f00728cf2cf2de3811"/><file name="other-gray.png" hash="58f19f3578f063ff1ccd8b8ef2890195"/><file name="overview-gray.png" hash="0c3501dd6469f90a61a8367a3bdc3340"/><file name="plus.png" hash="2cbfab4d57d7083650b5bbf8be7ee84c"/><file name="preview.png" hash="d56d8e0b3eb221a714ed0e2474ed38ac"/><file name="question-mark2.jpg" hash="50392a77ea59fc9c1e4709834cc7ae2d"/><file name="red-cross.png" hash="368e01e53564574eea66c850829a243f"/><file name="red-loading.gif" hash="510327b63304d4c58bb9445c7343498f"/><file name="remove.png" hash="aea65d50ad060b90e8f7e76624f20c4b"/><file name="right-black.png" hash="cdc63a865ca9717d3d315fc3bcbc64ca"/><file name="right-gray.png" hash="cc72c1c3416e2ce5750e4db92de093fd"/><file name="rules.png" hash="004dced224b5250f4f033cffb44cca14"/><file name="save.png" hash="20eb685cc7a58ea1ea2065a8c2d10e81"/><file name="saved.png" hash="df9ab88cb96c3de503816171f35b1254"/><file name="search.png" hash="5acdafa5337d7702948a4015eeb8f0f6"/><file name="settings.png" hash="36fc3060fa0d0e5bb2e3dd57c51b1edf"/><file name="shopify.png" hash="ff1163b008f933c7e71cd5a4d77de878"/><file name="site-dropdownarrow-down.png" hash="e83075515419fa29658df010a6982023"/><file name="site-dropdownarrow-up.png" hash="fbd66dc69e51085161a2e28c519e2dc8"/><file name="skin1-trans.png" hash="0264c245ba712d19d5b0d308e71e77b4"/><file name="skin1.png" hash="2e2089e5c3e867f00728cf2cf2de3811"/><file name="skin2.png" hash="fe5935399ab1a8d78ecaebaba6c7d176"/><file name="skin3.png" hash="9bfccdd71c71d7f03b5f2fe1cd394118"/><file name="skin4.png" hash="1002cadb9ce2bdaea9e820d0f324113d"/><file name="slider-bg.png" hash="0f310e78f27110b13cf699ed7d4b97e4"/><file name="slider-button.png" hash="4b8c133577ba9022b97ac82420e88166"/><file name="sort-arrow-blue-down.png" hash="22fab361e19b80e12b1279921f123656"/><file name="sort-arrow-blue-up.png" hash="7731f17d465b7dd6cde7eafebe2248b7"/><file name="sort-arrow-grey-down.png" hash="82cfe186b77d97dd0d961303bd53ad40"/><file name="sort-arrow-grey-up.png" hash="dbd67d69cb4ddab64cf9bed760251adb"/><file name="spinner_down.png" hash="afdbf1537511400bc1278cf761cedb12"/><file name="spinner_up.png" hash="f1032905f72b96eb8ee8f5ddb995e559"/><file name="spree.png" hash="d30a2489564230c317f9c873277567e9"/><file name="start-gray.png" hash="b6425ce659a1da4316a144a5a66b72bd"/><file name="step-arrow.png" hash="1bb6bed612dd45b5e49b2a70a952a7a7"/><file name="success-icon-big.png" hash="9d4e0c51400d6039220a5301797e01a1"/><file name="success.png" hash="74d3fa654373b5c128699c80cf218053"/><file name="temp-1-blue.png" hash="e62450283d4e38467c6920a8474c139d"/><file name="temp-1-green.png" hash="ba66a0aa6cae5edf940ceddb51c11f12"/><file name="temp-1-grey.png" hash="a2736bce441ee5b0a98cc7090b31918d"/><file name="temp-1-orange.png" hash="ab3c96985183414aec3d5affe33094fe"/><file name="temp-1-preview-blue.png" hash="eb3d6e4fe3473d6a69239c6e6da815ea"/><file name="temp-1-preview-green.png" hash="4f126d02eae9679d88a1e411319c5d4c"/><file name="temp-1-preview-grey.png" hash="ef8c62f98c94b550c488650aa2a1bbbf"/><file name="temp-1-preview-orange.png" hash="1aa2170d326403a87f119341622503d3"/><file name="temp-1.png" hash="e5c1f8718fec6d570a2eef8110b1da3c"/><file name="temp-2-blue.png" hash="35c176f6bfb28e7f603dae4e08ab2b08"/><file name="temp-2-green.png" hash="d9c9f88f66cb0e96f67384ed46e164b2"/><file name="temp-2-grey.png" hash="97e1c2d6b09ae812891768193825c24c"/><file name="temp-2-orange.png" hash="bd5c1d83b734cc78f3d6684ea39cdbb2"/><file name="temp-2-preview-blue.png" hash="65b394b1b7ba85c8f6557b56a01956f0"/><file name="temp-2-preview-green.png" hash="2ffeb59926e5d02d618b1e27c6ec8f3f"/><file name="temp-2-preview-grey.png" hash="0b5a3c138cbf5d7aa6d6c2f2fd546a12"/><file name="temp-2-preview-orange.png" hash="899dc8507574ce64382757b32ae2e534"/><file name="temp-2.png" hash="35ee735575579755f23b9be31eac64d6"/><file name="temp-3-blue.png" hash="3f33a385a0588c159459640ba50a6e68"/><file name="temp-3-green.png" hash="8fa49ff3af61230af4352a5c30b62a9f"/><file name="temp-3-grey.png" hash="a98c1d46adf4d091c1ee0b8e4affef60"/><file name="temp-3-orange.png" hash="7bca6c527be688c8609ff21b8f2a1d74"/><file name="temp-3-preview-blue.png" hash="636b0e1eeef3577338cdcfb735c99e15"/><file name="temp-3-preview-green.png" hash="ebc8bae1360c48fe346292840f954021"/><file name="temp-3-preview-grey.png" hash="5684634e2988a5b25a02de8d48644db6"/><file name="temp-3-preview-orange.png" hash="d788a099b7af1328a716639391469213"/><file name="temp-3.png" hash="9b6c874b939adff6f507d1f2754fc2c9"/><file name="temp-4-blue.png" hash="a97c6420edeb9d0e95bb8a67770af70c"/><file name="temp-4-green.png" hash="02f1e2f9b2541ba27ae9562dc4d7401d"/><file name="temp-4-grey.png" hash="8644e3016a22f011c2637deca0a0ac17"/><file name="temp-4-orange.png" hash="8649ad362dd918cb43a85feea9963daf"/><file name="temp-4-preview-blue.png" hash="6578e5606be7e7cda9c3a6a5c0e545b9"/><file name="temp-4-preview-green.png" hash="fb264203a4541ccd74f03b29a9142da4"/><file name="temp-4-preview-grey.png" hash="f26ffe3252713190c6a795e11b816cf2"/><file name="temp-4-preview-orange.png" hash="d1fc0e64b8c50c63b46ebff25665d330"/><file name="temp-5-blue.png" hash="e8656a96324a6bcdf8929e01591f7503"/><file name="temp-5-green.png" hash="040ea3f18c03189cff35e0583d5b6c04"/><file name="temp-5-orange.png" hash="f1a011d6401615da7624d610eb4d92f5"/><file name="temp-5-preview-blue.png" hash="beb849914a4a0338c2186bd61cc5e928"/><file name="temp-5-preview-gray.png" hash="bf0af858702b7d5af7d90b4ad7d424a2"/><file name="temp-5-preview-green.png" hash="23b9d70528280829d62b75fe1b2f4583"/><file name="temp-5-preview-orange.png" hash="4c44988fb1d0188f11db8fca38e4d9be"/><file name="temp-5.png" hash="2ba4c85707f885f69348e30acc87dcce"/><file name="temp-6.png" hash="ba25e257bfb2f05b5520c18fc4b1aaf0"/><file name="templates.png" hash="e70640fb9b1c78b43dccc3a0dd2e5b8d"/><file name="tick-analytics.png" hash="4ec2b80058957d5a0e4981293ddf6457"/><file name="tick-green.png" hash="49e5425fa6c0486b2be5d39d441a4cf9"/><file name="tick-orange.png" hash="c340278b24a4c92293b4db3832ff8329"/><file name="tick-pricing.png" hash="3a3f49be2bdbc3b9774321c53db50787"/><file name="tick.png" hash="cf2f6cecb363f8e6e2d64671467e1141"/><file name="tooltip-arrow.png" hash="5156649110cf1cb7cdbdc6512c47dc81"/><file name="tooltip-left-arrow.jpg" hash="92371e2d982257d136c5f46baeb513e6"/><file name="tooltip.png" hash="6a3b15fc7de518b27c63c7beda436204"/><file name="up-arrow.png" hash="452fa52e6d4b247dfca05f1996ffe318"/><file name="up-black.png" hash="7cd935e00c14d8c846b3e11f6b340a84"/><file name="up-gray.png" hash="f732268fd825a21e46346ba06deed750"/><file name="user.png" hash="f97a8fc7500ae31b18ed548897e05638"/><file name="view-hover.png" hash="b8f7826a09d5b8ee3f1beb6ade24a8a4"/><file name="view.png" hash="560fb2ea9e2717bd9aaa4bb3d258adc5"/><file name="warning.png" hash="4437ce9cf87d3d52abaea20ba9233d25"/><file name="x-widget.png" hash="0c75b723e7f543ff9da9627a3212a7a9"/><file name="x.png" hash="a0fdfbf2804612fc9b54abb64ec73731"/></dir><dir name="js"><dir name="app"><file name="analytics.js" hash="fd04c5b0c0424e161eb6d239800f0761"/><file name="autosuggest.js" hash="c6150187d86530d734a0d893d56eca84"/><file name="catalog.js" hash="cbc0491457366f8263efa5dae5eaaa6f"/><file name="config.js" hash="d073fdc2b152df450a07d6014f971a98"/><file name="credentials.js" hash="1f983ff5ff632026f130b3cffc1d79a7"/><file name="filter-catalogue.js" hash="120b8b0150ac1aab04d19216febff66d"/><dir name="search"><file name="api.js" hash="6e39ca0b9990c675ab29315952164814"/><file name="hosted.js" hash="80adf11bc58b21ba81e1e78c9fa32bc6"/><file name="landing.js" hash="4c487f74677cd88c7e9d67dd2213d030"/></dir><file name="utils.js" hash="f50ecabcbad2df4f319c9a6b6df15d4c"/><file name="widgets.js" hash="228d99b869bb0ab989522efa5e0261c5"/></dir><file name="app.js" hash="57b262277d9ada1fbec7eb5935190f8c"/><dir name="lib"><file name="backbone.js" hash="88fee57a12be8ea719ed85fe29f062d3"/><file name="bootstrap-modal.js" hash="04265b3f540e5af4d5eeeb6c3e0d813d"/><file name="bootstrap-tooltip.js" hash="304bf569ee1a25e8fae5532d90661662"/><file name="chosen.js" hash="4fabe14fb10d99c4b432db5ce9847c06"/><file name="colpick.js" hash="668c1d24c70d09b099a37cb7c158e092"/><file name="ractive-backbone.js" hash="afeac03a42a51483a7389f2b26a3e3d7"/><file name="ractive-chosen.js" hash="837381e6e428a7fa2b9f8f67c974d195"/><file name="ractive.js" hash="4887bb0d23f93ca78c46d2a7420cd360"/><file name="require.js" hash="177879fbe7dd333386711389ffa44d21"/><file name="routie.js" hash="bae94f674236d2d0a02d14624eb98713"/><file name="rv.js" hash="59d80aee6eb83f4f14596784fd57252a"/><file name="underscore.js" hash="f809a744b7a4fe79a94749a569aa17f9"/></dir><file name="main.js" hash="459b66ede2d1bdbd93f0868f3089bd65"/></dir><dir name="templates"><file name="analytics.html" hash="493740906f06e0e0df04d3268ef2bf26"/><file name="auto-suggest.html" hash="0d87aa15f51a636a505bdee043e6af6e"/><file name="catalog.html" hash="8355648cc85347dd13ca5324ab0ca561"/><file name="credentails.html" hash="ef5a207aaaa532cea47509a2ae8880e8"/><file name="index.html" hash="f2053de86b827b0536f3730e5bd47fb2"/><dir name="partials"><file name="catalogue.html" hash="edba8e597c3694d4ba490d20fff6b052"/><file name="contact-form.html" hash="782cad00f5846b8feaaee123a3250a29"/><file name="custom-attr.html" hash="395557e1453f49465ff7a83099d0271f"/><file name="filters.html" hash="d7e48ed533a73bfb9bca5399aed7bded"/><file name="preview-modal.html" hash="fc4a97401265fe2d3748d4742fddd674"/><file name="row.html" hash="fed8568b62d58b78d61a92dd987f1c8f"/><file name="switch-off.html" hash="ff23402a616d9e5af17c003cba7216f1"/><file name="switch-on.html" hash="49ed70ac50fb66803133313c8a470e52"/></dir><dir name="search"><file name="api.html" hash="ad234f9bf18f55b30a5318bd72b10ba2"/><file name="hosted.html" hash="d390ba0f14ed0f54fa74f981659711e6"/><file name="landing.html" hash="46928ca03f00d946d9e2b12272828752"/></dir><file name="widgets.html" hash="a06e1116fe06e610f7299c101bf8ba14"/></dir></dir></dir></dir></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.0.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>unbxd_recommendation</name>
4
+ <version>1.0.20</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
10
  <description>recommendation module</description>
11
  <notes>Unbxd Recommendation</notes>
12
  <authors><author><name>ananthesh</name><user>ananthesh</user><email>ananthesh@unbxd.com</email></author><author><name>praveen</name><user>praveen</user><email>praveen@unbxd.com</email></author></authors>
13
+ <date>2015-05-13</date>
14
+ <time>20:35:17</time>
15
+ <contents><target name="magelocal"><dir name="Unbxd"><dir name="Recscore"><dir name="Helper"><file name="Analyticshelper.php" hash="542b918b05b6c87db3023fc572c1d7c1"/><file name="Confighelper.php" hash="5fc6ae597615c7cbc09aaba5fd7c2c3d"/><file name="Constants.php" hash="237325c533de0e1e014e85ad852a8682"/><file name="Data.php" hash="e751a36a214ee58ec38ecc1067c2c3e9"/><file name="Feedhelper.php" hash="69db2cdfc9d4d19f164cb6cf3d281231"/></dir><dir name="Model"><dir name="Api"><file name="Request.php" hash="676864d597e13b12d31a6cd6282cff54"/><file name="Response.php" hash="c439b162f3160d7716d85605d740cf88"/><dir name="Task"><file name="Analyticsimpression.php" hash="8930d9e47f705ffa940ac07e31c02636"/><file name="Autosuggestindex.php" hash="00974e65f6c3c1756f5910f7fe5c3a00"/><file name="Feeddetails.php" hash="cda43137d4a235b0932f76aecde5828d"/><file name="Searchimpression.php" hash="43637475a8a573b2520a98e9679a4dd7"/><file name="Searchsetup.php" hash="fd8ce5aae3bc3c438a86daf72b149f5d"/><file name="Supportmail.php" hash="6f7296d6734173bc1f1d5083b35fc480"/><file name="Trackcart.php" hash="39af0962835e296428a1d302c163d7b2"/><file name="Trackorder.php" hash="018d609541ae41f3dd253c58b9ce88fb"/><file name="Triggerfeedupload.php" hash="7610f4de8ba3810938d1ecdb91161a86"/><file name="Updatefeaturefields.php" hash="61dfda139f10fadad1e8a20939718da0"/><file name="Validatekeys.php" hash="d52331bcdfa0dfc35d9f99e32b4cefc7"/></dir><file name="Task.php" hash="2c2fd0997bc9880b2a323ee6eb5844d3"/></dir><file name="Auth.php" hash="73d2cc68b49fe6157554477439cd7d74"/><file name="Config.php" hash="543e4c8a0964fd349c346e136569a5f7"/><dir name="Feed"><file name="Feedcreator.php" hash="997d78d5f2f8e2cbddb6afb3bfe6610b"/><file name="Feedmanager.php" hash="c6dea2244ebf78485bf7d67a2b6fbb36"/><file name="Filemanager.php" hash="df6b06204201da8a5396561cfad1ced4"/><dir name="Jsonbuilder"><file name="Jsonbuilder.php" hash="99fc05491593875c66b0521b2321ecd0"/><file name="Productbuilder.php" hash="b83be668ed744814026abfacc264becd"/><file name="Schemabuilder.php" hash="8a379b9bc7c4659305ab3b5d1de1df2e"/><file name="Taxonomybuilder.php" hash="ad5d295eb7bce69b091cd5301083430d"/></dir><file name="Tags.php" hash="002ea845b986a040a3e5f286431d8036"/></dir><file name="Field.php" hash="b28c9aa059f3bfb477a05a105a17a3b9"/><file name="Observer.php" hash="f1ae8097f8bdf734c062798513f04d06"/><dir name="Resource"><file name="Attribute.php" hash="f6de7ea7abb828ef1fb6a6dfcbd69840"/><dir name="Config"><file name="Collection.php" hash="38112097263b29f67c4358af1e123972"/></dir><file name="Config.php" hash="92d3fcff7df0285c788dceb28f51912a"/><dir name="Field"><file name="Collection.php" hash="411a7c8be674d58e9b779af9a927999f"/></dir><file name="Field.php" hash="a666ab6d8f47a8777a3b8bbea455a22c"/><dir name="Product"><file name="Collection.php" hash="728e8f2a2ba9b37d844d4784404e5a11"/></dir><dir name="Sync"><file name="Collection.php" hash="4a2391d2b27b5b1e6050f37fb995d668"/></dir><file name="Sync.php" hash="03eff6cbdb28353b653c02d4aa88d932"/></dir><dir name="State"><file name="Analytics.php" hash="83954d983dd817054345987bc7f32da3"/><file name="Catalog.php" hash="a4f3a96ceb0fa963e73bcbf6bd83ca60"/><file name="Credentials.php" hash="23b0dd01df50a8b661d28b4ba2bd4437"/><file name="Response.php" hash="deef3350e040a2b91c8e80d83646d30f"/></dir><file name="State.php" hash="3b52977417f686a34d6b161447c0b87f"/><file name="Statemgr.php" hash="02007603f045cac1958066761f3622a6"/><file name="Sync.php" hash="215f637e29a358fcaf44235f041d101b"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="IndexController.php" hash="2373a8ecea10134a3d683321c281c571"/></dir><file name="CatalogController.php" hash="95a51c8a5c09e7d1b3e0bf48292cbb26"/><file name="ConfigController.php" hash="7c51f060e0d14f3b19026bde760dba99"/></dir><dir name="etc"><file name="adminhtml.xml" hash="0f588fe72cddfafc7b46b3ff58a0a940"/><file name="config.xml" hash="c62485c1698871c1e60b1776bea8b33f"/></dir><dir name="sql"><dir name="unbxd_recscore_setup"><file name="mysql4-install-1.0.0.php" hash="0fa7677d9acbf6913ecc67c84cc8b56f"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Unbxd_Recommendation.xml" hash="58c2a5d99d2eb3a779fd0e953a4fd6c3"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="unbxd"><file name="recscore.xml" hash="b426e9786d866cca461dce509cca2e6e"/></dir></dir><dir name="template"><dir name="unbxd"><dir name="recscore"><file name="tracker.phtml" hash="7c09150d39594dcc2d9b1b8d8952a7b3"/><dir name="tracking"><file name="product.phtml" hash="a1ad56a8eb7e53e7ed483324d3f15a70"/></dir></dir></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><dir name="unbxd"><file name="recscore.xml" hash="007a71be9c73216557423017f9b22e88"/></dir></dir><dir name="template"><dir name="unbxd"><file name="recommendation.phtml" hash="903df82526c4b8569de80c96c818aad8"/></dir></dir></dir></dir></dir></target><target name="mageweb"><dir name="js"><dir name="unbxd"><dir name="recscore"><file name="app.js" hash="5790870aa32c641bbad8d064fd41b610"/><file name="embed.js" hash="ae0665e583a2579a2609f27f07f36551"/><file name="jquery.js" hash="52d16e147b5346147d0f3269cd4d0f80"/><file name="unbxdAnalytics.js" hash="98738dccf6a9e9378e79ca6931d9d3c1"/></dir></dir></dir><dir name="skin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="unbxd"><dir name="recscore"><dir><dir name="css"><file name="app.css" hash="b2e6cac84e88747ed286e719d1a45e99"/><file name="app1.css" hash="d0b0f148bdf44d46bcee3e4ae4668cb6"/><file name="bootstrap-switch.css" hash="b97cfbfa50ef0ef787261b5f925e506a"/><file name="bootstrap-them.css" hash="df854606e8bfb38abe58305c389301ae"/><file name="bootstrap.css" hash="92a3eb9b3fb1137b16bf8dca5907ffd6"/><file name="chosen.css" hash="2329f7f776c2b97a80a134c34c9eebd5"/><file name="colpick.css" hash="84eb0f762c33ede63bb4ed417b011a9d"/><file name="magento-app.css" hash="33b7d3e29d3906d21e882f8706ff7c7c"/><file name="unbxd-magento.css" hash="27657f8446948753277dad346325c4a3"/></dir><dir name="img"><file name="Custom-platform.png" hash="5290665e9ca24170ed6b4923bd635377"/><file name="DONE.png" hash="82ea09757c6f6ba582b2089a166686ec"/><file name="HEXAGON-Only.png" hash="cc44d0bcef0cbc24e00d08e3a76552c5"/><file name="Magento-small.png" hash="7a528e2dd969bec618acd410ae660727"/><file name="Magento.png" hash="a1006f3044d6cfe6dd6f4e982344ab4f"/><file name="Powered_by_unbxd copy.png" hash="b29f1ac74821c62af18ef2dea3a22265"/><file name="X-popup-hover.png" hash="f74653bfca79cbc1c262752b5f44d4c3"/><file name="X-popup.png" hash="63c9f5c8256e8ecfe76db8ddb8d9aaa0"/><file name="X-pricing.png" hash="979c2c9456732a8935d8e77f502de58e"/><file name="active.png" hash="ce09792133584f533c7a0a2227ff05c9"/><file name="add-actv.png" hash="f990f99e6c3bc5819087e02621e71a2d"/><file name="add-icon.png" hash="7add622ec65c42898fab1fb5e2e64533"/><file name="add-inactv.png" hash="9fb163e67fc1271534dbede05bd75d31"/><file name="add-raw-hover.png" hash="4a44e58502e00e8d73fc00b7988e8621"/><file name="add-raw.png" hash="442cc58d8176e0b580f409df4f18c89e"/><file name="add-rule.png" hash="de395f293ed3bd1f5e3e79ee80e0296e"/><file name="add.png" hash="317559b8877b4ab171c92e253fbae814"/><file name="api_int_info.png" hash="62efde0dc39f78b8d36ac140e4922fa8"/><file name="arrow-2.png" hash="6eb510a6c6753812d1c0b7ad3792c68d"/><file name="arrow-calendar-down.png" hash="cfcc798220b0655588b1ebc92bb2cd9e"/><file name="arrow-calendar-down1.png" hash="e1d78aa977aefd3dbd0d077265465a53"/><file name="arrow-down-disabled.jpg" hash="728761548b495cac219d9497f8d6bc88"/><file name="arrow-down-enabled.jpg" hash="79bf179fb24de528068cc34e0112bc5d"/><file name="arrow-down-white.jpg" hash="556e356570a1e9ed97b13fcbd028997e"/><file name="arrow-down-white1.jpg" hash="c1b42e8d9d6c79265085d0c297e215c0"/><file name="arrow-down-white2.jpg" hash="c1b42e8d9d6c79265085d0c297e215c0"/><file name="arrow-down.png" hash="13794ac6416e435d6b2fa0b54f48b488"/><file name="arrow-gray.png" hash="ef922786b71b9e8c7206dc3a3e55ec30"/><file name="arrow-inactive.png" hash="ea8df964b3bb238c34e2a92ac3819b1b"/><file name="arrow-left-inactive.png" hash="02dceab03c4629eda64caa32f76dd21f"/><file name="arrow-left-white.jpg" hash="99c322cfc458b3d9545335084263f7c0"/><file name="arrow-left.jpg" hash="d9c30f6cd57f2cdd382a1bcdbfa38507"/><file name="arrow-left.png" hash="2259b06fca6ea640c26d2208afd02fb5"/><file name="arrow-mail-developer).png" hash="6dd3f45435f140731481878b80a54e59"/><file name="arrow-right-blue.png" hash="33ad361548417c181dfbc05a7fbb78a9"/><file name="arrow-right-gray.jpg" hash="829ba35fb3b3598fcab2dd03dfd8bcaa"/><file name="arrow-right-inactive.png" hash="a8adf91679f6fcc1fcbbfebd87212bf7"/><file name="arrow-right-white.jpg" hash="fafacf3d7bc94986a26024565621b509"/><file name="arrow-right.jpg" hash="96af89ff4e0ebf1134361573b6a431b3"/><file name="arrow-right.png" hash="055276cac55edeb3eb4281f15a7ee404"/><file name="arrow-up-black.png" hash="668b1a36fb27af19739b0de2ee804bfc"/><file name="arrow-up-disabled.jpg" hash="d15535c2924f1e9ae570da0fc61d2e14"/><file name="arrow-up-enabled.jpg" hash="820c6e3175bf1774077cbf2ef0f00a5a"/><file name="arrow-up-red.png" hash="9e4fa614690acba2402e8fb774c1760a"/><file name="arrow-up-white.jpg" hash="6f4804c59bdfd728095e0d2c86c486e4"/><file name="arrow-up-white1.jpg" hash="017b0d2695a4d6b9534cae7af5883464"/><file name="arrow-up.png" hash="b4380ef5bdaad86d2eddeb69bfc51e5c"/><file name="arrow-white.png" hash="a62374550e967153b2f5f6c782770175"/><file name="arrow.png" hash="2dfdf0abf10326d73b8c39bd3f6da413"/><file name="arrow_grey.png" hash="9a4fc1c1022f8ecfeadf8e25da0f8240"/><file name="arrow_white.png" hash="794ff95721a9586ae3b9290a4a53ebbe"/><file name="authenticated.png" hash="9eac2025c82fcf60c822d7d4690ca98c"/><file name="back.png" hash="72f60077f20dc52553e069f641b42099"/><file name="bg.jpg" hash="4a2f6fda25f44f7009e9a22ccf90e330"/><file name="big-arrow-gray.jpg" hash="efb30594788c366bf9b007945b197071"/><file name="bigcommerce.png" hash="bb6801e63d1198f8ec1458e69d9d4eff"/><file name="black-right-small.jpg" hash="699a5af08c69fd5c3b57aaa9fed7cfaa"/><file name="black-right-thick.jpg" hash="707c1a0806947351564de4391e9ef885"/><file name="blue-selected.png" hash="e4246debbabc085b10572bd5aa4b0982"/><file name="breadcrumb_arrow.png" hash="631196f2801711df3ff31557c8287290"/><file name="btn-arrow-top.png" hash="75d77e80995b2b3b42043db3fe7e152b"/><file name="btn-arrow.png" hash="ee2543a2011a57b2b58db30cf62d0219"/><file name="button-arrow-blue.png" hash="b82160ad78e789b5702c7eb9a2dd3c7b"/><file name="button-arrow-grey.png" hash="cb339368b9409741e28dc31f6400f5f0"/><file name="button-arrow-red.png" hash="499819820395cfbcf03318107049a634"/><file name="cancel.png" hash="dea3ab86b5f6980886b8148b6dbc0804"/><file name="card-image.jpg" hash="543c66027f8d3718ab2f6930454c5324"/><file name="card-image1.jpg" hash="6469c85cb7133c89c514b5d932ec61d3"/><file name="card-image2.jpg" hash="816ceb38837684da077e08132d95aa08"/><file name="card-image3.jpg" hash="b65e704ae1cd2e88da5237e5e72e8ca8"/><file name="checkmark.png" hash="76c700530ee10b42763c1df6f85279b1"/><file name="chosen-sprite.png" hash="25b9acb1b504c95c6b95c33986b7317e"/><file name="close-analytics.png" hash="421ee870c5e070a6a03819eb2716fd1f"/><file name="close-round.png" hash="adafdcb7fde56b8af0e9b843ff7e19bb"/><file name="close.png" hash="fe130e3473e31d6f73127fed8d693539"/><file name="color-pic-black.png" hash="b9c18ff6fab0fc8bd1112b13a94d2477"/><file name="color-pic.png" hash="5ac6b53fdd57080a2df5a171bdb03aae"/><file name="congrats-magento.png" hash="2c02d7b82e1c5a8e2491f7892929b0fd"/><file name="congrats.png" hash="2c02d7b82e1c5a8e2491f7892929b0fd"/><file name="copy-black.png" hash="11abed4721d04c70531356777e828e0f"/><file name="copy-white.png" hash="6f188394d6619b61b51a7ede4c29ec0e"/><file name="cros.png" hash="25dee21cf8d50963fa3cf9300d0b93c0"/><file name="cross-2.png" hash="027fa6cdc450c378984376924003ca88"/><file name="custom-color-selected.png" hash="41b299f7d3d6964b45ced6c0b2209bfe"/><file name="custom-color.png" hash="4638d52f8ae7c8db0463500abeda4126"/><file name="custom-temp-1.png" hash="1e74a0ab64f7bce768e864a8ac43c1b8"/><file name="custom-temp-2.png" hash="456b7998744c5b272bc05f981ab79d73"/><file name="custom-temp-3.png" hash="3606aede791d32c3c9481d5bbc82847e"/><file name="custom-temp-4.png" hash="89d45791dfff0ca4f1ad94a4b1ec2661"/><file name="cvv-number.jpg" hash="3c3e97a31a009afcd3c26f7529db5cf1"/><file name="delete-raw-hover.png" hash="7bd9eeb7059b5946e2686415797417c7"/><file name="delete-raw.png" hash="43a13c96e2a261c309c151eb4ef975fc"/><file name="delete-red.png" hash="73386fe1e477b0a30c2ab9f9f11df94b"/><file name="delete.png" hash="55019546183a6d4bf7fce6ecc6a00b36"/><file name="detect.png" hash="b74ba51e28f7a15e8214c18cbdd4e407"/><file name="dot-border.png" hash="208feb3ba398f27536213749e1e621a3"/><file name="down-arrow.png" hash="25ce0545a9cc87f1d9e1b7b80be93876"/><file name="down-black.png" hash="d99de4c90283294c30f1670cf1a52f40"/><file name="down-gray.png" hash="3a75b2ef9452e1e3dd8e06ffab68456b"/><file name="drop-down.png" hash="3674841edf7320d3d84c708f50df1741"/><file name="dropdown-arrow.png" hash="e78ccea5d0bda5dbebcd5bbee4b93f64"/><file name="edit-magento.png" hash="efa37bbf88091ce8d7b68e8115d1fdde"/><file name="edit.png" hash="15f83e074edf79a9da13fbe74f47dfbd"/><file name="eye-hover.png" hash="b52a441b87c99d5cda61125669b33724"/><file name="eye.png" hash="8b7a3637232dad5710a8b36f69e2ad5d"/><file name="favicon.png" hash="1e52374b5ed35864d8fa9f15e2cd30c2"/><file name="fill.png" hash="ae2fd7902f99b1efc9531b006cdca186"/><file name="green-selected.png" hash="ef1ab5c6209c8e5293b2ce4867fd023d"/><file name="grey-selected.png" hash="b6a83c93171b89a6f7f466aa47ac4717"/><file name="group-arrow.png" hash="579edf9c51115a4c74061af86620edb7"/><file name="help.png" hash="4ef8bda62d42054e27218cfcd958c577"/><file name="icon-analytics.png" hash="c4b7b57118d1c912207ac8d34e3e6d5f"/><file name="icon-info.png" hash="cfa3beb50e89263c2da97d40f64da177"/><file name="icon-widget.png" hash="89fbad7748cb956a65896ddeda18a57c"/><file name="info-icon-big.png" hash="8b881f8b5950131b96f337247fe59b4f"/><file name="info-small.png" hash="a47a6287c9af33f42cd78762c9d5862f"/><file name="install.png" hash="6b378698d96ab32f89efc23fc24333da"/><file name="integration-gray.png" hash="e1428587806c6e90872cb8e325e1bb0f"/><file name="introduction-gray.png" hash="003c564c948c374ade90bfcef89088e9"/><file name="left-black.png" hash="ac4d88a6ddfefcdf75dcef4384bdf90e"/><file name="left-gray.png" hash="b229e9f7144f1d80f73f1dac6f689401"/><file name="level-arrow-active.png" hash="8905e738238c090bed0c259266159374"/><file name="level-arrow.png" hash="9a4fc1c1022f8ecfeadf8e25da0f8240"/><file name="link-arrow.png" hash="61fb4c9e922c3c6427fea1484eab2474"/><file name="list_bullet.png" hash="a6dda6a7e38ced1ea368d2265434e53f"/><file name="loader-16x16.gif" hash="778e6b9e73274330dae0dab8104948a0"/><file name="loader-24x24.gif" hash="e403534956d055d636b3a5fa813b82b7"/><file name="loader-32x32.gif" hash="510f6441c74b9f098ea99cc11d0c4e89"/><file name="loader.gif" hash="fd1345456c4a685afb42b67c25354ca2"/><file name="loader_black.gif" hash="5bfd8de3193a5fc2e5b472f57df1408f"/><file name="lock-image.jpg" hash="6081155d7fcbb5d8c4d34a344f0bbd97"/><file name="logo-unbxd.png" hash="82024b1f5e10ac130489103e8bf08d2b"/><file name="logo.png" hash="1c0087551ac1c41493868b5d409b7dda"/><file name="mail-box.png" hash="25dae3efa5200ee176dd0aa825fa1d5b"/><file name="mail-id-sprite.png" hash="3a06a0e11e74c7a66f7f0f1aae082fcf"/><file name="mail-new.png" hash="8a3fe01ecd87ea7e93b239f2add8a52a"/><file name="mail.png" hash="f1a1039b5ebdc17cb40b2d79ca3937e9"/><file name="minus.jpg" hash="0fd79f174562ffa46348b445c85c930c"/><file name="minus.png" hash="bc691a8f2761f1d1c4a379f665d03480"/><file name="nav-highlight-arrow.png" hash="9806317c711b22c08a6247960c10fb26"/><file name="not-detected.png" hash="2e63b320f3f8a6c004c71bc1b02c1473"/><file name="oops.png" hash="03eca8b24324df38fd4c734843a2abbb"/><file name="or.png" hash="e6e8b2d42f8dedf2078e3d9f38e6070d"/><file name="orange-selected.png" hash="296963f455ad925de437581fa07be306"/><file name="orange.png" hash="2e2089e5c3e867f00728cf2cf2de3811"/><file name="other-gray.png" hash="58f19f3578f063ff1ccd8b8ef2890195"/><file name="overview-gray.png" hash="0c3501dd6469f90a61a8367a3bdc3340"/><file name="plus.png" hash="2cbfab4d57d7083650b5bbf8be7ee84c"/><file name="preview.png" hash="d56d8e0b3eb221a714ed0e2474ed38ac"/><file name="question-mark2.jpg" hash="50392a77ea59fc9c1e4709834cc7ae2d"/><file name="red-cross.png" hash="368e01e53564574eea66c850829a243f"/><file name="red-loading.gif" hash="510327b63304d4c58bb9445c7343498f"/><file name="remove.png" hash="aea65d50ad060b90e8f7e76624f20c4b"/><file name="right-black.png" hash="cdc63a865ca9717d3d315fc3bcbc64ca"/><file name="right-gray.png" hash="cc72c1c3416e2ce5750e4db92de093fd"/><file name="rules.png" hash="004dced224b5250f4f033cffb44cca14"/><file name="save.png" hash="20eb685cc7a58ea1ea2065a8c2d10e81"/><file name="saved.png" hash="df9ab88cb96c3de503816171f35b1254"/><file name="search.png" hash="5acdafa5337d7702948a4015eeb8f0f6"/><file name="settings.png" hash="36fc3060fa0d0e5bb2e3dd57c51b1edf"/><file name="shopify.png" hash="ff1163b008f933c7e71cd5a4d77de878"/><file name="site-dropdownarrow-down.png" hash="e83075515419fa29658df010a6982023"/><file name="site-dropdownarrow-up.png" hash="fbd66dc69e51085161a2e28c519e2dc8"/><file name="skin1-trans.png" hash="0264c245ba712d19d5b0d308e71e77b4"/><file name="skin1.png" hash="2e2089e5c3e867f00728cf2cf2de3811"/><file name="skin2.png" hash="fe5935399ab1a8d78ecaebaba6c7d176"/><file name="skin3.png" hash="9bfccdd71c71d7f03b5f2fe1cd394118"/><file name="skin4.png" hash="1002cadb9ce2bdaea9e820d0f324113d"/><file name="slider-bg.png" hash="0f310e78f27110b13cf699ed7d4b97e4"/><file name="slider-button.png" hash="4b8c133577ba9022b97ac82420e88166"/><file name="sort-arrow-blue-down.png" hash="22fab361e19b80e12b1279921f123656"/><file name="sort-arrow-blue-up.png" hash="7731f17d465b7dd6cde7eafebe2248b7"/><file name="sort-arrow-grey-down.png" hash="82cfe186b77d97dd0d961303bd53ad40"/><file name="sort-arrow-grey-up.png" hash="dbd67d69cb4ddab64cf9bed760251adb"/><file name="spinner_down.png" hash="afdbf1537511400bc1278cf761cedb12"/><file name="spinner_up.png" hash="f1032905f72b96eb8ee8f5ddb995e559"/><file name="spree.png" hash="d30a2489564230c317f9c873277567e9"/><file name="start-gray.png" hash="b6425ce659a1da4316a144a5a66b72bd"/><file name="step-arrow.png" hash="1bb6bed612dd45b5e49b2a70a952a7a7"/><file name="success-icon-big.png" hash="9d4e0c51400d6039220a5301797e01a1"/><file name="success.png" hash="74d3fa654373b5c128699c80cf218053"/><file name="temp-1-blue.png" hash="e62450283d4e38467c6920a8474c139d"/><file name="temp-1-green.png" hash="ba66a0aa6cae5edf940ceddb51c11f12"/><file name="temp-1-grey.png" hash="a2736bce441ee5b0a98cc7090b31918d"/><file name="temp-1-orange.png" hash="ab3c96985183414aec3d5affe33094fe"/><file name="temp-1-preview-blue.png" hash="eb3d6e4fe3473d6a69239c6e6da815ea"/><file name="temp-1-preview-green.png" hash="4f126d02eae9679d88a1e411319c5d4c"/><file name="temp-1-preview-grey.png" hash="ef8c62f98c94b550c488650aa2a1bbbf"/><file name="temp-1-preview-orange.png" hash="1aa2170d326403a87f119341622503d3"/><file name="temp-1.png" hash="e5c1f8718fec6d570a2eef8110b1da3c"/><file name="temp-2-blue.png" hash="35c176f6bfb28e7f603dae4e08ab2b08"/><file name="temp-2-green.png" hash="d9c9f88f66cb0e96f67384ed46e164b2"/><file name="temp-2-grey.png" hash="97e1c2d6b09ae812891768193825c24c"/><file name="temp-2-orange.png" hash="bd5c1d83b734cc78f3d6684ea39cdbb2"/><file name="temp-2-preview-blue.png" hash="65b394b1b7ba85c8f6557b56a01956f0"/><file name="temp-2-preview-green.png" hash="2ffeb59926e5d02d618b1e27c6ec8f3f"/><file name="temp-2-preview-grey.png" hash="0b5a3c138cbf5d7aa6d6c2f2fd546a12"/><file name="temp-2-preview-orange.png" hash="899dc8507574ce64382757b32ae2e534"/><file name="temp-2.png" hash="35ee735575579755f23b9be31eac64d6"/><file name="temp-3-blue.png" hash="3f33a385a0588c159459640ba50a6e68"/><file name="temp-3-green.png" hash="8fa49ff3af61230af4352a5c30b62a9f"/><file name="temp-3-grey.png" hash="a98c1d46adf4d091c1ee0b8e4affef60"/><file name="temp-3-orange.png" hash="7bca6c527be688c8609ff21b8f2a1d74"/><file name="temp-3-preview-blue.png" hash="636b0e1eeef3577338cdcfb735c99e15"/><file name="temp-3-preview-green.png" hash="ebc8bae1360c48fe346292840f954021"/><file name="temp-3-preview-grey.png" hash="5684634e2988a5b25a02de8d48644db6"/><file name="temp-3-preview-orange.png" hash="d788a099b7af1328a716639391469213"/><file name="temp-3.png" hash="9b6c874b939adff6f507d1f2754fc2c9"/><file name="temp-4-blue.png" hash="a97c6420edeb9d0e95bb8a67770af70c"/><file name="temp-4-green.png" hash="02f1e2f9b2541ba27ae9562dc4d7401d"/><file name="temp-4-grey.png" hash="8644e3016a22f011c2637deca0a0ac17"/><file name="temp-4-orange.png" hash="8649ad362dd918cb43a85feea9963daf"/><file name="temp-4-preview-blue.png" hash="6578e5606be7e7cda9c3a6a5c0e545b9"/><file name="temp-4-preview-green.png" hash="fb264203a4541ccd74f03b29a9142da4"/><file name="temp-4-preview-grey.png" hash="f26ffe3252713190c6a795e11b816cf2"/><file name="temp-4-preview-orange.png" hash="d1fc0e64b8c50c63b46ebff25665d330"/><file name="temp-5-blue.png" hash="e8656a96324a6bcdf8929e01591f7503"/><file name="temp-5-green.png" hash="040ea3f18c03189cff35e0583d5b6c04"/><file name="temp-5-orange.png" hash="f1a011d6401615da7624d610eb4d92f5"/><file name="temp-5-preview-blue.png" hash="beb849914a4a0338c2186bd61cc5e928"/><file name="temp-5-preview-gray.png" hash="bf0af858702b7d5af7d90b4ad7d424a2"/><file name="temp-5-preview-green.png" hash="23b9d70528280829d62b75fe1b2f4583"/><file name="temp-5-preview-orange.png" hash="4c44988fb1d0188f11db8fca38e4d9be"/><file name="temp-5.png" hash="2ba4c85707f885f69348e30acc87dcce"/><file name="temp-6.png" hash="ba25e257bfb2f05b5520c18fc4b1aaf0"/><file name="templates.png" hash="e70640fb9b1c78b43dccc3a0dd2e5b8d"/><file name="tick-analytics.png" hash="4ec2b80058957d5a0e4981293ddf6457"/><file name="tick-green.png" hash="49e5425fa6c0486b2be5d39d441a4cf9"/><file name="tick-orange.png" hash="c340278b24a4c92293b4db3832ff8329"/><file name="tick-pricing.png" hash="3a3f49be2bdbc3b9774321c53db50787"/><file name="tick.png" hash="cf2f6cecb363f8e6e2d64671467e1141"/><file name="tooltip-arrow.png" hash="5156649110cf1cb7cdbdc6512c47dc81"/><file name="tooltip-left-arrow.jpg" hash="92371e2d982257d136c5f46baeb513e6"/><file name="tooltip.png" hash="6a3b15fc7de518b27c63c7beda436204"/><file name="up-arrow.png" hash="452fa52e6d4b247dfca05f1996ffe318"/><file name="up-black.png" hash="7cd935e00c14d8c846b3e11f6b340a84"/><file name="up-gray.png" hash="f732268fd825a21e46346ba06deed750"/><file name="user.png" hash="f97a8fc7500ae31b18ed548897e05638"/><file name="view-hover.png" hash="b8f7826a09d5b8ee3f1beb6ade24a8a4"/><file name="view.png" hash="560fb2ea9e2717bd9aaa4bb3d258adc5"/><file name="warning.png" hash="4437ce9cf87d3d52abaea20ba9233d25"/><file name="x-widget.png" hash="0c75b723e7f543ff9da9627a3212a7a9"/><file name="x.png" hash="a0fdfbf2804612fc9b54abb64ec73731"/></dir><dir name="js"><dir name="app"><file name="analytics.js" hash="fd04c5b0c0424e161eb6d239800f0761"/><file name="autosuggest.js" hash="c6150187d86530d734a0d893d56eca84"/><file name="catalog.js" hash="20533109e38ecb7e17c029d7bec79726"/><file name="config.js" hash="075e03868e18b0ac998bf42706746a87"/><file name="credentials.js" hash="1f983ff5ff632026f130b3cffc1d79a7"/><file name="filter-catalogue.js" hash="120b8b0150ac1aab04d19216febff66d"/><dir name="search"><file name="api.js" hash="6e39ca0b9990c675ab29315952164814"/><file name="hosted.js" hash="80adf11bc58b21ba81e1e78c9fa32bc6"/><file name="landing.js" hash="4c487f74677cd88c7e9d67dd2213d030"/></dir><file name="utils.js" hash="f50ecabcbad2df4f319c9a6b6df15d4c"/><file name="widgets.js" hash="228d99b869bb0ab989522efa5e0261c5"/></dir><file name="app.js" hash="57b262277d9ada1fbec7eb5935190f8c"/><dir name="lib"><file name="backbone.js" hash="88fee57a12be8ea719ed85fe29f062d3"/><file name="bootstrap-modal.js" hash="04265b3f540e5af4d5eeeb6c3e0d813d"/><file name="bootstrap-tooltip.js" hash="304bf569ee1a25e8fae5532d90661662"/><file name="chosen.js" hash="4fabe14fb10d99c4b432db5ce9847c06"/><file name="colpick.js" hash="668c1d24c70d09b099a37cb7c158e092"/><file name="ractive-backbone.js" hash="afeac03a42a51483a7389f2b26a3e3d7"/><file name="ractive-chosen.js" hash="837381e6e428a7fa2b9f8f67c974d195"/><file name="ractive.js" hash="4887bb0d23f93ca78c46d2a7420cd360"/><file name="require.js" hash="177879fbe7dd333386711389ffa44d21"/><file name="routie.js" hash="bae94f674236d2d0a02d14624eb98713"/><file name="rv.js" hash="59d80aee6eb83f4f14596784fd57252a"/><file name="underscore.js" hash="f809a744b7a4fe79a94749a569aa17f9"/></dir><file name="main.js" hash="459b66ede2d1bdbd93f0868f3089bd65"/></dir><dir name="templates"><file name="analytics.html" hash="493740906f06e0e0df04d3268ef2bf26"/><file name="auto-suggest.html" hash="0d87aa15f51a636a505bdee043e6af6e"/><file name="catalog.html" hash="8355648cc85347dd13ca5324ab0ca561"/><file name="credentails.html" hash="ef5a207aaaa532cea47509a2ae8880e8"/><file name="index.html" hash="f2053de86b827b0536f3730e5bd47fb2"/><dir name="partials"><file name="catalogue.html" hash="edba8e597c3694d4ba490d20fff6b052"/><file name="contact-form.html" hash="782cad00f5846b8feaaee123a3250a29"/><file name="custom-attr.html" hash="395557e1453f49465ff7a83099d0271f"/><file name="filters.html" hash="d7e48ed533a73bfb9bca5399aed7bded"/><file name="preview-modal.html" hash="fc4a97401265fe2d3748d4742fddd674"/><file name="row.html" hash="fed8568b62d58b78d61a92dd987f1c8f"/><file name="switch-off.html" hash="ff23402a616d9e5af17c003cba7216f1"/><file name="switch-on.html" hash="49ed70ac50fb66803133313c8a470e52"/></dir><dir name="search"><file name="api.html" hash="ad234f9bf18f55b30a5318bd72b10ba2"/><file name="hosted.html" hash="d390ba0f14ed0f54fa74f981659711e6"/><file name="landing.html" hash="46928ca03f00d946d9e2b12272828752"/></dir><file name="widgets.html" hash="a06e1116fe06e610f7299c101bf8ba14"/></dir></dir></dir></dir></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.0.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>
skin/adminhtml/default/default/unbxd/recscore/js/app/catalog.js CHANGED
@@ -425,7 +425,7 @@ function( $,
425
  loadFeedStatus:function( ractiveCatalog ){
426
  Utils.feedStatus()
427
  .then(function( data ){
428
- if( data.success )
429
  ractiveCatalog.set({
430
  dataSuccessMsg:"Successfully uploaded",
431
  lastSyncTime : data.lastUpload
425
  loadFeedStatus:function( ractiveCatalog ){
426
  Utils.feedStatus()
427
  .then(function( data ){
428
+ if( data.success && data.lastUpload )
429
  ractiveCatalog.set({
430
  dataSuccessMsg:"Successfully uploaded",
431
  lastSyncTime : data.lastUpload
skin/adminhtml/default/default/unbxd/recscore/js/app/config.js CHANGED
@@ -3,8 +3,8 @@ function(){
3
 
4
  var Config = {
5
  pdn:true,
6
- maxSuggestions:30,
7
- maxPopularProducts:20,
8
  site:"",
9
 
10
 
3
 
4
  var Config = {
5
  pdn:true,
6
+ maxSuggestions:16,
7
+ maxPopularProducts:10,
8
  site:"",
9
 
10