Expertrec_Recommendation - Version 1.1.4

Version Notes

Expertrec Recommendation plugin for magento sites.

Download this release

Release Info

Developer melchi
Extension Expertrec_Recommendation
Version 1.1.4
Comparing to
See all releases


Code changes from version 1.1.3 to 1.1.4

Files changed (21) hide show
  1. app/code/community/Expertrec/Recommendation/Block/Api.php +388 -0
  2. app/code/community/Expertrec/Recommendation/Helper/Data.php +20 -2
  3. app/code/community/Expertrec/Recommendation/Helper/Searchhelper.php +27 -18
  4. app/code/community/Expertrec/Recommendation/Model/Catalogsearch/Layer.php +1 -1
  5. app/code/community/Expertrec/Recommendation/Model/Feed/Feedcreator.php +13 -4
  6. app/code/community/Expertrec/Recommendation/Model/Feed/Formatter.php +41 -18
  7. app/code/community/Expertrec/Recommendation/Model/Log.php +1 -1
  8. app/code/community/Expertrec/Recommendation/Model/Observer.php +62 -1
  9. app/code/community/Expertrec/Recommendation/Model/Writer/Abstract.php +1 -1
  10. app/code/community/Expertrec/Recommendation/controllers/Adminhtml/IndexController.php +4 -0
  11. app/code/community/Expertrec/Recommendation/controllers/ApiController.php +12 -542
  12. app/code/community/Expertrec/Recommendation/controllers/ConfigController.php +97 -72
  13. app/code/community/Expertrec/Recommendation/controllers/IndexController.php +2 -3
  14. app/code/community/Expertrec/Recommendation/etc/adminhtml.xml +6 -0
  15. app/code/community/Expertrec/Recommendation/etc/config.xml +12 -1
  16. app/code/community/Expertrec/Recommendation/sql/expertrec_setup/mysql4-install-1.0.0.php +5 -1
  17. app/design/frontend/base/default/layout/expertrec/recommendation.xml +10 -0
  18. app/design/frontend/base/default/template/expertrec/feed/info.phtml +537 -0
  19. app/design/frontend/base/default/template/expertrec/recommendation/tracker.phtml +1 -2
  20. app/design/frontend/base/default/template/expertrec/recommendation/tracking/product.phtml +1 -2
  21. package.xml +4 -4
app/code/community/Expertrec/Recommendation/Block/Api.php ADDED
@@ -0,0 +1,388 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Expertrec_Recommendation_Block_Api extends Mage_Core_Block_Template{
4
+
5
+ const CONFIG_HEADERS = 'expertrec/general/headers';
6
+ const CONFIG_FILTERS = 'expertrec/general/filters';
7
+ const SEARCH_LIST_ENABLE = 'search/enable';
8
+ const SEARCH_LIST_API = 'search/api';
9
+ const SEARCH_FACET_LIST = 'search/facets_list';
10
+ const SEARCH_SINGLE_SELECT_FILTERS = 'search/single_select_filters';
11
+ const SEARCH_IS_AJAX = 'search/is_ajax';
12
+ const SEARCH_ITEMS_PER_PAGE = 'search/items_per_page';
13
+ const SEARCH_DISPLAY_PAGES = 'search/display_pages';
14
+ const SEARCH_FETCH_PRICE = 'search/fetch_price';
15
+ const SEARCH_CONVERT_PRICE = 'search/convert_price';
16
+ const SEARCH_CUSTOM_TEMPLATE = 'search/custom_template';
17
+ const FEED_LOG_ENDPOINT = 'log_endpoint';
18
+ const FEED_UPLOAD_ENDPOINT = 'upload_endpoint';
19
+ const IS_UPLOAD_FEED = 'is_upload';
20
+ const IMAGE_WIDTH = 'expertrec/general/expertrec_image_width';
21
+ const IMAGE_HEIGHT = 'expertrec/general/expertrec_image_height';
22
+ const THUMBNAIL_WIDTH = 'expertrec/general/expertrec_thumbnail_width';
23
+ const THUMBNAIL_HEIGHT = 'expertrec/general/expertrec_thumbnail_height';
24
+
25
+ /**
26
+ * A custom method use to return a simple string.
27
+ *
28
+ * @return string
29
+ */
30
+ public function getText()
31
+ {
32
+ $version = (string)Mage::getConfig()->getNode('modules/Expertrec_Recommendation/version');
33
+
34
+ return "I am inside `" . $version. "` block and it is my first custom block ever !";
35
+ }
36
+
37
+ //Fetching website domain URL
38
+ public function getBaseUrl()
39
+ {
40
+ $baseUrl=Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
41
+ return $baseUrl;
42
+ }
43
+
44
+ //Fetching secret passed in url request parameters
45
+ public function getSecret()
46
+ {
47
+ $customerSecret = Mage::registry('secret');
48
+ return $customerSecret;
49
+ }
50
+ public function getLogUrl()
51
+ {
52
+ $logUrl = $this->getBaseUrl().'index.php/expertrec-feed/index/getlog?secret='.$this->getSecret();
53
+ return $logUrl;
54
+ }
55
+ public function getCleanDirUrl()
56
+ {
57
+ $cleanDirUrl = $this->getBaseUrl().'index.php/expertrec-feed/index/clean?secret='.$this->getSecret();
58
+ return $cleanDirUrl;
59
+ }
60
+
61
+ public function getCustomApiUrl()
62
+ {
63
+ $apiUrlWithCustomConf=$this->getBaseUrl().'index.php/expertrec-feed?secret='.$this->getSecret().'&cmd=export&wid=1&sid=1';
64
+ return $apiUrlWithCustomConf;
65
+ }
66
+
67
+ public function getSuggestionApiUrl()
68
+ {
69
+ $apiUrlWithCustomConf=$this->getBaseUrl().'index.php/expertrec-feed?secret='.$this->getSecret().'&cmd=getpp&wid=1&sid=1';
70
+ return $apiUrlWithCustomConf;
71
+ }
72
+
73
+ //Fetching image width and height
74
+ public function getImageParams()
75
+ {
76
+ $imageParamsArray = array();
77
+ $imageWidth = Mage::getStoreConfig(self::IMAGE_WIDTH);
78
+ $imageHeight = Mage::getStoreConfig(self::IMAGE_HEIGHT);
79
+ $thumbWidth = Mage::getStoreConfig(self::THUMBNAIL_WIDTH);
80
+ $thumbHeight = Mage::getStoreConfig(self::THUMBNAIL_HEIGHT);
81
+
82
+
83
+ //Checking for non-empty and non-null image width and height
84
+ if (isset($imageWidth) && $imageWidth != "")
85
+ {
86
+ $imageParamsArray["imgwidth"] = $imageWidth;
87
+ }
88
+
89
+ if (isset($imageHeight) && $imageHeight != "")
90
+ {
91
+ $imageParamsArray["imgheight"] = $imageHeight;
92
+ }
93
+
94
+ if (isset($thumbWidth) && $thumbWidth != "")
95
+ {
96
+ $imageParamsArray["thumbwidth"] = $thumbWidth;
97
+ }
98
+
99
+ if (isset($thumbHeight) && $thumbHeight != "")
100
+ {
101
+ $imageParamsArray["thumbheight"] = $thumbHeight;
102
+ }
103
+
104
+ return $imageParamsArray;
105
+ }
106
+
107
+ //Fetching website store info
108
+ public function getWebsiteStoreInfo()
109
+ {
110
+ $feedFilter = Mage::getSingleton('expertrec_recommendation/feed_feedfilter');
111
+ $baseUrl=Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
112
+ $websiteStoreData = array();
113
+ // List all website-stores
114
+ $websiteCollection = Mage::getModel('core/website')->getCollection()->load();
115
+ foreach ($websiteCollection as $website){
116
+ $wid=$website->getWebsiteId();
117
+ foreach ($website->getGroups() as $group) {
118
+ $stores = $group->getStores();
119
+ foreach ($stores as $oStore) {
120
+ $sid=$oStore->getId();
121
+ $websiteStoreRow = array();
122
+ $apiUrl=$this->getBaseUrl().'index.php/expertrec-feed?secret='.$this->getSecret().'&cmd=export&wid='.$wid.'&sid='.$sid;
123
+ // Display the store-website details with feed api
124
+
125
+ $websiteStoreRow["wid"] = $wid;
126
+ $websiteStoreRow["wname"] = $website->getName();
127
+ $websiteStoreRow["sid"] = $sid;
128
+ $websiteStoreRow["sname"] = $oStore->getName();
129
+ $websiteStoreRow["surl"] = $apiUrl;
130
+
131
+ try{
132
+ $collection=$feedFilter->addBasicFilter($website,$oStore)
133
+ ->setPageSize(500);
134
+ $pages = $collection->getLastPageNumber();
135
+ $websiteStoreRow["pages"] = (string)$pages;
136
+
137
+ }catch(Exception $e){
138
+ $websiteStoreRow["pageerr"] = $e.getMessage();
139
+ }
140
+
141
+ array_push($websiteStoreData,$websiteStoreRow);
142
+ }
143
+ }
144
+ }
145
+ return $websiteStoreData;
146
+ }
147
+
148
+ /*
149
+ Feed config functions
150
+ */
151
+ public function isFeedUpload()
152
+ {
153
+ $isUpload = Mage::helper('expertrec_recommendation')->getConfig(self::IS_UPLOAD_FEED);
154
+ return $isUpload;
155
+ }
156
+
157
+ public function getFeedConfUrl()
158
+ {
159
+ $urlArray = array();
160
+
161
+ $textArray = array("log_api"=>"Feed log endpoint", "upload_api"=>"Feed upload endpoint");
162
+ $textToStoreKeyMapArray = array("log_api"=>self::FEED_LOG_ENDPOINT,"upload_api"=>self::FEED_UPLOAD_ENDPOINT);
163
+
164
+ foreach ($textArray as $tKey => $tValue) {
165
+ $storeValue = Mage::helper('expertrec_recommendation')->getConfig($textToStoreKeyMapArray[$tKey]);
166
+ $label = ucwords(str_replace("_", " ", $tKey));
167
+
168
+ $urlRow = array();
169
+ $urlRow["label"] = $label;
170
+ $urlRow["tkey"] = $tKey;
171
+ $urlRow["storevalue"] = $storeValue;
172
+ $urlRow["placeholder"] = $tValue;
173
+
174
+ array_push($urlArray,$urlRow);
175
+ }
176
+
177
+ return $urlArray;
178
+ }
179
+
180
+ /*
181
+ Search config functions
182
+ */
183
+ public function getSearchCheckedValues()
184
+ {
185
+ $searchCheckArray = array();
186
+ $chekboxArray = array(
187
+ "search_enable"=>self::SEARCH_LIST_ENABLE,
188
+ "fetch_price"=>self::SEARCH_FETCH_PRICE,
189
+ "convert_price"=>self::SEARCH_CONVERT_PRICE,
190
+ "is_ajax"=>self::SEARCH_IS_AJAX,
191
+ "custom_template"=>self::SEARCH_CUSTOM_TEMPLATE);
192
+
193
+ foreach ($chekboxArray as $cKey => $cValue)
194
+ {
195
+ $checkRow = array();
196
+
197
+ $storeValue = Mage::helper('expertrec_recommendation')->getConfig($cValue);
198
+ $checkRow['label'] = ucwords(str_replace("_", " ", $cKey));
199
+ $checkRow['val'] = $cKey;
200
+ $checkRow['checked'] = isset($storeValue) && $storeValue == "true" ? "checked" :'';
201
+
202
+ array_push($searchCheckArray,$checkRow);
203
+ }
204
+
205
+ return $searchCheckArray;
206
+
207
+ }
208
+
209
+ public function getSearchFields()
210
+ {
211
+ $searchFieldArray = array();
212
+ $textArray = array(
213
+ "api"=>"Search endpoint",
214
+ "facet_list"=>"Facet list comma separated",
215
+ "single_select_filter"=>"Single select filters comma separated",
216
+ "items_per_page"=>"No of items per page",
217
+ "display_pages"=>"No. of pages to display");
218
+
219
+ $textToStoreKeyMapArray = array(
220
+ "api"=>self::SEARCH_LIST_API,
221
+ "facet_list"=>self::SEARCH_FACET_LIST,
222
+ "single_select_filter"=>self::SEARCH_SINGLE_SELECT_FILTERS,
223
+ "items_per_page"=>self::SEARCH_ITEMS_PER_PAGE,
224
+ "display_pages"=>self::SEARCH_DISPLAY_PAGES);
225
+ // input
226
+ foreach ($textArray as $tKey => $tValue) {
227
+ $searchFieldRow = array();
228
+ $label = ucwords(str_replace("_", " ", $tKey));
229
+ $storeValue = Mage::helper('expertrec_recommendation')->getConfig($textToStoreKeyMapArray[$tKey]);
230
+ $searchFieldRow["tkey"] = $tKey;
231
+ $searchFieldRow["label"] = $label;
232
+ $searchFieldRow["storevalue"] = $storeValue;
233
+ $searchFieldRow["placeholder"] = $tValue;
234
+ array_push($searchFieldArray,$searchFieldRow);
235
+
236
+ }
237
+
238
+ return $searchFieldArray;
239
+ }
240
+
241
+ /*
242
+ Site Details section
243
+ */
244
+ public function getSiteDetails()
245
+ {
246
+ $siteDetails = array();
247
+
248
+ try
249
+ {
250
+ $siteDetails["adminEmail"] = Mage::getStoreConfig('trans_email/ident_general/email');
251
+ $siteDetails["adminName"] = Mage::getStoreConfig('trans_email/ident_general/name');
252
+ $siteDetails["salesEmail"] = Mage::getStoreConfig('trans_email/ident_sales/email');
253
+ $siteDetails["salesName"] = Mage::getStoreConfig('trans_email/ident_sales/name');
254
+ $siteDetails["secureUrl"] = Mage::getStoreConfig('web/secure/base_url');
255
+ $siteDetails["unsecureUrl"] = Mage::getStoreConfig('web/unsecure/base_url');
256
+ $siteDetails["baseCurrency"] = Mage::getStoreConfig('currency/options/base');
257
+ $siteDetails["defaultCurrency"] = Mage::getStoreConfig('currency/options/default');
258
+ $siteDetails["allowCurrency"] = Mage::getStoreConfig('currency/options/allow');
259
+ $siteDetails["timezone"] = Mage::getStoreConfig('general/locale/timezone');
260
+ $siteDetails["defaultCountry"] = Mage::getStoreConfig('general/country/default');
261
+ $siteDetails["installedCurrency"] = Mage::getStoreConfig('system/currency/installed');
262
+
263
+ }
264
+ catch(Exception $e)
265
+ {}
266
+
267
+ return $siteDetails;
268
+ }
269
+
270
+ public function getInstalledExtensions()
271
+ {
272
+ $installedModules = array();
273
+
274
+ try
275
+ {
276
+ $modulesArray = (array)Mage::getConfig()->getNode('modules')->children();
277
+ $modulesNameArray = array_keys($modulesArray);
278
+ $installedModules['modulearr'] = $modulesNameArray;
279
+ $installedModules['modulestr'] = implode(', ',$modulesNameArray);
280
+ }
281
+ catch(Exception $e)
282
+ {
283
+ $installedModules['errorstr'] = $e.getMessage();
284
+ }
285
+
286
+ return $installedModules;
287
+ }
288
+
289
+ public function getActiveExtensions($installedModules)
290
+ {
291
+ $activeModules = array();
292
+
293
+ //Pass only if the installed modules are retrieved successful, an array of modules is needed
294
+ if(isset($installedModules))
295
+ {
296
+ try
297
+ {
298
+ $coreHelper = Mage::helper('core');
299
+ $activeModulesArr = array();
300
+
301
+ foreach ($installedModules as $module)
302
+ {
303
+ if($coreHelper->isModuleEnabled($module))
304
+ {
305
+ $activeModulesArr[] = $module;
306
+ }
307
+ }
308
+
309
+ $activeModules['modulestr'] = implode(', ',$activeModulesArr);
310
+ }
311
+ catch(Exception $e)
312
+ {
313
+ $activeModules['errorstr'] = $e.getMessage();
314
+ }
315
+ }
316
+
317
+ return $activeModules;
318
+ }
319
+
320
+ /*
321
+ Feed Headers function
322
+ */
323
+ public function getAllAttributes()
324
+ {
325
+ $attrArray = array
326
+ ('qty',
327
+ 'is_in_stock',
328
+ 'expert_image',
329
+ 'expert_smallImage',
330
+ 'expert_thumbnail',
331
+ 'expert_category',
332
+ 'expert_url',
333
+ 'final_price',
334
+ 'entity_id',
335
+ 'attribute_set_id',
336
+ 'type_id',
337
+ 'entity_type_id',
338
+ 'rating_summary');
339
+ $attributes = Mage::getResourceModel('catalog/product_attribute_collection')->getItems();
340
+
341
+ foreach ($attributes as $attribute) {
342
+ $attrCode = $attribute->getAttributeCode();
343
+ if (!in_array($attrCode, $attrArray)) {
344
+ $attrArray[] = $attrCode;
345
+ }
346
+
347
+ }
348
+ return $attrArray;
349
+ }
350
+
351
+ public function getStoredHeaders()
352
+ {
353
+ $storedHeadersArray = array();
354
+ $storedHeaders = Mage::getStoreConfig(self::CONFIG_HEADERS);
355
+ if (isset($storedHeaders))
356
+ {
357
+ $storedHeadersArray = explode(',', $storedHeaders);
358
+ }
359
+ return $storedHeadersArray;
360
+ }
361
+
362
+ /*
363
+ Get all filters function
364
+ */
365
+ public function getAllFilters()
366
+ {
367
+ $filterArray = array(
368
+ 'filter_by_stock',
369
+ 'filter_by_status',
370
+ 'filter_by_visiblity');
371
+
372
+ return $filterArray;
373
+ }
374
+
375
+ public function getStoredFilters()
376
+ {
377
+ $storedFiltersArray = array();
378
+ $storedFilters = Mage::getStoreConfig(self::CONFIG_FILTERS);
379
+
380
+ if(isset($storedFilters))
381
+ {
382
+ $storedFiltersArray = explode(',', $storedFilters);
383
+ }
384
+
385
+ return $storedFiltersArray;
386
+ }
387
+ }
388
+ ?>
app/code/community/Expertrec/Recommendation/Helper/Data.php CHANGED
@@ -65,7 +65,9 @@ class Expertrec_Recommendation_Helper_Data extends Mage_Core_Helper_Abstract {
65
  }
66
 
67
  public function sendCurl($command){
68
- if (isset($ch)) {
 
 
69
  unset($ch);
70
  }
71
 
@@ -75,8 +77,24 @@ class Expertrec_Recommendation_Helper_Data extends Mage_Core_Helper_Abstract {
75
  curl_setopt($ch, CURLOPT_HEADER, 0);
76
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
77
  curl_setopt($ch, CURLOPT_FRESH_CONNECT, 1);
 
 
78
  $str = curl_exec($ch);
79
- } else {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
80
  $str = 'failed';
81
  }
82
 
65
  }
66
 
67
  public function sendCurl($command){
68
+
69
+ if (isset($ch))
70
+ {
71
  unset($ch);
72
  }
73
 
77
  curl_setopt($ch, CURLOPT_HEADER, 0);
78
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
79
  curl_setopt($ch, CURLOPT_FRESH_CONNECT, 1);
80
+ curl_setopt($ch, CURLOPT_NOSIGNAL, 1);
81
+ curl_setopt($ch, CURLOPT_TIMEOUT_MS, 65000);
82
  $str = curl_exec($ch);
83
+ $curl_errno = curl_errno($ch);
84
+ $curl_error = curl_error($ch);
85
+ curl_close($ch);
86
+
87
+ if ($curl_errno > 0)
88
+ {
89
+ Mage::getSingleton("expertrec_recommendation/log")->log("cURL Error ($curl_errno): ".$curl_error);
90
+ }
91
+ else
92
+ {
93
+ Mage::getSingleton("expertrec_recommendation/log")->log("Data received:");
94
+ }
95
+ }
96
+ else
97
+ {
98
  $str = 'failed';
99
  }
100
 
app/code/community/Expertrec/Recommendation/Helper/Searchhelper.php CHANGED
@@ -174,7 +174,7 @@ class Expertrec_Recommendation_Helper_Searchhelper extends Mage_Core_Helper_Abst
174
  $confArray["query"] = $requestParams['q'];
175
  //$confArray["facetPortion"] = $this->getNonQueryUrlParameters($confArray["url"]);
176
 
177
- //setup search url
178
  $searchApi = $this->getSearchApi($confArray);
179
 
180
  if(!empty($searchApi)){
@@ -182,27 +182,36 @@ class Expertrec_Recommendation_Helper_Searchhelper extends Mage_Core_Helper_Abst
182
  //sending request
183
  $resp = Mage::helper('expertrec_recommendation')->sendCurl($searchApi);
184
  $response_json = json_decode($resp,true);
185
-
186
- if(isset($response_json["res"]) && isset($response_json["res"]["count"])){
187
- $confArray["count"] = (int)$response_json["res"]["count"];
188
- }
189
-
190
- //Initiate search layout
191
- $layoutHelper = Mage::helper('expertrec_recommendation/search_layout')->init($confArray);
192
-
193
- $searchListData = $response_json["results"];
194
- $itemIds = array();
195
 
196
- if(isset($searchListData))
 
 
 
 
 
197
  {
198
- Mage::getSingleton('expertrec_recommendation/log')->log("Number of items returned by Expertrec BE ".count($searchListData));
 
 
 
 
 
 
 
 
 
 
 
 
 
199
 
200
- foreach ($searchListData as $item) {
201
- $itemIds[] = $item['entity_id'];
 
 
 
 
202
  }
203
- }
204
-
205
- $this->_resultIds = $itemIds;
206
  }
207
 
208
  }catch (Exception $e) {
174
  $confArray["query"] = $requestParams['q'];
175
  //$confArray["facetPortion"] = $this->getNonQueryUrlParameters($confArray["url"]);
176
 
177
+ //setup search url, if search URL is not empty
178
  $searchApi = $this->getSearchApi($confArray);
179
 
180
  if(!empty($searchApi)){
182
  //sending request
183
  $resp = Mage::helper('expertrec_recommendation')->sendCurl($searchApi);
184
  $response_json = json_decode($resp,true);
 
 
 
 
 
 
 
 
 
 
185
 
186
+ // checking for url-resp
187
+ if(isset($response_json["redirect"]) && isset($response_json["redirect_url"])){
188
+ Mage::app()->getResponse()->setRedirect($response_json["redirect_url"]);
189
+
190
+ }
191
+ else
192
  {
193
+ if(isset($response_json["res"]) && isset($response_json["res"]["count"])){
194
+ $confArray["count"] = (int)$response_json["res"]["count"];
195
+ Mage::getSingleton('expertrec_recommendation/log')->log("The json data is valid");
196
+ }
197
+
198
+ //Initiate search layout
199
+ $layoutHelper = Mage::helper('expertrec_recommendation/search_layout')->init($confArray);
200
+
201
+ $searchListData = $response_json["results"];
202
+ $itemIds = array();
203
+
204
+ if(isset($searchListData))
205
+ {
206
+ Mage::getSingleton('expertrec_recommendation/log')->log("Number of items returned by Expertrec BE ".count($searchListData));
207
 
208
+ foreach ($searchListData as $item) {
209
+ $itemIds[] = $item['entity_id'];
210
+ }
211
+ }
212
+
213
+ $this->_resultIds = $itemIds;
214
  }
 
 
 
215
  }
216
 
217
  }catch (Exception $e) {
app/code/community/Expertrec/Recommendation/Model/Catalogsearch/Layer.php CHANGED
@@ -94,7 +94,7 @@ class Expertrec_Recommendation_Model_Catalogsearch_Layer extends Mage_CatalogSea
94
  $collection->getSelect()->order("find_in_set(e.entity_id, '" . implode(',', $product_ids)."') DESC");
95
  }
96
  }
97
-
98
  Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($collection);
99
  Mage::getSingleton('catalog/product_visibility')->addVisibleInSearchFilterToCollection($collection);
100
  }
94
  $collection->getSelect()->order("find_in_set(e.entity_id, '" . implode(',', $product_ids)."') DESC");
95
  }
96
  }
97
+
98
  Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($collection);
99
  Mage::getSingleton('catalog/product_visibility')->addVisibleInSearchFilterToCollection($collection);
100
  }
app/code/community/Expertrec/Recommendation/Model/Feed/Feedcreator.php CHANGED
@@ -11,6 +11,7 @@
11
  class Expertrec_Recommendation_Model_Feed_Feedcreator {
12
 
13
  const CONFIG_HEADERS = 'expertrec/general/headers';
 
14
  protected $_oWriter;
15
  protected $_ofields=array();
16
 
@@ -97,22 +98,31 @@ class Expertrec_Recommendation_Model_Feed_Feedcreator {
97
  protected function prepareHeaders() {
98
  try{
99
  $storedHeaders = Mage::getStoreConfig(self::CONFIG_HEADERS);
 
100
  if (isset($storedHeaders)){
101
  $header = explode(',', $storedHeaders);
102
  }else{
103
  $header = array();
104
  }
 
 
 
 
 
 
105
 
106
  if(empty($header)){
107
  Mage::getSingleton('expertrec_recommendation/log')->log("Headers are not selected. Go to the info page,select headers and try again.");
108
  return false;
109
  }
110
 
 
111
  //setting header fields array to this, so we can use it later
112
- $this->_ofields=array_merge($header);
113
 
114
  //writing header row
115
- $this->_oWriter->setHeader($header)->writeHeaderRow();
 
116
 
117
  }catch (Exception $e) {
118
  Mage::getSingleton('expertrec_recommendation/log')->log("Error in writing header: ".$e->getMessage());
@@ -134,5 +144,4 @@ class Expertrec_Recommendation_Model_Feed_Feedcreator {
134
  }
135
 
136
 
137
- }
138
- ?>
11
  class Expertrec_Recommendation_Model_Feed_Feedcreator {
12
 
13
  const CONFIG_HEADERS = 'expertrec/general/headers';
14
+ const CONFIG_FILTERS = 'expertrec/general/filters';
15
  protected $_oWriter;
16
  protected $_ofields=array();
17
 
98
  protected function prepareHeaders() {
99
  try{
100
  $storedHeaders = Mage::getStoreConfig(self::CONFIG_HEADERS);
101
+ $storedFilters = Mage::getStoreConfig(self::CONFIG_FILTERS);
102
  if (isset($storedHeaders)){
103
  $header = explode(',', $storedHeaders);
104
  }else{
105
  $header = array();
106
  }
107
+ if (isset($storedFilters)){
108
+ $filter = explode(',', $storedFilters);
109
+ }
110
+ else{
111
+ $filter = array();
112
+ }
113
 
114
  if(empty($header)){
115
  Mage::getSingleton('expertrec_recommendation/log')->log("Headers are not selected. Go to the info page,select headers and try again.");
116
  return false;
117
  }
118
 
119
+ $totalHeaders = array_merge($header,$filter);
120
  //setting header fields array to this, so we can use it later
121
+ $this->_ofields=array_merge($header,$filter);
122
 
123
  //writing header row
124
+ $this->_oWriter->setHeader($totalHeaders)->writeHeaderRow();
125
+ //$this->_oWriter->setHeader($filter)->writeHeaderRow();
126
 
127
  }catch (Exception $e) {
128
  Mage::getSingleton('expertrec_recommendation/log')->log("Error in writing header: ".$e->getMessage());
144
  }
145
 
146
 
147
+ }
 
app/code/community/Expertrec/Recommendation/Model/Feed/Formatter.php CHANGED
@@ -5,6 +5,8 @@ class Expertrec_Recommendation_Model_Feed_Formatter {
5
  //getting image width and height from db
6
  const IMAGE_WIDTH = 'expertrec/general/expertrec_image_width';
7
  const IMAGE_HEIGHT = 'expertrec/general/expertrec_image_height';
 
 
8
 
9
  protected $_oConfig= array();
10
 
@@ -37,11 +39,23 @@ class Expertrec_Recommendation_Model_Feed_Formatter {
37
  $vValue = $this->_getCategories($product);
38
  break;
39
  case 'expert_url':
40
- $vValue=$product->getProductUrl();
 
 
 
41
  break;
42
  case 'qty':
43
  $vValue = (int)$product->getData("qty");
44
  break;
 
 
 
 
 
 
 
 
 
45
  default:
46
  $vValue =$product->getData($skey);
47
 
@@ -68,25 +82,35 @@ class Expertrec_Recommendation_Model_Feed_Formatter {
68
  $width = Mage::getStoreConfig(self::IMAGE_WIDTH);
69
  $height = Mage::getStoreConfig(self::IMAGE_HEIGHT);
70
 
71
- if('expert_image' == $fieldName && $this->_oConfig['generateImage']){
72
- return (string)Mage::helper('catalog/image')->init($product, 'image')->resize($this->_oConfig['imageWidth'], $this->_oConfig['imageHeight']);
73
- }
74
- else if(!empty($width) && !empty($height)){
75
- return (string)Mage::helper('catalog/image')->init($product, 'image')->resize($width, $height);
76
- }
77
- else if(empty($width) && !empty($height)){
78
- return (string)Mage::helper('catalog/image')->init($product, 'image')->resize($this->_oConfig['imageWidth'], $height);
79
- }
80
- else if(empty($height) && !empty($width)){
81
- return (string)Mage::helper('catalog/image')->init($product, 'image')->resize($width, $this->_oConfig['imageHeight']);
82
- }
83
- else if(empty($height) && empty($width)){
84
- return (string)Mage::helper('catalog/image')->init($product, 'image')->resize($this->_oConfig['imageWidth'], $this->_oConfig['imageHeight']);
 
85
  }
86
  else if('expert_smallImage' == $fieldName){
87
  return (string)Mage::helper('catalog/image')->init($product, 'image')->resize(250,250);
88
- } else if ('expert_thumbnail' == $fieldName) {
89
- return (string)Mage::helper('catalog/image')->init($product, 'image')->resize(80,80);
 
 
 
 
 
 
 
 
 
90
  }
91
  } catch (Exception $e) {
92
  Mage::getSingleton('expertrec_recommendation/log')->log("Error while fetching the image" . $e->getMessage());
@@ -95,4 +119,3 @@ class Expertrec_Recommendation_Model_Feed_Formatter {
95
  return Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) . 'catalog/product' . $product->getData('image');
96
  }
97
  }
98
- ?>
5
  //getting image width and height from db
6
  const IMAGE_WIDTH = 'expertrec/general/expertrec_image_width';
7
  const IMAGE_HEIGHT = 'expertrec/general/expertrec_image_height';
8
+ const THUMBNAIL_WIDTH = 'expertrec/general/expertrec_thumbnail_width';
9
+ const THUMBNAIL_HEIGHT = 'expertrec/general/expertrec_thumbnail_height';
10
 
11
  protected $_oConfig= array();
12
 
39
  $vValue = $this->_getCategories($product);
40
  break;
41
  case 'expert_url':
42
+ //$vValue=$product->getProductUrl();
43
+ //changing ProductUrl from /index.php/catalog/product/view/id/539/s/racer-back-maxi-dress/ to /index.php/racer-back-maxi-dress.html
44
+ $url = Mage::getBaseUrl().$product->url_path;
45
+ $vValue=$url;
46
  break;
47
  case 'qty':
48
  $vValue = (int)$product->getData("qty");
49
  break;
50
+ case 'filter_by_stock':
51
+ $vValue = 0;
52
+ break;
53
+ case 'filter_by_status':
54
+ $vValue = 2;
55
+ break;
56
+ case 'filter_by_visiblity':
57
+ $vValue = array(1,2,3,4);
58
+ break;
59
  default:
60
  $vValue =$product->getData($skey);
61
 
82
  $width = Mage::getStoreConfig(self::IMAGE_WIDTH);
83
  $height = Mage::getStoreConfig(self::IMAGE_HEIGHT);
84
 
85
+ $twidth = Mage::getStoreConfig(self::THUMBNAIL_WIDTH);
86
+ $theight = Mage::getStoreConfig(self::THUMBNAIL_HEIGHT);
87
+
88
+ if('expert_image' == $fieldName ){
89
+ if($this->_oConfig['generateImage']){
90
+ return (string)Mage::helper('catalog/image')->init($product, 'image')->resize($this->_oConfig['imageWidth'], $this->_oConfig['imageHeight']);
91
+ }else if(!empty($width) && !empty($height)){
92
+ return (string)Mage::helper('catalog/image')->init($product, 'image')->resize($width, $height);
93
+ }else if(empty($width) && !empty($height)){
94
+ return (string)Mage::helper('catalog/image')->init($product, 'image')->resize($this->_oConfig['imageWidth'], $height);
95
+ }else if(empty($height) && !empty($width)){
96
+ return (string)Mage::helper('catalog/image')->init($product, 'image')->resize($width, $this->_oConfig['imageHeight']);
97
+ }else if(empty($height) && empty($width)){
98
+ return (string)Mage::helper('catalog/image')->init($product, 'image')->resize($this->_oConfig['imageWidth'], $this->_oConfig['imageHeight']);
99
+ }
100
  }
101
  else if('expert_smallImage' == $fieldName){
102
  return (string)Mage::helper('catalog/image')->init($product, 'image')->resize(250,250);
103
+ }
104
+ else if ('expert_thumbnail' == $fieldName) {
105
+ if(!empty($twidth) && !empty($theight)){
106
+ return (string)Mage::helper('catalog/image')->init($product, 'thumbnail')->resize($twidth, $theight);
107
+ }else if(empty($twidth) && !empty($theight)){
108
+ return (string)Mage::helper('catalog/image')->init($product, 'thumbnail')->resize(80, $theight);
109
+ }else if(empty($theight) && !empty($twidth)){
110
+ return (string)Mage::helper('catalog/image')->init($product, 'thumbnail')->resize($twidth, 80);
111
+ }else if(empty($theight) && empty($twidth)){
112
+ return (string)Mage::helper('catalog/image')->init($product, 'thumbnail')->resize(80,80);
113
+ }
114
  }
115
  } catch (Exception $e) {
116
  Mage::getSingleton('expertrec_recommendation/log')->log("Error while fetching the image" . $e->getMessage());
119
  return Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) . 'catalog/product' . $product->getData('image');
120
  }
121
  }
 
app/code/community/Expertrec/Recommendation/Model/Log.php CHANGED
@@ -24,7 +24,7 @@ class Expertrec_Recommendation_Model_Log {
24
  public function log($message, $level = Zend_Log::INFO, $bDeveloperModeOnly = false) {
25
 
26
  try{
27
- $vFeedDir = Mage::getBaseDir().self::FEED_PATH;
28
  if (!is_dir($vFeedDir)) {
29
  $vFeedDir_status=mkdir($vFeedDir);
30
  if(!$vFeedDir_status){
24
  public function log($message, $level = Zend_Log::INFO, $bDeveloperModeOnly = false) {
25
 
26
  try{
27
+ $vFeedDir = "/tmp".self::FEED_PATH;
28
  if (!is_dir($vFeedDir)) {
29
  $vFeedDir_status=mkdir($vFeedDir);
30
  if(!$vFeedDir_status){
app/code/community/Expertrec/Recommendation/Model/Observer.php CHANGED
@@ -169,6 +169,7 @@ class Expertrec_Recommendation_Model_Observer {
169
  ->setPrepareRequestStatus(false)
170
  ->setUserId('expertrec')
171
  ->setUrl($finalUrl)
 
172
  ->setData(array('item' => $product->getId()))
173
  ->setPrepareRequestStatus(true)
174
  ->sendRequest();
@@ -205,7 +206,9 @@ class Expertrec_Recommendation_Model_Observer {
205
  }
206
 
207
  if(!empty($header)){
208
- $finalUrl = $this->getFeedEndpoint();
 
 
209
  if(empty($finalUrl)){
210
  return $this;
211
  }
@@ -236,6 +239,64 @@ class Expertrec_Recommendation_Model_Observer {
236
  return $this;
237
  }
238
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
239
  protected function getFeedEndpoint(){
240
  try{
241
  $endpoint = Mage::getStoreConfig(self::FEED_LOG_ENDPOINT);
169
  ->setPrepareRequestStatus(false)
170
  ->setUserId('expertrec')
171
  ->setUrl($finalUrl)
172
+ ->setMethod(Zend_Http_Client::DELETE)
173
  ->setData(array('item' => $product->getId()))
174
  ->setPrepareRequestStatus(true)
175
  ->sendRequest();
206
  }
207
 
208
  if(!empty($header)){
209
+ // passing product to identify product url
210
+ $feedUrl = $this->getFeedEndpoint();
211
+ $finalUrl = $feedUrl.'/product';
212
  if(empty($finalUrl)){
213
  return $this;
214
  }
239
  return $this;
240
  }
241
 
242
+ /**
243
+ * Method to track save Category
244
+ */
245
+
246
+ public function saveCategory($observer){
247
+ $logger = Mage::getSingleton('expertrec_recommendation/log');
248
+ $category = $observer->getEvent()->getCategory();
249
+
250
+ $logger->log("Hook on category after save");
251
+
252
+ // get category url
253
+ $store = Mage::app()->getStore();
254
+ $category_url = $store->getBaseUrl().$category->getUrlPath();
255
+
256
+ // get path with name
257
+ $pathIdArray = explode('/', $category->getPath());
258
+ $storeId = $store->getId();
259
+ $pathNameArray = array();
260
+
261
+ for($i=0;$i<count($pathIdArray);$i++){
262
+ $categoryy = Mage::getModel('catalog/category')->setStoreId($storeId)->load($pathIdArray[$i]);
263
+ $pathNameArray[$i] = $categoryy->getName();
264
+ }
265
+ //removing Root catalog which is $pathNameArrray[0]
266
+ array_shift($pathNameArray);
267
+ $category_path = implode('/', $pathNameArray);
268
+
269
+ $categoryArray = array('categoryId' => $category->getId(),
270
+ 'categoryName' => $category->getName(),
271
+ 'categoryPath' => $category_path,
272
+ 'categoryUrl' => $category_url);
273
+
274
+ // passing category to identify category url
275
+ $feedUrl = $this->getFeedEndpoint();
276
+ $finalUrl = $feedUrl.'/category';
277
+ if(empty($finalUrl)){
278
+ return $this;
279
+ }
280
+
281
+ //sending request
282
+ $response = Mage::getModel('expertrec_recommendation/api_request')
283
+ ->setPrepareRequestStatus(false)
284
+ ->setUserId('expertrec')
285
+ ->setUrl($finalUrl)
286
+ ->setMethod(Zend_Http_Client::POST)
287
+ ->setData($categoryArray)
288
+ ->setHeader("Content-Type",'application/json')
289
+ ->setPrepareRequestStatus(true)
290
+ ->sendRequest();
291
+
292
+ if(!$response) {
293
+ $logger->log('request failed for category with Id #'.$category->getId());
294
+ }
295
+
296
+ return $this;
297
+
298
+ }
299
+
300
  protected function getFeedEndpoint(){
301
  try{
302
  $endpoint = Mage::getStoreConfig(self::FEED_LOG_ENDPOINT);
app/code/community/Expertrec/Recommendation/Model/Writer/Abstract.php CHANGED
@@ -30,7 +30,7 @@ abstract class Expertrec_Recommendation_Model_Writer_Abstract extends Varien_Obj
30
  abstract function close();
31
 
32
  protected function _getFilename($vStoreCode, $vFeedname) {
33
- $vFeedDir = Mage::getBaseDir().self::FEED_PATH;
34
  if (!is_dir($vFeedDir)) {
35
  $vFeedDir_status=mkdir($vFeedDir);
36
  if(!$vFeedDir_status){
30
  abstract function close();
31
 
32
  protected function _getFilename($vStoreCode, $vFeedname) {
33
+ $vFeedDir = "/tmp".self::FEED_PATH;
34
  if (!is_dir($vFeedDir)) {
35
  $vFeedDir_status=mkdir($vFeedDir);
36
  if(!$vFeedDir_status){
app/code/community/Expertrec/Recommendation/controllers/Adminhtml/IndexController.php CHANGED
@@ -6,5 +6,9 @@ class Expertrec_Recommendation_Adminhtml_IndexController extends Mage_Core_Contr
6
  public function indexAction(){
7
  return $this->_redirectUrl("https://magento.expertrec.com/autocomplete/signup");
8
  }
 
 
 
 
9
  }
10
  ?>
6
  public function indexAction(){
7
  return $this->_redirectUrl("https://magento.expertrec.com/autocomplete/signup");
8
  }
9
+ // added support email
10
+ public function mailAction(){
11
+ return $this->_redirectUrl("mailto:support@expertrec.com?/");
12
+ }
13
  }
14
  ?>
app/code/community/Expertrec/Recommendation/controllers/ApiController.php CHANGED
@@ -1,31 +1,13 @@
1
  <?php
2
 
3
  class Expertrec_Recommendation_ApiController extends Mage_Core_Controller_Front_Action {
4
-
5
- const CONFIG_HEADERS = 'expertrec/general/headers';
6
- const SEARCH_LIST_ENABLE = 'search/enable';
7
- const SEARCH_LIST_API = 'search/api';
8
- const SEARCH_FACET_LIST = 'search/facets_list';
9
- const SEARCH_SINGLE_SELECT_FILTERS = 'search/single_select_filters';
10
- const SEARCH_IS_AJAX = 'search/is_ajax';
11
- const SEARCH_ITEMS_PER_PAGE = 'search/items_per_page';
12
- const SEARCH_DISPLAY_PAGES = 'search/display_pages';
13
- const SEARCH_FETCH_PRICE = 'search/fetch_price';
14
- const SEARCH_CONVERT_PRICE = 'search/convert_price';
15
- const SEARCH_CUSTOM_TEMPLATE = 'search/custom_template';
16
- const FEED_LOG_ENDPOINT = 'log_endpoint';
17
- const FEED_UPLOAD_ENDPOINT = 'upload_endpoint';
18
- const IS_UPLOAD_FEED = 'is_upload';
19
- const IMAGE_WIDTH = 'expertrec/general/expertrec_image_width';
20
- const IMAGE_HEIGHT = 'expertrec/general/expertrec_image_height';
21
-
22
- const BUILD_NO = "1485340832";
23
  private $_password;
24
 
25
- // return websites and stores information
26
- public function infoAction(){
27
-
28
- //return array of all parameters sent
29
  $requestParams = Mage::app()->getRequest()->getParams();
30
 
31
  $Password = isset($requestParams['secret']) ? $requestParams['secret'] : '';
@@ -34,524 +16,12 @@ class Expertrec_Recommendation_ApiController extends Mage_Core_Controller_Front_
34
  if(!Mage::getModel('expertrec_recommendation/validate')->checkPassword($Password)){
35
  die('ERROR: The specified password is invalid.');
36
  }
37
-
38
- $this->_password = Mage::getModel('expertrec_recommendation/validate')->getPassword();
39
-
40
- // Set character set to UTF-8
41
- header("Content-Type: text/html; charset=UTF-8");
42
- ?>
43
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
44
- <html xmlns="http://www.w3.org/1999/xhtml">
45
- <head>
46
- <meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
47
- <title>Expertrec Feed Collection Api</title>
48
- <link rel="stylesheet" type="text/css" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
49
- <style type="text/css">
50
- table {border-spacing: 0;border-collapse: collapse;width: 100%;}
51
- .table-hover > tbody > tr:hover {background-color: #f5f5f5;}
52
- tbody td, thead th{padding: 8px;line-height: 1.42857143;vertical-align: top;border-top: 1px solid #ddd;text-align:left;}
53
- thead:first-child > tr:first-child > th {border-top: 0;}
54
- thead th {vertical-align: bottom;border-bottom:2px solid #ddd;background-color:#f5f5f5;text-align:center;}
55
- fieldset { display: block;margin:10px 2px;padding: .35em .625em .75em; border: 1px solid silver; }
56
- legend{padding: 0px 5px; width: auto; border: 0px none;margin:0;}
57
- fieldset p { text-align: left; display: block; }
58
- #searchConfSection input[type="checkbox"]{bottom: 2px;}
59
- </style>
60
- </head>
61
- <body>
62
- <div class="container-fluid">
63
- <?php
64
- $version = (string)Mage::getConfig()->getNode('modules/Expertrec_Recommendation/version');
65
- echo "<h4 style='margin:20px auto 10px;'>Extension Version: <span style='color:red;'>".$version."</span></h4>";
66
- echo "<h4 style='margin:10px auto;'>Extension Build No.: <span style='color:red;'>".self::BUILD_NO."</span></h4>";
67
- try{
68
- echo "<h4 style='margin:10px auto;'>Magento Version: <span style='color:red;'>".Mage::getVersion()."</span></h4>";
69
- }catch(Exception $em){};
70
- ?>
71
- <ul class="nav nav-tabs" style="margin-top:20px;">
72
- <li class="active"><a data-toggle="tab" href="#apiSection">Api</a></li>
73
- <li><a data-toggle="tab" href="#feedHeader">Feed Header</a></li>
74
- <li><a data-toggle="tab" href="#feedEndpointSection">Feed Config</a></li>
75
- <li><a data-toggle="tab" href="#searchConfSection">Search</a></li>
76
- <li><a data-toggle="tab" href="#siteDetailsSection">Details</a></li>
77
- </ul>
78
- <div style="clear:both;"></div>
79
- <div class="tab-content">
80
- <div id="apiSection" class="tab-pane fade in active">
81
- <div style="margin-top:20px;">
82
- <fieldset>
83
- <legend>Getting Feeds Api</legend>
84
- <table class="table-hover" style="margin: 1em auto;">
85
- <thead>
86
- <tr>
87
- <th>Website ID</th>
88
- <th>Website Name</th>
89
- <th>Store ID</th>
90
- <th>Store Name</th>
91
- <th>Total Pages</th>
92
- <th>Url</th>
93
- </tr>
94
- </thead>
95
- <tbody>
96
- <?php
97
-
98
- //site url
99
- $baseUrl=Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
100
- $feedFilter = Mage::getSingleton('expertrec_recommendation/feed_feedfilter');
101
-
102
- // List all website-stores
103
- $websiteCollection = Mage::getModel('core/website')->getCollection()->load();
104
- foreach ($websiteCollection as $website){
105
- $wid=$website->getWebsiteId();
106
- foreach ($website->getGroups() as $group) {
107
- $stores = $group->getStores();
108
- foreach ($stores as $oStore) {
109
- $sid=$oStore->getId();
110
- $apiUrl=$baseUrl.'index.php/expertrec-feed?secret='.$this->_password.'&cmd=export&wid='.$wid.'&sid='.$sid;
111
- // Display the store-website details with feed api
112
- echo '<tr>';
113
- echo '<td style="text-align:center;">'.$wid.'</td>';
114
- echo '<td style="text-align:center;">'.$website->getName().'</td>';
115
- echo '<td style="text-align:center;">'.$sid.'</td>';
116
- echo '<td style="text-align:center;">'.$oStore->getName().'</td>';
117
- try{
118
- $collection=$feedFilter->addBasicFilter($website,$oStore)
119
- ->setPageSize(500);
120
- $pages = $collection->getLastPageNumber();
121
- echo '<td style="text-align:center;">'.(string)$pages.'</td>';
122
-
123
- }catch(Exception $e){
124
- echo '<td style="text-align:center;"><b style="color:red;">Error: </b>'.$e->getMessage().'</td>';
125
- }
126
- echo '<td><a href="'.$apiUrl.'">'.$apiUrl.'</a></td>';
127
- echo '</tr>';
128
- }
129
- }
130
- }
131
-
132
- ?>
133
- </tbody>
134
- </table>
135
- </fieldset>
136
-
137
- </div>
138
- <p>
139
- <strong>Note:</strong><br />
140
- <span>
141
- 1. Each page contains 500 products.<br />
142
- 2. For Getting custom image size, kindly add <b>width</b> and <b>height</b> parameter in the api url.
143
- </span>
144
- </p>
145
- <fieldset>
146
- <legend>Example</legend>
147
- <?php
148
-
149
- $apiUrlWithCustomConf=$baseUrl.'index.php/expertrec-feed?secret='.$this->_password.'&cmd=export&wid=1&sid=1';
150
-
151
- echo '<p><b>With Custom image size</b><br />';
152
- echo '<p><a href="'.$apiUrlWithCustomConf.'&width=170&height=170">'.$apiUrlWithCustomConf.'&width=170&height=170</a></p>';
153
-
154
- echo '<p><b>With pagination without page size(default page size is 500)</b><br />';
155
- echo '<p><a href="'.$apiUrlWithCustomConf.'&ps=1&pe=2">'.$apiUrlWithCustomConf.'&ps=1&pe=2</a></p>';
156
-
157
- echo '<p><b>With pagination & page size</b><br />';
158
- echo '<p><a href="'.$apiUrlWithCustomConf.'&ps=1&pe=2&psize=50">'.$apiUrlWithCustomConf.'&ps=1&pe=2&psize=50</a></p>';
159
- echo '</fieldset>';
160
-
161
- echo $this->displaySuggestionApi($baseUrl);
162
- echo $this->displayLogApi($baseUrl);
163
- ?>
164
-
165
- </div> <!-- api section end -->
166
-
167
- <!-- header section start -->
168
- <div id="feedHeader" class="tab-pane fade">
169
- <div style="margin-top:20px">
170
- <?php
171
- $allAttribute = $this->getAllAttributes();
172
- //display header form
173
- echo $this->displayHeaderForm($baseUrl,$allAttribute);
174
- ?>
175
- </div>
176
- </div> <!-- header section end -->
177
-
178
- <!-- Feed api configuration section start -->
179
- <div id="feedEndpointSection" class="tab-pane fade">
180
- <div style="margin-top:20px">
181
- <?php echo $this->displayFeedConf($baseUrl); ?>
182
- </div>
183
- </div>
184
- <!-- Feed api configuration section end -->
185
-
186
- <!-- search section start -->
187
- <div id="searchConfSection" class="tab-pane fade">
188
- <div style="margin-top:20px">
189
- <?php echo $this->displaySearchConf($baseUrl); ?>
190
- </div>
191
- </div>
192
-
193
- <!-- site details -->
194
- <div id="siteDetailsSection" class="tab-pane fade">
195
- <div style="margin-top:20px">
196
- <?php echo $this->displaySiteDetails(); ?>
197
- </div>
198
- </div>
199
- </div> <!-- tab-content end-->
200
- </div> <!-- container-fluid end-->
201
- <!-- script section-->
202
- <script src="//ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
203
- <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
204
-
205
- </body>
206
- </html>
207
- <?php
208
-
209
- }
210
-
211
- private function displayLogApi($baseUrl){
212
- $result = '<div style="margin-top:20px">';
213
- $result .= '<fieldset>';
214
- $result .= '<legend>Getting log & Cleaning Expertrec Directory Api\'s</legend>';
215
-
216
- $logUrl = $baseUrl.'index.php/expertrec-feed/index/getlog?secret='.$this->_password;
217
- $cleanDirUrl = $baseUrl.'index.php/expertrec-feed/index/clean?secret='.$this->_password;
218
-
219
- $result .= '<p><b>Get log url</b><br />';
220
- $result .= '<p><a href="'.$logUrl.'">'.$logUrl.'</a></p>';
221
- $result .= '<p><b>Clean directory url</b><br />';
222
- $result .= '<p><a href="'.$cleanDirUrl.'" target="_blank">'.$cleanDirUrl.'</a></p>';
223
-
224
- $result .= '</fieldset>';
225
- $result .= '</div>';
226
-
227
- return $result;
228
-
229
- }
230
-
231
- private function displaySuggestionApi($baseUrl){
232
- $result = '<div style="margin-top:20px">';
233
- $result .= '<fieldset>';
234
- $result .= '<legend>Getting Popular products Api</legend>';
235
-
236
- $apiUrlWithCustomConf=$baseUrl.'index.php/expertrec-feed?secret='.$this->_password.'&cmd=getpp&wid=1&sid=1';
237
-
238
- $result .= '<p><b>Without pagination</b><br />';
239
- $result .= '<p><a href="'.$apiUrlWithCustomConf.'">'.$apiUrlWithCustomConf.'</a></p>';
240
-
241
- $result .= '<p><b>With pagination without page size(default page size is 500)</b><br />';
242
- $result .= '<p><a href="'.$apiUrlWithCustomConf.'&ps=1&pe=2">'.$apiUrlWithCustomConf.'&ps=1&pe=2</a></p>';
243
-
244
- $result .= '<p><b>With pagination & page size</b><br />';
245
- $result .= '<p><a href="'.$apiUrlWithCustomConf.'&ps=1&pe=2&psize=50">'.$apiUrlWithCustomConf.'&ps=1&pe=2&psize=50</a></p>';
246
-
247
- $result .= '</fieldset>';
248
- $result .= '</div>';
249
-
250
- return $result;
251
- }
252
-
253
- private function getAllAttributes(){
254
- $attrArray = array('qty','is_in_stock','expert_image','expert_smallImage','expert_thumbnail','expert_category','expert_url','final_price','entity_id','attribute_set_id','type_id','entity_type_id','rating_summary');
255
- $attributes = Mage::getResourceModel('catalog/product_attribute_collection')->getItems();
256
-
257
- foreach ($attributes as $attribute) {
258
- $attrCode = $attribute->getAttributeCode();
259
- if (!in_array($attrCode, $attrArray)) {
260
- $attrArray[] = $attrCode;
261
- }
262
-
263
- }
264
- return $attrArray;
265
- }
266
-
267
- private function displayHeaderForm($baseUrl,$attributes){
268
- $saveHeaderUrl = $baseUrl."index.php/expertrec-feed/config/saveheaders?secret=".$this->_password;
269
-
270
- $result = '<style type="text/css"> .setHeadersForm label{padding:0px 10px 10px 0px;} .setHeadersForm input{vertical-align: middle;} </style>';
271
-
272
- $result .= '<script type="text/javascript">';
273
- $result .= 'function toggle_select(){var checkboxes = document.getElementsByName("check_list[]"); var button = document.getElementById("toggleSelect"); if(button.value == "Select All"){for (var i in checkboxes){checkboxes[i].checked = "checked"; } button.value = "Deselect All"}else{for (var i in checkboxes){checkboxes[i].checked = ""; } button.value = "Select All";}}';
274
- $result .= '</script>';
275
-
276
- $storedHeaders = Mage::getStoreConfig(self::CONFIG_HEADERS);
277
- if (isset($storedHeaders)){
278
- $storedHeadersArray = explode(',', $storedHeaders);
279
- }
280
-
281
- $result .= '<fieldset>';
282
- $result .= '<legend>Configure Feed Headers</legend>';
283
-
284
- $result .= '<form class="setHeadersForm" action="'.$saveHeaderUrl.'" method="post" role="form" target="_blank">';
285
-
286
- foreach ($attributes as $attr) {
287
- if (isset($storedHeadersArray) && in_array($attr, $storedHeadersArray)){
288
- $result .= '<input type="checkbox" id="'.$attr.'" name="check_list[]" value="'.$attr.'" checked>';
289
- }else{
290
- $result .= '<input type="checkbox" id="'.$attr.'" name="check_list[]" value="'.$attr.'">';
291
- }
292
- $result .= '<label for="'.$attr.'">'.$attr.'</label>';
293
- }
294
-
295
- // adding image width and height
296
- $result .= '<div style="display:block"><label for="imagewidth">Image Width</label><input type="text" id="imagewidth" name="imagewidth" placeholder="Give image width" value="'.Mage::getStoreConfig(self::IMAGE_WIDTH).'"></div>';
297
- $result .= '<div style="display:block"><label for="imageheight">Image Height</label><input type="text" id="imageheight" name="imageheight" placeholder="Give image height" value="'.Mage::getStoreConfig(self::IMAGE_HEIGHT).'"></div>';
298
-
299
- $result .= '<div style="text-align:center;margin:10px auto;"> ';
300
- $result .= '<input type="button" class="btn btn-md btn-primary" id="toggleSelect" value="Select All" onClick="toggle_select()" style="padding:5px; margin: 5px;"/>';
301
- $result .= '<input type="submit" class="btn btn-md btn-primary" name="selected_headers" value="Submit" style= "padding:5px; margin: 5px;"/>';
302
- $result .= '</div>';
303
- $result .= '</form>';
304
- $result .= '</fieldset>';
305
-
306
- $result .= '<fieldset style="margin-top:20px;">';
307
- $result .= '<legend>Selected Headers</legend>';
308
- $result .= '<div class="setHeadersForm">';
309
-
310
- if (isset($storedHeadersArray) && count($storedHeadersArray) > 0){
311
- foreach ($storedHeadersArray as $header) {
312
- $result .= '<input type="checkbox" name="'.$header.'" value="'.$header.'" disabled checked>';
313
- $result .= '<label>'.$header.'</label>';
314
- }
315
- }
316
-
317
- $result .= '</div>';
318
- $result .= '</fieldset>';
319
-
320
- return $result;
321
- }
322
-
323
- private function displaySearchConf($baseUrl){
324
- $saveSearchUrl = $baseUrl."index.php/expertrec-feed/config/savesearch?secret=".$this->_password;
325
- $result = '<fieldset>';
326
- $result .= '<legend>Configure Search</legend>';
327
- $result .= '<form class="form-horizontal" action="'.$saveSearchUrl.'" method="post" role="form" target="_blank">';
328
-
329
- $textArray = array("api"=>"Search endpoint", "facet_list"=>"Facet list comma separated", "single_select_filter"=>"Single select filters comma separated", "items_per_page"=>"No of items per page","display_pages"=>"No. of pages to display");
330
-
331
- $textToStoreKeyMapArray = array("api"=>self::SEARCH_LIST_API,"facet_list"=>self::SEARCH_FACET_LIST,"single_select_filter"=>self::SEARCH_SINGLE_SELECT_FILTERS,"items_per_page"=>self::SEARCH_ITEMS_PER_PAGE,"display_pages"=>self::SEARCH_DISPLAY_PAGES);
332
-
333
- $chekboxArray = array("search_enable"=>self::SEARCH_LIST_ENABLE,"fetch_price"=>self::SEARCH_FETCH_PRICE,"convert_price"=>self::SEARCH_CONVERT_PRICE,"is_ajax"=>self::SEARCH_IS_AJAX,"custom_template"=>self::SEARCH_CUSTOM_TEMPLATE);
334
-
335
- // input
336
- foreach ($textArray as $tKey => $tValue) {
337
- $label = ucwords(str_replace("_", " ", $tKey));
338
- $storeValue = Mage::helper('expertrec_recommendation')->getConfig($textToStoreKeyMapArray[$tKey]);
339
-
340
- $result .= '<div class="form-group">';
341
- $result .= '<label class="control-label col-sm-2" for="search_'.$tKey.'">'.$label.':</label>';
342
- $result .= '<div class="col-sm-8">';
343
- if(isset($storeValue)){
344
- $result .= '<input type="text" class="form-control" name="'.$tKey.'" value="'.$storeValue.'" id="search_'.$tKey.'" placeholder="'.$tValue.'">';
345
- }else{
346
- $result .= '<input type="text" class="form-control" name="'.$tKey.'" id="search_'.$tKey.'" placeholder="'.$tValue.'">';
347
- }
348
- $result .= '</div>';
349
- $result .= '</div>';
350
- }
351
-
352
- //checkbox
353
- $result .= '<div class="form-group">';
354
- $result .= '<div class="col-sm-2"></div>';
355
- $result .= '<div class="col-sm-8">';
356
- foreach ($chekboxArray as $cKey => $cValue) {
357
- $label = ucwords(str_replace("_", " ", $cKey));
358
- $storeValue = Mage::helper('expertrec_recommendation')->getConfig($cValue);
359
- $checked = isset($storeValue) && $storeValue == "true" ? "checked" :'';
360
-
361
- $result .= '<div class="col-sm-2">';
362
- $result .= '<div class="checkbox">';
363
- $result .= '<label><input type="checkbox" name="search_check_list[]" value="'.$cKey.'" '.$checked.'>'.$label.'</label>';
364
- $result .= '</div>';
365
- $result .= '</div>';
366
-
367
- }
368
- $result .= '</div>';
369
- $result .= '</div>';
370
- $result .= '<div style="text-align:center;margin:10px auto;">';
371
- $result .= '<input type="submit" class="btn btn-md btn-primary" name="selected_search" value="Submit" style="padding:5px; "/>';
372
- $result .= '</div>';
373
- $result .= '</form>';
374
- $result .= '</fieldset>';
375
-
376
- return $result;
377
-
378
- }
379
-
380
- private function displayFeedConf($baseUrl){
381
- $saveFeedApiUrl = $baseUrl."index.php/expertrec-feed/config/savefeedconf?secret=".$this->_password;
382
- $result = '<fieldset>';
383
- $result .= '<legend>Configure Search</legend>';
384
- $result .= '<form class="form-horizontal" action="'.$saveFeedApiUrl.'" method="post" role="form" target="_blank">';
385
-
386
- $textArray = array("log_api"=>"Feed log endpoint", "upload_api"=>"Feed upload endpoint");
387
- $textToStoreKeyMapArray = array("log_api"=>self::FEED_LOG_ENDPOINT,"upload_api"=>self::FEED_UPLOAD_ENDPOINT);
388
-
389
- foreach ($textArray as $tKey => $tValue) {
390
- $label = ucwords(str_replace("_", " ", $tKey));
391
- $storeValue = Mage::helper('expertrec_recommendation')->getConfig($textToStoreKeyMapArray[$tKey]);
392
-
393
- $result .= '<div class="form-group">';
394
- $result .= '<label class="control-label col-sm-2" for="search_'.$tKey.'">'.$label.':</label>';
395
- $result .= '<div class="col-sm-8">';
396
-
397
- if(isset($storeValue)){
398
- $result .= '<input type="text" class="form-control" name="'.$tKey.'" value="'.$storeValue.'" placeholder="'.$tValue.'">';
399
- }else{
400
- $result .= '<input type="text" class="form-control" name="'.$tKey.'" placeholder="'.$tValue.'">';
401
- }
402
- $result .= '</div>';
403
- $result .= '</div>';
404
- }
405
-
406
- //enable/disable feed upload
407
- $isUpload = Mage::helper('expertrec_recommendation')->getConfig(self::IS_UPLOAD_FEED);
408
- $result .= '<div class="row">';
409
- $result .='<div class="col-sm-offset-2 col-sm-8" style="clear:both;">';
410
- $result .= '<label class="checkbox-inline" style="padding-left: 20px;">';
411
- if(isset($isUpload) && $isUpload == 'true'){
412
- $result .= '<input type="checkbox" name="upload_feed" value="is_upload" checked>';
413
- }else{
414
- $result .= '<input type="checkbox" name="upload_feed" value="is_upload">';
415
- }
416
- $result .= 'Upload Feed';
417
- $result .= '</label>';
418
- $result .= '</div>';
419
- $result .= '</div>';
420
-
421
- $result .= '<div style="text-align:center;margin:10px auto;">';
422
- $result .= '<input type="submit" class="btn btn-md btn-primary" name="feed_conf" value="Submit" style="padding:5px; "/>';
423
- $result .= '</div>';
424
-
425
- $result .= '</form>';
426
- $result .= '</fieldset>';
427
-
428
- return $result;
429
- }
430
-
431
- private function displaySiteDetails(){
432
- $result = '<fieldset>';
433
- $result .= '<legend>Site Info</legend>';
434
- $result .= '<table class="table table-hover">';
435
- $result .= '<tbody>';
436
- try{
437
- $adminEmail = Mage::getStoreConfig('trans_email/ident_general/email');
438
- $adminName = Mage::getStoreConfig('trans_email/ident_general/name');
439
- $salesEmail = Mage::getStoreConfig('trans_email/ident_sales/email');
440
- $salesName = Mage::getStoreConfig('trans_email/ident_sales/name');
441
- $secureUrl = Mage::getStoreConfig('web/secure/base_url');
442
- $unsecureUrl = Mage::getStoreConfig('web/unsecure/base_url');
443
- $baseCurrency = Mage::getStoreConfig('currency/options/base');
444
- $defaultCurrency = Mage::getStoreConfig('currency/options/default');
445
- $allowCurrency = Mage::getStoreConfig('currency/options/allow');
446
- $timezone = Mage::getStoreConfig('general/locale/timezone');
447
- $defaultCountry = Mage::getStoreConfig('general/country/default');
448
- $installedCurrency = Mage::getStoreConfig('system/currency/installed');
449
- }catch(Exception $e){}
450
-
451
- if(isset($adminName)){
452
- $result .= '<tr>';
453
- $result .= '<td style="width: 20%;"><strong>Admin name: </strong></td>';
454
- $result .= '<td>'.$adminName.'</td>';
455
- $result .= '</tr>';
456
- }
457
- if(isset($adminEmail)){
458
- $result .= '<tr>';
459
- $result .= '<td style="width: 20%;"><strong>Admin email: </strong></td>';
460
- $result .= '<td>'.$adminEmail.'</td>';
461
- $result .= '</tr>';
462
- }
463
- if(isset($salesName)){
464
- $result .= '<tr>';
465
- $result .= '<td style="width: 20%;"><strong>Sales name: </strong></td>';
466
- $result .= '<td>'.$salesName.'</td>';
467
- $result .= '</tr>';
468
- }
469
- if(isset($salesEmail)){
470
- $result .= '<tr>';
471
- $result .= '<td style="width: 20%;"><strong>Sales email: </strong></td>';
472
- $result .= '<td>'.$salesEmail.'</td>';
473
- $result .= '</tr>';
474
- }
475
- if(isset($secureUrl)){
476
- $result .= '<tr>';
477
- $result .= '<td style="width: 20%;"><strong>Web secure base url: </strong></td>';
478
- $result .= '<td>'.$secureUrl.'</td>';
479
- $result .= '</tr>';
480
- }
481
- if(isset($unsecureUrl)){
482
- $result .= '<tr>';
483
- $result .= '<td style="width: 20%;"><strong>Web unsecure base url: </strong></td>';
484
- $result .= '<td>'.$unsecureUrl.'</td>';
485
- $result .= '</tr>';
486
- }
487
- if(isset($baseCurrency)){
488
- $result .= '<tr>';
489
- $result .= '<td style="width: 20%;"><strong>Base currency: </strong></td>';
490
- $result .= '<td>'.$baseCurrency.'</td>';
491
- $result .= '</tr>';
492
- }
493
- if(isset($defaultCurrency)){
494
- $result .= '<tr>';
495
- $result .= '<td style="width: 20%;"><strong>Default currency: </strong></td>';
496
- $result .= '<td>'.$defaultCurrency.'</td>';
497
- $result .= '</tr>';
498
- }
499
- if(isset($allowCurrency)){
500
- $result .= '<tr>';
501
- $result .= '<td style="width: 20%;"><strong>Allow currencies: </strong></td>';
502
- $result .= '<td>'.str_replace(",", ", ",$allowCurrency).'</td>';
503
- $result .= '</tr>';
504
- }
505
- if(isset($defaultCountry)){
506
- $result .= '<tr>';
507
- $result .= '<td style="width: 20%;"><strong>Default Country: </strong></td>';
508
- $result .= '<td>'.$defaultCountry.'</td>';
509
- $result .= '</tr>';
510
- }
511
- if(isset($timezone)){
512
- $result .= '<tr>';
513
- $result .= '<td style="width: 20%;"><strong>Timezone: </strong></td>';
514
- $result .= '<td>'.$timezone.'</td>';
515
- $result .= '</tr>';
516
- }
517
- if(isset($installedCurrency)){
518
- $result .= '<tr>';
519
- $result .= '<td style="width: 20%;"><strong>Installed currencies: </strong></td>';
520
- $result .= '<td>'.str_replace(",", ", ",$installedCurrency).'</td>';
521
- $result .= '</tr>';
522
- }
523
-
524
- try{
525
- $modulesArray = (array)Mage::getConfig()->getNode('modules')->children();
526
- $modulesNameArray = array_keys($modulesArray);
527
-
528
- //displaying list of installed modules
529
- $result .= '<tr>';
530
- $result .= '<td style="width: 20%;"><strong>Installed Extensions: </strong></td>';
531
- $result .= '<td>'.implode(", ", $modulesNameArray).'</td>';
532
- $result .= '</tr>';
533
-
534
- //displaying list of active modules
535
- $activeModules = array();
536
- $coreHelper = Mage::helper('core');
537
- foreach ($modulesNameArray as $module) {
538
- if($coreHelper->isModuleEnabled($module)){
539
- $activeModules[] = $module;
540
- }
541
- }
542
- $result .= '<tr>';
543
- $result .= '<td style="width: 20%;"><strong>Active Extensions: </strong></td>';
544
- $result .= '<td>'.implode(", ", $activeModules).'</td>';
545
- $result .= '</tr>';
546
- }catch(Exception $e){$result .= '<tr>';
547
- $result .= '<tr><td>Error</td><td style="color:red;">'.$e->getMessage().'</td></tr>';
548
- }
549
-
550
 
551
- $result .= '</tbody>';
552
- $result .= '</table>';
553
- $result .= '</fieldset>';
554
- return $result;
555
- }
556
 
557
- }
 
1
  <?php
2
 
3
  class Expertrec_Recommendation_ApiController extends Mage_Core_Controller_Front_Action {
4
+ const BUILD_NO = "1486454605";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  private $_password;
6
 
7
+ //main function which loads the feed API
8
+ public function infoAction()
9
+ {
10
+ //return array of all parameters sent
11
  $requestParams = Mage::app()->getRequest()->getParams();
12
 
13
  $Password = isset($requestParams['secret']) ? $requestParams['secret'] : '';
16
  if(!Mage::getModel('expertrec_recommendation/validate')->checkPassword($Password)){
17
  die('ERROR: The specified password is invalid.');
18
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
 
20
+ Mage::register('buildno',self::BUILD_NO);
21
+ Mage::register('secret',Mage::getModel('expertrec_recommendation/validate')->getPassword());
22
+ $this->loadLayout();
23
+ $this->renderLayout();
24
+ }
25
 
26
+ }
27
+ ?>
app/code/community/Expertrec/Recommendation/controllers/ConfigController.php CHANGED
@@ -60,74 +60,106 @@ class Expertrec_Recommendation_ConfigController extends Mage_Core_Controller_Fro
60
 
61
  }
62
 
63
- public function saveheadersAction(){
64
- try{
65
- $requestParams = Mage::app()->getRequest()->getParams();
66
- $Password = isset($requestParams['secret']) ? $requestParams['secret'] : '';
67
-
68
- // Check password. if invalid password, it will not proceed.
69
- if(!Mage::getModel('expertrec_recommendation/validate')->checkPassword($Password)){
70
- die('ERROR: The specified password is invalid.');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
72
 
73
- $attrArray = array();
74
- if(isset($requestParams['selected_headers'])){
75
-
76
- if(!empty($requestParams['check_list'])){
77
-
78
- foreach($requestParams['check_list'] as $selected){
79
- $attrArray[] = $selected;
80
-
81
- }
82
-
83
- if(count($attrArray) > 0){
84
-
85
- // check for field expert_image
86
- if(in_array("expert_image", $attrArray)){
87
-
88
- if(isset($requestParams['imagewidth']) ? $requestParams['imagewidth'] : ''){
89
- $imageWidth = $requestParams['imagewidth'];
90
- Mage::helper("expertrec_recommendation")
91
- ->saveConfig('expertrec_image_width',$imageWidth);
92
- echo "Image Width updated</br>";
93
- }
94
- else{
95
- Mage::helper("expertrec_recommendation")
96
- ->saveConfig('expertrec_image_width','');
97
- echo "Not Updating Image Width</br>";
98
- }
99
- if(isset($requestParams['imageheight']) ? $requestParams['imageheight'] : ''){
100
- $imageHeight = $requestParams['imageheight'];
101
-
102
- // store image width and height
103
- Mage::helper("expertrec_recommendation")
104
- ->saveConfig('expertrec_image_height',$imageHeight);
105
- echo "Image Height updated</br>";
106
- }
107
- else{
108
- Mage::helper("expertrec_recommendation")
109
- ->saveConfig('expertrec_image_height','');
110
- echo "Not Updating Image Height</br>";
111
- }
112
-
113
- }
114
-
115
- //store headers then clear cache
116
- Mage::helper("expertrec_recommendation")
117
- ->saveConfig('headers',implode(',', $attrArray))
118
- ->clearCache();
119
-
120
- die("Successfully updated selected headers. Please close this tab and reload the info page.");
121
- }
122
- }
123
  }
124
- die("Invalid request");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
125
 
126
- }catch(Exception $e){
127
- Mage::getSingleton('expertrec_recommendation/log')->log("Updating feed header error: ".$e->getMessage());
128
- die("Unable to update headers");
 
 
 
 
 
 
 
 
 
 
 
129
  }
 
 
 
 
 
 
130
  }
 
 
 
 
 
 
 
 
131
 
132
  public function savefeedconfAction(){
133
  try{
@@ -141,13 +173,8 @@ class Expertrec_Recommendation_ConfigController extends Mage_Core_Controller_Fro
141
 
142
  $feedConfArray = array();
143
  if(isset($requestParams['feed_conf'])){
144
- if(!empty($requestParams['log_api'])){
145
- $feedConfArray[self::FEED_LOG_ENDPOINT] = $requestParams['log_api'];
146
- }
147
-
148
- if(!empty($requestParams['upload_api'])){
149
- $feedConfArray[self::FEED_UPLOAD_ENDPOINT] = $requestParams['upload_api'];
150
- }
151
 
152
  if(!empty($requestParams['upload_feed'])){
153
  $feedConfArray["is_upload"] = "true";
@@ -190,9 +217,7 @@ class Expertrec_Recommendation_ConfigController extends Mage_Core_Controller_Fro
190
 
191
  if(isset($requestParams['selected_search'])){
192
 
193
- if(!empty($requestParams['api'])){
194
- $searchConfArray[self::SEARCH_LIST_API] = $requestParams['api'];
195
- }
196
 
197
  $searchConfArray[self::SEARCH_FACET_LIST] = isset($requestParams['facet_list']) ? $requestParams['facet_list'] : '';
198
 
60
 
61
  }
62
 
63
+ public function saveheadersAction(){
64
+ try{
65
+ $requestParams = Mage::app()->getRequest()->getParams();
66
+ $Password = isset($requestParams['secret']) ? $requestParams['secret'] : '';
67
+ // Check password. if invalid password, it will not proceed.
68
+ if(!Mage::getModel('expertrec_recommendation/validate')->checkPassword($Password)){
69
+ die('ERROR: The specified password is invalid.');
70
+ }
71
+ $attrArray = array();
72
+ if(isset($requestParams['selected_headers'])){
73
+ if(!empty($requestParams['check_list'])){
74
+ foreach($requestParams['check_list'] as $selected){
75
+ $attrArray[] = $selected;
76
+ }
77
+
78
+ if(count($attrArray) > 0){
79
+ // check for field expert_image
80
+ if(in_array("expert_image", $attrArray)){
81
+ if(isset($requestParams['imagewidth']) ? $requestParams['imagewidth'] : ''){
82
+ $imageWidth = $requestParams['imagewidth'];
83
+ Mage::helper("expertrec_recommendation")
84
+ ->saveConfig('expertrec_image_width',$imageWidth);
85
+ echo "Image Width updated</br>";
86
  }
87
+ else{
88
+ Mage::helper("expertrec_recommendation")
89
+ ->saveConfig('expertrec_image_width','');
90
+ echo "Not Updating Image Width</br>";
91
+ }
92
+ if(isset($requestParams['imageheight']) ? $requestParams['imageheight'] : ''){
93
+ $imageHeight = $requestParams['imageheight'];
94
+ // store image width and height
95
+ Mage::helper("expertrec_recommendation")
96
+ ->saveConfig('expertrec_image_height',$imageHeight);
97
+ echo "Image Height updated</br>";
98
+ }
99
+ else{
100
+ Mage::helper("expertrec_recommendation")
101
+ ->saveConfig('expertrec_image_height','');
102
+ echo "Not Updating Image Height</br>";
103
+ }
104
+ }
105
 
106
+ // check for field expert_thumbnail
107
+ if(in_array("expert_thumbnail", $attrArray)){
108
+ if(isset($requestParams['thumbnailwidth']) ? $requestParams['thumbnailwidth'] : ''){
109
+ $thumbnailWidth = $requestParams['thumbnailwidth'];
110
+ Mage::helper("expertrec_recommendation")
111
+ ->saveConfig('expertrec_thumbnail_width',$thumbnailWidth);
112
+ echo "Thumbnail Width updated</br>";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
113
  }
114
+ else{
115
+ Mage::helper("expertrec_recommendation")
116
+ ->saveConfig('expertrec_thumbnail_width','');
117
+ echo "Not Updating Thumbnail Width</br>";
118
+ }
119
+ if(isset($requestParams['thumbnailheight']) ? $requestParams['thumbnailheight'] : ''){
120
+ $thumbnailHeight = $requestParams['thumbnailheight'];
121
+ // store thumbnail width and height
122
+ Mage::helper("expertrec_recommendation")
123
+ ->saveConfig('expertrec_thumbnail_height',$thumbnailHeight);
124
+ echo "Thumbnail Height updated</br>";
125
+ }
126
+ else{
127
+ Mage::helper("expertrec_recommendation")
128
+ ->saveConfig('expertrec_thumbnail_height','');
129
+ echo "Not Updating Thumbnail Height</br>";
130
+ }
131
+ }
132
 
133
+ //store headers then clear cache
134
+ Mage::helper("expertrec_recommendation")
135
+ ->saveConfig('headers',implode(',', $attrArray))
136
+ ->clearCache();
137
+ }
138
+ if(!empty($requestParams['filter_check_list'])){
139
+ foreach($requestParams['filter_check_list'] as $selected){
140
+ $filterArray[] = $selected;
141
+ }
142
+ //store headers then clear cache
143
+ Mage::helper("expertrec_recommendation")
144
+ ->saveConfig('filters',implode(',', $filterArray))
145
+ ->clearCache();
146
+ die("Successfully updated selected headers and filters. Please close this tab and reload the info page.");
147
  }
148
+ else{
149
+ Mage::helper("expertrec_recommendation")
150
+ ->saveConfig('filters','')
151
+ ->clearCache();
152
+ die("Successfully updated selected headers. Please close this tab and reload the info page.");
153
+ }
154
  }
155
+ }
156
+ die("Invalid request");
157
+ }
158
+ catch(Exception $e){
159
+ Mage::getSingleton('expertrec_recommendation/log')->log("Updating feed header error: ".$e->getMessage());
160
+ die("Unable to update headers");
161
+ }
162
+ }
163
 
164
  public function savefeedconfAction(){
165
  try{
173
 
174
  $feedConfArray = array();
175
  if(isset($requestParams['feed_conf'])){
176
+ $feedConfArray[self::FEED_LOG_ENDPOINT] = isset($requestParams['log_api']) ? $requestParams['log_api'] : '';
177
+ $feedConfArray[self::FEED_UPLOAD_ENDPOINT] = isset($requestParams['upload_api']) ? $requestParams['upload_api'] : '';
 
 
 
 
 
178
 
179
  if(!empty($requestParams['upload_feed'])){
180
  $feedConfArray["is_upload"] = "true";
217
 
218
  if(isset($requestParams['selected_search'])){
219
 
220
+ $searchConfArray[self::SEARCH_LIST_API] = isset($requestParams['api'])?$requestParams['api']:'';
 
 
221
 
222
  $searchConfArray[self::SEARCH_FACET_LIST] = isset($requestParams['facet_list']) ? $requestParams['facet_list'] : '';
223
 
app/code/community/Expertrec/Recommendation/controllers/IndexController.php CHANGED
@@ -52,7 +52,7 @@
52
  die('ERROR: The specified password is invalid.');
53
  }
54
 
55
- $vFeedDir = Mage::getBaseDir().self::FEED_PATH;
56
 
57
  //delete all files in Expertrec
58
  Mage::helper('expertrec_recommendation/filehelper')->cleanDir($vFeedDir);
@@ -75,8 +75,7 @@
75
  }
76
 
77
  //base Directory path
78
- $basePath = Mage::getBaseDir();
79
- $logPath = $basePath.self::FEED_PATH."/expertrec_feed.log";
80
  $this->downloadFile($logPath);
81
  return;
82
  }catch (Exception $e) {
52
  die('ERROR: The specified password is invalid.');
53
  }
54
 
55
+ $vFeedDir = "/tmp".self::FEED_PATH;
56
 
57
  //delete all files in Expertrec
58
  Mage::helper('expertrec_recommendation/filehelper')->cleanDir($vFeedDir);
75
  }
76
 
77
  //base Directory path
78
+ $logPath = "/tmp".self::FEED_PATH."/expertrec_feed.log";
 
79
  $this->downloadFile($logPath);
80
  return;
81
  }catch (Exception $e) {
app/code/community/Expertrec/Recommendation/etc/adminhtml.xml CHANGED
@@ -10,6 +10,12 @@
10
  <sort_order>10</sort_order>
11
  <action>expertrec-signup</action>
12
  </expertrec>
 
 
 
 
 
 
13
  </children>
14
  </expertrec>
15
  </menu>
10
  <sort_order>10</sort_order>
11
  <action>expertrec-signup</action>
12
  </expertrec>
13
+ <!-- added support mail -->
14
+ <support translate="title">
15
+ <title>Add Support</title>
16
+ <sort_order>90</sort_order>
17
+ <action>expertrec-signup/index/mail</action>
18
+ </support>
19
  </children>
20
  </expertrec>
21
  </menu>
app/code/community/Expertrec/Recommendation/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Expertrec_Recommendation>
5
- <version>1.1.3</version>
6
  </Expertrec_Recommendation>
7
  </modules>
8
  <global>
@@ -83,6 +83,16 @@
83
  </expertrec_recommendation_stockupdate>
84
  </observers>
85
  </catalog_product_save_commit_after>
 
 
 
 
 
 
 
 
 
 
86
  </events>
87
  </global>
88
  <frontend>
@@ -108,6 +118,7 @@
108
  <frontName>expertrec-signup</frontName>
109
  </args>
110
  </expertrec-signup>
 
111
  <expertrec>
112
  <use>standard</use>
113
  <args>
2
  <config>
3
  <modules>
4
  <Expertrec_Recommendation>
5
+ <version>1.1.4</version>
6
  </Expertrec_Recommendation>
7
  </modules>
8
  <global>
83
  </expertrec_recommendation_stockupdate>
84
  </observers>
85
  </catalog_product_save_commit_after>
86
+ <!-- Hook on New Category and Category Edit -->
87
+ <catalog_category_save_commit_after>
88
+ <observers>
89
+ <expertrec_recommendation_save_category>
90
+ <type>singleton</type>
91
+ <class>expertrec_recommendation/observer</class>
92
+ <method>saveCategory</method>
93
+ </expertrec_recommendation_save_category>
94
+ </observers>
95
+ </catalog_category_save_commit_after>
96
  </events>
97
  </global>
98
  <frontend>
118
  <frontName>expertrec-signup</frontName>
119
  </args>
120
  </expertrec-signup>
121
+ <!-- added support email -->
122
  <expertrec>
123
  <use>standard</use>
124
  <args>
app/code/community/Expertrec/Recommendation/sql/expertrec_setup/mysql4-install-1.0.0.php CHANGED
@@ -8,7 +8,11 @@ $installer->run("
8
  VALUES
9
  ('default',0,'expertrec/general/mid','new_user'),
10
  ('default',0,'expertrec/general/secret','NTE5NTQ1Zjk4OGExYzYxOWFkOTkyN2Y3MDQ5MTQ3NTM='),
11
- ('default',0,'expertrec/general/headers','is_in_stock,expert_image,expert_category,final_price,entity_id,rating_summary,expert_url,created_at,image,msrp,name,price,short_description,sku,small_image,special_price')
 
 
 
 
12
  ON DUPLICATE KEY UPDATE `value`=`value`;
13
  ");
14
 
8
  VALUES
9
  ('default',0,'expertrec/general/mid','new_user'),
10
  ('default',0,'expertrec/general/secret','NTE5NTQ1Zjk4OGExYzYxOWFkOTkyN2Y3MDQ5MTQ3NTM='),
11
+ ('default',0,'expertrec/general/headers','is_in_stock,expert_image,expert_thumbnail,expert_category,final_price,entity_id,rating_summary,expert_url,created_at,image,msrp,name,price,short_description,sku,small_image,special_price,category_ids'),
12
+ ('default',0,'expertrec/general/expertrec_image_width',250),
13
+ ('default',0,'expertrec/general/expertrec_image_height',250),
14
+ ('default',0,'expertrec/general/expertrec_thumbnail_width',80),
15
+ ('default',0,'expertrec/general/expertrec_thumbnail_height',80)
16
  ON DUPLICATE KEY UPDATE `value`=`value`;
17
  ");
18
 
app/design/frontend/base/default/layout/expertrec/recommendation.xml CHANGED
@@ -14,4 +14,14 @@
14
  <action method="setTemplate"><template>page/1column.phtml</template></action>
15
  </reference>
16
  </expertrec_custom_autocomplete>
 
 
 
 
 
 
 
 
 
 
17
  </layout>
14
  <action method="setTemplate"><template>page/1column.phtml</template></action>
15
  </reference>
16
  </expertrec_custom_autocomplete>
17
+ <!--route the infoAction function in ApiController to info.phtml, which can access Api.php block functions-->
18
+ <expertrec_recommendation_api_info>
19
+ <reference name="root">
20
+ <action method="setTemplate"><template>page/1column.phtml</template></action>
21
+ </reference>
22
+ <reference name="content">
23
+ <block type="expertrec_recommendation/api" name="expertrec_feed1"
24
+ template="expertrec/feed/info.phtml"/>
25
+ </reference>
26
+ </expertrec_recommendation_api_info>
27
  </layout>
app/design/frontend/base/default/template/expertrec/feed/info.phtml ADDED
@@ -0,0 +1,537 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php ?>
2
+ <script src="//ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
3
+ <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
4
+ <link rel="stylesheet" type="text/css" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
5
+ <style type="text/css">
6
+ table {border-spacing: 0;border-collapse: collapse;width: 100%;}
7
+ .table-hover > tbody > tr:hover {background-color: #f5f5f5;}
8
+ tbody td, thead th{padding: 8px;line-height: 1.42857143;vertical-align: top;border-top: 1px solid #ddd;text-align:left;word-wrap:break-word;white-space: normal;}
9
+ thead:first-child > tr:first-child > th {border-top: 0;}
10
+ thead th {vertical-align: bottom;border-bottom:2px solid #ddd;background-color:#f5f5f5;text-align:center;}
11
+ fieldset { display: block;margin:10px 2px;padding: .35em .625em .75em; border: 1px solid silver; }
12
+ legend{padding: 0px 5px; width: auto; border: 0px none;margin:0;}
13
+ fieldset p { text-align: left; display: block; }
14
+ #searchConfSection input[type="checkbox"]{bottom: 2px;}
15
+ .setHeadersForm label{padding:0px 10px 10px 0px;} .setHeadersForm input{vertical-align: middle;}
16
+ </style>
17
+ <script type="text/javascript">
18
+ function toggle_select()
19
+ {
20
+ var checkboxes = document.getElementsByName("check_list[]");
21
+ var button = document.getElementById("toggleSelect");
22
+ if(button.value == "Select All")
23
+ {
24
+ for (var i in checkboxes)
25
+ {
26
+ checkboxes[i].checked = "checked";
27
+ }
28
+ button.value = "Deselect All"
29
+ }
30
+ else
31
+ {
32
+ for (var i in checkboxes)
33
+ {
34
+ checkboxes[i].checked = "";
35
+ }
36
+ button.value = "Select All";
37
+ }
38
+ }
39
+ </script>
40
+ <div class="container-fluid">
41
+ <h4 style='margin:20px auto 10px;'>Extension Version: <span style='color:red;'><?php echo (string)Mage::getConfig()->getNode('modules/Expertrec_Recommendation/version')?></span></h4>
42
+ <h4 style='margin:10px auto;'>Extension Build No.: <span style='color:red;'><?php echo Mage::registry('buildno'); ?></span></h4>
43
+ <h4 style='margin:10px auto;'>Magento Version: <span style='color:red;'><?php echo Mage::getVersion(); ?></span></h4>
44
+ <ul class="nav nav-tabs" style="margin-top:20px;">
45
+ <li class="active"><a data-toggle="tab" href="#apiSection">Api</a></li>
46
+ <li><a data-toggle="tab" href="#feedHeader">Feed Header</a></li>
47
+ <li><a data-toggle="tab" href="#feedEndpointSection">Feed Config</a></li>
48
+ <li><a data-toggle="tab" href="#searchConfSection">Search</a></li>
49
+ <li><a data-toggle="tab" href="#siteDetailsSection">Details</a></li>
50
+ </ul>
51
+ <div style="clear:both;"></div>
52
+ <div class="tab-content">
53
+ <?php
54
+ $imageParams = $this->getImageParams();
55
+ $imgwidth = "";
56
+ $imgheight = "";
57
+ $thumbwidth = "";
58
+ $thumbheight = "";
59
+
60
+ if($imageParams['thumbwidth'] != "" && isset($imageParams['thumbwidth']))
61
+ {
62
+ $thumbwidth = $imageParams['thumbwidth'];
63
+ }
64
+ if($imageParams['thumbheight'] != "" && isset($imageParams['thumbheight']))
65
+ {
66
+ $thumbheight = $imageParams['thumbheight'];
67
+ }
68
+
69
+ if($imageParams['imgwidth'] != "" && isset($imageParams['imgwidth']))
70
+ {
71
+ $imgwidth = $imageParams['imgwidth'];
72
+ }
73
+ if($imageParams['imgheight'] != "" && isset($imageParams['imgheight']))
74
+ {
75
+ $imgheight = $imageParams['imgheight'];
76
+ }
77
+ ?>
78
+ <!--Defining API Info section-->
79
+ <div id="apiSection" class="tab-pane fade in active">
80
+ <div style="margin-top:20px;">
81
+ <fieldset>
82
+ <legend>Getting Feeds Api</legend>
83
+ <table class="table-hover" style="margin: 1em auto;">
84
+ <thead>
85
+ <tr>
86
+ <th>Website ID</th>
87
+ <th>Website Name</th>
88
+ <th>Store ID</th>
89
+ <th>Store Name</th>
90
+ <th>Total Pages</th>
91
+ <th>Url</th>
92
+ </tr>
93
+ </thead>
94
+ <tbody>
95
+ <?php foreach ($this->getWebsiteStoreInfo() as $_item): ?>
96
+ <tr>
97
+ <td style="text-align:center;"><?php echo $_item['wid'] ?></td>
98
+ <td style="text-align:center;"><?php echo $_item['wname'] ?></td>
99
+ <td style="text-align:center;"><?php echo $_item['sid'] ?></td>
100
+ <?php if(isset($_item['pages'])): ?>
101
+ <td style="text-align:center;"><?php echo $_item['pages'] ?></td>
102
+ <?php endif;?>
103
+ <?php if(isset($_item['pageerr'])): ?>
104
+ <td style="text-align:center;"><b style="color:red;">Error: </b>
105
+ <?php echo $_item['pageerr'] ?>
106
+ </td>
107
+ <?php endif;?>
108
+ <td style="text-align:center;"><?php echo $_item['sid'] ?></td>
109
+ <td><a href = "<?php echo $_item['surl'] ?>"><?php echo $_item['surl'] ?></a></td>
110
+ </tr>
111
+ <?php endforeach; ?>
112
+ </tbody>
113
+ </table>
114
+ </fieldset>
115
+ </div>
116
+ <p>
117
+ <strong>Note:</strong><br />
118
+ <span>
119
+ 1. Each page contains 500 products.<br />
120
+ 2. For Getting custom image size, kindly add <b>width</b> and <b>height</b> parameter in the api url.
121
+ </span>
122
+ </p>
123
+ <div style="margin-top:20px">
124
+ <?php
125
+ $customImageUrl = $this->getCustomApiUrl()."&width=170&height=170";
126
+
127
+ if(isset($imageParams["imgwidth"]) && isset($imageParams["imgheight"])){
128
+ $customImageUrl = $this->getCustomApiUrl()."&width=".$imageParams["imgwidth"]."&height=".$imageParams["imgheight"];
129
+ }
130
+ elseif(isset($imageParams["imgwidth"])){
131
+ $customImageUrl =$this->getCustomApiUrl()."&width=".$imageParams["imgwidth"]."&height=170";
132
+ }
133
+ elseif(isset($imageParams["imgheight"])){
134
+ $customImageUrl =$this->getCustomApiUrl()."&width=170&height=".$imageParams["imgheight"];
135
+ }
136
+
137
+ ?>
138
+
139
+ <fieldset>
140
+ <legend>Example</legend>
141
+ <p><b>With Custom Image</b></p>
142
+ <p><a href="<?php echo $this->getCustomApiUrl().'&width=170&height=170' ?>">
143
+ <?php echo $customImageUrl ?>
144
+ </a></p>
145
+ <p><b>With pagination without page size(default page size is 500)</b></p>
146
+ <p><a href="<?php echo $this->getCustomApiUrl().'&ps=1&pe=2' ?>">
147
+ <?php echo $this->getCustomApiUrl().'&ps=1&pe=2' ?></a></p>
148
+ <p><b>With pagination without page size(default page size is 500)</b></p>
149
+ <p><a href="<?php echo $this->getCustomApiUrl().'&ps=1&pe=2&psize=50' ?>">
150
+ <?php echo $this->getCustomApiUrl().'&ps=1&pe=2&psize=50' ?></a></p>
151
+ </fieldset>
152
+ </div>
153
+ <div style="margin-top:20px">
154
+ <fieldset>
155
+ <legend>Getting Popular Products Api</legend>
156
+ <p><b>Without pagination</b></p>
157
+ <p><a href="<?php echo $this->getSuggestionApiUrl() ?>">
158
+ <?php echo $this->getSuggestionApiUrl() ?></a></p>
159
+ <p><b>With pagination without page size(default page size is 500)</b></p>
160
+ <p><a href="<?php echo $this->getSuggestionApiUrl().'&ps=1&pe=2' ?>">
161
+ <?php echo $this->getSuggestionApiUrl().'&ps=1&pe=2' ?></a></p>
162
+ <p><b>With pagination without page size(default page size is 500)</b></p>
163
+ <p><a href="<?php echo $this->getSuggestionApiUrl().'&ps=1&pe=2&psize=50' ?>">
164
+ <?php echo $this->getSuggestionApiUrl().'&ps=1&pe=2&psize=50' ?></a></p>
165
+ </fieldset>
166
+ </div>
167
+ <div style="margin-top:20px">
168
+ <fieldset>
169
+ <legend>Getting log & Cleaning Expertrec Directory Api's</legend>
170
+ <p><b>Get Log Url</b></p>
171
+ <p><a href="<?php echo $this->getLogUrl() ?>">
172
+ <?php echo $this->getLogUrl() ?></a></p>
173
+ <p><b>Get Cleandir Url</b></p>
174
+ <p><a href="<?php echo $this->getCleanDirUrl() ?>" target="_blank">
175
+ <?php echo $this->getCleanDirUrl() ?></a></p>
176
+ </fieldset>
177
+ </div>
178
+ </div>
179
+ <!--End of API Info section-->
180
+
181
+ <!--Defining the feed header page-->
182
+ <div id="feedHeader" class="tab-pane fade">
183
+ <div style="margin-top:20px">
184
+ <fieldset>
185
+ <legend>Configure Feed Headers</legend>
186
+ <form class="setHeadersForm"
187
+ action="<?php echo $this->getBaseUrl()."index.php/expertrec-feed/config/saveheaders?secret=".$this->getSecret() ?>" method="post" role="form" target="_blank">
188
+ <?php
189
+ $storedFilters = $this->getStoredFilters();
190
+ $storedHeaders = $this->getStoredHeaders();
191
+ ?>
192
+ <?php foreach ($this->getAllAttributes() as $_attr): ?>
193
+ <?php if($storedHeaders!= null && in_array($_attr, $storedHeaders)): ?>
194
+ <input type="checkbox" id="<?php echo $_attr; ?>" name="check_list[]"
195
+ value="<?php echo $_attr; ?>" checked>
196
+ <?php else: ?>
197
+ <input type="checkbox" id="<?php echo $_attr; ?>" name="check_list[]"
198
+ value="<?php echo $_attr; ?>">
199
+ <?php endif; ?>
200
+ <label for="<?php echo $_attr; ?>"><?php echo $_attr; ?></label>
201
+ <?php endforeach; ?>
202
+
203
+ <!--Image config section-->
204
+ <div style="display:block">
205
+ <h4>Expertrec Image</h4>
206
+
207
+ <label for="imagewidth">Image Width</label>
208
+ <input type="text" id="imagewidth" name="imagewidth" placeholder="Give image width" value="<?php echo $imgwidth; ?>">
209
+ </div>
210
+ <div style="display:block">
211
+ <label for="imageheight">Image Height</label>
212
+ <input type="text" id="imageheight" name="imageheight" placeholder="Give image height" value="<?php echo $imgheight; ?>">
213
+
214
+ </div>
215
+
216
+ <!--Thumbnail Image config section-->
217
+ <div style="display:block">
218
+ <h4>Expertrec Thumbnail</h4>
219
+
220
+ <label for="thumbnailwidth">Thumbnail Width</label>
221
+ <input type="text" id="thumbnailwidth" name="thumbnailwidth" placeholder="Give thumbnail width" value="<?php echo $thumbwidth ?>">
222
+ </div>
223
+ <div style="display:block">
224
+ <label for="thumbnailheight">Thumbnail Height</label>
225
+ <input type="text" id="thumbnailheight" name="thumbnailheight" placeholder="Give thumbnail height" value="<?php echo $thumbheight ?>">
226
+
227
+ </div>
228
+
229
+ <!--Configure Filters section-->
230
+ <fieldset>
231
+ <legend>Configure Filters</legend>
232
+ <?php foreach ($this->getAllFilters() as $_filter): ?>
233
+ <?php if($storedFilters != null && in_array($_filter, $storedFilters)): ?>
234
+ <input type="checkbox" id="<?php echo $_filter; ?>" name="filter_check_list[]"
235
+ value="<?php echo $_filter; ?>" checked>
236
+ <?php else: ?>
237
+ <input type="checkbox" id="<?php echo $_filter; ?>" name="filter_check_list[]"
238
+ value="<?php echo $_filter; ?>">
239
+ <?php endif; ?>
240
+ <label for="<?php echo $_filter; ?>"><?php echo $_filter; ?></label>
241
+ <?php endforeach; ?>
242
+ </fieldset>
243
+
244
+ <!-- Submit buttons section-->
245
+ <div style="text-align:center;margin:10px auto;">
246
+ <input type="button" class="btn btn-md btn-primary" id="toggleSelect" value="Select All" onClick="toggle_select()" style="padding:5px; margin: 5px;"/>
247
+ <input type="submit" class="btn btn-md btn-primary" name="selected_headers" value="Submit" style= "padding:5px; margin: 5px;"/>
248
+ </div>
249
+ </form>
250
+ </fieldset>
251
+ <!--Displaying selected headers-->
252
+ <?php if(!empty(Mage::getStoreConfig('expertrec/general/headers')) &&
253
+ isset($storedHeaders) && count($storedHeaders) > 0): ?>
254
+ <fieldset style="margin-top:20px;">
255
+ <legend>Selected Headers</legend>
256
+ <div class="setHeadersForm">
257
+ <?php foreach ($this->getStoredHeaders() as $_header): ?>
258
+ <input type="checkbox" name="<?php echo $_header; ?>" value="<?php echo $_header; ?>" disabled checked>
259
+ <label><?php echo $_header; ?></label>
260
+ <?php endforeach; ?>
261
+ </div>
262
+ </fieldset>
263
+ <?php endif;?>
264
+ <!--Displaying selected filters-->
265
+ <?php if(!empty(Mage::getStoreConfig('expertrec/general/filters')) &&
266
+ isset($storedFilters) && count($storedFilters) > 0): ?>
267
+ <fieldset style="margin-top:20px;">
268
+ <legend>Selected Filters</legend>
269
+ <div class="setHeadersForm">
270
+ <?php foreach ($this->getStoredFilters() as $_sfilter): ?>
271
+ <input type="checkbox" name="<?php echo $_sfilter; ?>" value="<?php echo $_sfilter; ?>" disabled checked>
272
+ <label><?php echo $_sfilter; ?></label>
273
+ <?php endforeach; ?>
274
+ </div>
275
+ </fieldset>
276
+ <?php endif;?>
277
+ </div>
278
+ </div>
279
+ <!--End of feed header section-->
280
+
281
+ <!-- Feed api configuration section start -->
282
+ <div id="feedEndpointSection" class="tab-pane fade">
283
+ <div style="margin-top:20px">
284
+ <fieldset>
285
+ <legend>Configure Feed</legend>
286
+ <form class="form-horizontal" action="<?php echo $this->getBaseUrl()."index.php/expertrec-feed/config/savefeedconf?secret=".$this->getSecret(); ?>" method="post" role="form"
287
+ target="_blank">
288
+
289
+ <!--Display URL-->
290
+ <?php foreach ($this->getFeedConfUrl() as $_feedUrl): ?>
291
+ <div class="form-group">
292
+ <label class="control-label col-sm-2" for="search_<?php echo $_feedUrl['tkey'] ?>"><?php echo $_feedUrl['label'] ?>:</label>
293
+ <div class="col-sm-8">
294
+ <?php if(isset($_feedUrl["storevalue"])): ?>
295
+ <input type="text" class="form-control"
296
+ id="<?php echo $_feedUrl['tkey'] ?>"
297
+ name="<?php echo $_feedUrl['tkey'] ?>"
298
+ value="<?php echo $_feedUrl['storevalue'] ?>"
299
+ placeholder="<?php echo $_feedUrl['placeholder'] ?>">
300
+ <?php else: ?>
301
+ <input type="text" class="form-control"
302
+ id="<?php echo $_feedUrl['tkey'] ?>"
303
+ name="<?php echo $_feedUrl['tkey'] ?>" placeholder="<?php echo $_feedUrl['placeholder'] ?>">
304
+ <?php endif; ?>
305
+ </div>
306
+ </div>
307
+ <?php endforeach; ?>
308
+
309
+ <!--Enable/Disable feed upload-->
310
+ <div class="row">
311
+ <div class="col-sm-offset-2 col-sm-8" style="clear:both;">
312
+ <label class="checkbox-inline" style="padding-left: 20px;">
313
+ <?php if($this->isFeedUpload() != null && $this->isFeedUpload() == 'true'): ?>
314
+ <input type="checkbox" name="upload_feed" value="is_upload" checked>
315
+ <?php else: ?>
316
+ <input type="checkbox" name="upload_feed" value="is_upload">
317
+ <?php endif; ?>
318
+ Upload Feed
319
+ </label>
320
+
321
+ </div>
322
+ </div>
323
+
324
+ <!--Defining submit button-->
325
+ <div style="text-align:center;margin:10px auto;">
326
+ <input type="submit" class="btn btn-md btn-primary" name="feed_conf" value="Submit"
327
+ style="padding:5px; "/>
328
+ </div>
329
+ </form>
330
+ </fieldset>
331
+ </div>
332
+ </div>
333
+ <!-- Feed api configuration section end -->
334
+
335
+ <!-- search section start -->
336
+ <div id="searchConfSection" class="tab-pane fade">
337
+ <div style="margin-top:20px">
338
+ <fieldset>
339
+ <legend>Configure Search</legend>
340
+ <form class="form-horizontal" action="<?php echo $this->getBaseUrl()."index.php/expertrec-feed/config/savesearch?secret=".$this->getSecret() ?>" method="post"
341
+ role="form" target="_blank">
342
+ <!--Defining Search fields-->
343
+ <?php foreach ($this->getSearchFields() as $_searchFields): ?>
344
+ <div class="form-group">
345
+ <label class="control-label col-sm-2" for="search_<?php echo $_searchFields['tkey'] ?>"><?php echo $_searchFields['label'] ?>:</label>
346
+ <div class="col-sm-8">
347
+ <?php if(isset($_searchFields["storevalue"])): ?>
348
+ <input type="text" class="form-control"
349
+ name="<?php echo $_searchFields['tkey'] ?>"
350
+ id="search_<?php echo $_searchFields['tkey'] ?>"
351
+ value="<?php echo $_searchFields['storevalue'] ?>"
352
+ placeholder="<?php echo $_searchFields['placeholder'] ?>">
353
+ <?php else: ?>
354
+ <input type="text" class="form-control"
355
+ name="<?php echo $_searchFields['tkey'] ?>"
356
+ id="search_<?php echo $_searchFields['tkey'] ?>"
357
+ placeholder="<?php echo $_searchFields['placeholder'] ?>">
358
+ <?php endif; ?>
359
+ </div>
360
+ </div>
361
+ <?php endforeach; ?>
362
+
363
+ <!--Defining checkbox section-->
364
+ <div class="form-group">
365
+ <div class="col-sm-2"></div>
366
+ <div class="col-sm-8">
367
+ <?php foreach ($this->getSearchCheckedValues() as $_searchParams): ?>
368
+ <div class="col-sm-2">
369
+ <div class="checkbox">
370
+ <label>
371
+ <input type="checkbox" name="search_check_list[]"
372
+ value="<?php echo $_searchParams['val'] ?>"
373
+ <?php echo $_searchParams['checked'] ?>>
374
+ <?php echo $_searchParams['label'] ?>
375
+ </label>
376
+ </div>
377
+ </div>
378
+ <?php endforeach; ?>
379
+
380
+ </div>
381
+ </div>
382
+
383
+ <!--Defining submit button-->
384
+ <div style="text-align:center;margin:10px auto;">
385
+ <input type="submit" class="btn btn-md btn-primary" name="selected_search" value="Submit" style="padding:5px; "/>
386
+ </div>
387
+ </form>
388
+ </fieldset>
389
+ </div>
390
+ </div>
391
+ <!-- search section ended-->
392
+
393
+ <!--site details section-->
394
+ <div id="siteDetailsSection" class="tab-pane fade">
395
+ <div style="margin-top:20px">
396
+ <fieldset>
397
+ <legend>Site Info</legend>
398
+ <table class="table table-hover" style="table-layout: fixed;">
399
+ <tbody>
400
+ <?php $siteDetails = $this->getSiteDetails();?>
401
+ <?php $installedExtensions = $this->getInstalledExtensions(); ?>
402
+ <?php $activeExtensions = $this->getActiveExtensions($installedExtensions['modulearr']); ?>
403
+
404
+ <?php if(isset($siteDetails["adminName"])): ?>
405
+ <tr>
406
+ <td style="width: 20%;"><strong>Admin name: </strong></td>
407
+ <td style="word-wrap:break-word;">
408
+ <?php echo $siteDetails["adminName"]; ?>
409
+ </td>
410
+ </tr>
411
+ <?php endif; ?>
412
+ <?php if(isset($siteDetails["adminEmail"])): ?>
413
+ <tr>
414
+ <td style="width: 20%;"><strong>Admin email: </strong></td>
415
+ <td style="word-wrap:break-word;">
416
+ <?php echo $siteDetails["adminEmail"]; ?>
417
+ </td>
418
+ </tr>
419
+ <?php endif; ?>
420
+ <?php if(isset($siteDetails["salesName"])): ?>
421
+ <tr>
422
+ <td style="width: 20%;"><strong>Sales name: </strong></td>
423
+ <td style="word-wrap:break-word;">
424
+ <?php echo $siteDetails["salesName"]; ?>
425
+ </td>
426
+ </tr>
427
+ <?php endif; ?>
428
+ <?php if(isset($siteDetails["salesEmail"])): ?>
429
+ <tr>
430
+ <td style="width: 20%;"><strong>Sales email: </strong></td>
431
+ <td style="word-wrap:break-word;">
432
+ <?php echo $siteDetails["salesEmail"]; ?>
433
+ </td>
434
+ </tr>
435
+ <?php endif; ?>
436
+ <?php if(isset($siteDetails["secureUrl"])): ?>
437
+ <tr>
438
+ <td style="width: 20%;"><strong>Web secure base URL: </strong></td>
439
+ <td style="word-wrap:break-word;">
440
+ <?php echo $siteDetails["secureUrl"]; ?>
441
+ </td>
442
+ </tr>
443
+ <?php endif; ?>
444
+ <?php if(isset($siteDetails["unsecureUrl"])): ?>
445
+ <tr>
446
+ <td style="width: 20%;"><strong>Web unsecure base URL: </strong></td>
447
+ <td style="word-wrap:break-word;">
448
+ <?php echo $siteDetails["unsecureUrl"]; ?>
449
+ </td>
450
+ </tr>
451
+ <?php endif; ?>
452
+ <?php if(isset($siteDetails["baseCurrency"])): ?>
453
+ <tr>
454
+ <td style="width: 20%;"><strong>Base currency: </strong></td>
455
+ <td style="word-wrap:break-word;">
456
+ <?php echo $siteDetails["baseCurrency"]; ?>
457
+ </td>
458
+ </tr>
459
+ <?php endif; ?>
460
+ <?php if(isset($siteDetails["defaultCurrency"])): ?>
461
+ <tr>
462
+ <td style="width: 20%;"><strong>Default currency: </strong></td>
463
+ <td style="word-wrap:break-word;">
464
+ <?php echo $siteDetails["defaultCurrency"]; ?>
465
+ </td>
466
+ </tr>
467
+ <?php endif; ?>
468
+ <?php if(isset($siteDetails["allowCurrency"])): ?>
469
+ <tr>
470
+ <td style="width: 20%;"><strong>Allowed currencies: </strong></td>
471
+ <td style="word-wrap:break-word;">
472
+ <?php echo $siteDetails["allowCurrency"]; ?>
473
+ </td>
474
+ </tr>
475
+ <?php endif; ?>
476
+ <?php if(isset($siteDetails["installedCurrency"])): ?>
477
+ <tr>
478
+ <td style="width: 20%;"><strong>Installed currencies: </strong></td>
479
+ <td style="word-wrap:break-word;">
480
+ <?php echo $siteDetails["installedCurrency"]; ?>
481
+ </td>
482
+ </tr>
483
+ <?php endif; ?>
484
+ <?php if(isset($siteDetails["defaultCountry"])): ?>
485
+ <tr>
486
+ <td style="width: 20%;"><strong>Default country: </strong></td>
487
+ <td style="word-wrap:break-word;">
488
+ <?php echo $siteDetails["defaultCountry"]; ?>
489
+ </td>
490
+ </tr>
491
+ <?php endif; ?>
492
+ <?php if(isset($siteDetails["timezone"])): ?>
493
+ <tr>
494
+ <td style="width: 20%;"><strong>Timezone: </strong></td>
495
+ <td style="word-wrap:break-word;">
496
+ <?php echo $siteDetails["timezone"]; ?>
497
+ </td>
498
+ </tr>
499
+ <?php endif; ?>
500
+ <?php if(isset($installedExtensions["modulestr"])): ?>
501
+ <tr>
502
+ <td style="width: 20%;"><strong>Installed Extensions: </strong></td>
503
+ <td style="word-wrap:break-word;">
504
+ <?php echo $installedExtensions["modulestr"]; ?>
505
+ </td>
506
+ </tr>
507
+ <?php endif; ?>
508
+ <?php if(isset($installedExtensions["errorstr"])): ?>
509
+ <tr>
510
+ <td style="width: 20%;"><strong>Installed Extensions(Error): </strong></td>
511
+ <td style="color:red;word-wrap:break-word;"><?php echo $installedExtensions['errorstr'];?></td>
512
+ </tr>
513
+ <?php endif; ?>
514
+ <?php if(isset($activeExtensions["modulestr"])): ?>
515
+ <tr>
516
+ <td style="width: 20%;"><strong>Active Extensions: </strong></td>
517
+ <td style="word-wrap:break-word;">
518
+ <?php echo $activeExtensions["modulestr"]; ?>
519
+ </td>
520
+ </tr>
521
+ <?php endif; ?>
522
+ <?php if(isset($activeExtensions["errorstr"])): ?>
523
+ <tr>
524
+ <td style="width: 20%;"><strong>Active Extensions(Error): </strong></td>
525
+ <td style="color:red;word-wrap:break-word;">
526
+ <?php echo $activeExtensions['errorstr'];?>
527
+ </td>
528
+ </tr>
529
+ <?php endif; ?>
530
+ </tbody>
531
+ </table>
532
+ </fieldset>
533
+ </div>
534
+ </div>
535
+ <!--site details section ended-->
536
+ </div>
537
+ </div>
app/design/frontend/base/default/template/expertrec/recommendation/tracker.phtml CHANGED
@@ -45,5 +45,4 @@ if(typeof expertSiteConf == 'undefined' || expertSiteConf == null) {
45
 
46
 
47
  </script>
48
- <?php ?>
49
-
45
 
46
 
47
  </script>
48
+ <?php ?>
 
app/design/frontend/base/default/template/expertrec/recommendation/tracking/product.phtml CHANGED
@@ -11,5 +11,4 @@
11
  })();
12
 
13
  </script>
14
- <?php ?>
15
-
11
  })();
12
 
13
  </script>
14
+ <?php ?>
 
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Expertrec_Recommendation</name>
4
- <version>1.1.3</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
7
  <channel>community</channel>
@@ -10,9 +10,9 @@
10
  <description>Expertrec search extension helps you have complete control over your site search results. You will be able to add instant autocomplete, spell corrections that learn from the user behaviour on your site, and show product recommendations within the search user interface. It also adds search results pages with facets, sorting by different attributes.</description>
11
  <notes>Expertrec Recommendation plugin for magento sites.</notes>
12
  <authors><author><name>melchi</name><user>melchi</user><email>magento@cloudinfra.in</email></author><author><name>magento</name><user>magento</user><email>magento-team@cloudinfra.in</email></author></authors>
13
- <date>2017-01-25</date>
14
- <time>10:41:31</time>
15
- <contents><target name="magecommunity"><dir name="Expertrec"><dir name="Recommendation"><dir name="Block"><dir name="Product"><dir name="List"><file name="Toolbar.php" hash="bd05a0d7473829c47662e6b763907ea6"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="41afd664b2087bb1f9361f2630a82bf9"/><file name="Filehelper.php" hash="5ac956e12548398dc159a16eb1a03e8b"/><dir name="Search"><file name="Layout.php" hash="d7b7ec5f4bbd846dd063934f8a267d48"/></dir><file name="Searchhelper.php" hash="f38cbcfa389661cf962cef55f4080845"/><file name="Suggestionhelper.php" hash="93f3aa295761a510f782856c0180a799"/></dir><dir name="Model"><dir name="Api"><file name="Request.php" hash="7df8b22d74b6a05de86da287687a6e96"/></dir><dir name="Catalogsearch"><file name="Layer.php" hash="1084f6aa62678d6dc102e094b74892b6"/></dir><dir name="Feed"><file name="Feedconfig.php" hash="013bd447dccc7cc4f073be5bd53a18c9"/><file name="Feedcreator.php" hash="39315afac20326fc7278d1014e0f1142"/><file name="Feedfilter.php" hash="d7599a63a8d1f2033cb1e56204809c2d"/><file name="Formatter.php" hash="e06f27ca673dc58789425ef965467275"/></dir><file name="Feed.php" hash="ddac87d6a060bc77fb7718e7b19e1273"/><file name="Log.php" hash="0d74f297e38bddff9f7c0a3cc86dce8c"/><file name="Observer.php" hash="59b33cf05ec3bf3b349cfef1aea8b84c"/><dir name="Translator"><file name="Category.php" hash="dd209cdda3a1a62042a8a3360ee2dbac"/></dir><file name="Validate.php" hash="7a5fd226b0055e39b725975113e42ee5"/><dir name="Writer"><file name="Abstract.php" hash="53ced825c40d5a6a1d4d35c6de79a68c"/><file name="Csv.php" hash="427fea44d988302f409e1860c18875b1"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="IndexController.php" hash="9cf617525636fba1ed4edf6befb5aeea"/></dir><file name="ApiController.php" hash="98ec77050b59c78874f2bbf76a9c42d6"/><dir name="CatalogSearch"><file name="ResultController.php" hash="9cb1406e901701ea58e663433358a4c6"/></dir><file name="ConfigController.php" hash="0094cf6ffb0410c79d9d5a5a90a31a2d"/><file name="IndexController.php" hash="e8158c90d1b342f4a262e67390bde523"/></dir><dir name="etc"><file name="adminhtml.xml" hash="189a254999463d2ea44669b58c6f0db6"/><file name="config.xml" hash="abb903ef4e3942635ec226170e69e6c5"/></dir><dir name="sql"><dir name="expertrec_setup"><file name="mysql4-install-1.0.0.php" hash="b85230589d57311ab9c8cc335d058770"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Expertrec_Recommendation.xml" hash="c314465f907c89dfe912035be8d48e71"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="expertrec"><file name="recommendation.xml" hash="29d78f020aa26eb5b5d8a2e274e60e4f"/></dir></dir><dir name="template"><dir name="expertrec"><dir name="recommendation"><file name="tracker.phtml" hash="591f8886ce547e817aa9066c85244645"/><dir name="tracking"><file name="product.phtml" hash="71d46668691668e475b9c8f418cf6cbd"/></dir></dir></dir></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Expertrec_Recommendation</name>
4
+ <version>1.1.4</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
7
  <channel>community</channel>
10
  <description>Expertrec search extension helps you have complete control over your site search results. You will be able to add instant autocomplete, spell corrections that learn from the user behaviour on your site, and show product recommendations within the search user interface. It also adds search results pages with facets, sorting by different attributes.</description>
11
  <notes>Expertrec Recommendation plugin for magento sites.</notes>
12
  <authors><author><name>melchi</name><user>melchi</user><email>magento@cloudinfra.in</email></author><author><name>magento</name><user>magento</user><email>magento-team@cloudinfra.in</email></author></authors>
13
+ <date>2017-02-07</date>
14
+ <time>08:05:18</time>
15
+ <contents><target name="magecommunity"><dir name="Expertrec"><dir name="Recommendation"><dir name="Block"><file name="Api.php" hash="3081b070b4e233dbb642610ce8f258b5"/><dir name="Product"><dir name="List"><file name="Toolbar.php" hash="bd05a0d7473829c47662e6b763907ea6"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="5d0519a4bc78aca319c22f3cc7fcb34d"/><file name="Filehelper.php" hash="5ac956e12548398dc159a16eb1a03e8b"/><dir name="Search"><file name="Layout.php" hash="d7b7ec5f4bbd846dd063934f8a267d48"/></dir><file name="Searchhelper.php" hash="dfc4fc81fea519c15517f53645488c7a"/><file name="Suggestionhelper.php" hash="93f3aa295761a510f782856c0180a799"/></dir><dir name="Model"><dir name="Api"><file name="Request.php" hash="7df8b22d74b6a05de86da287687a6e96"/></dir><dir name="Catalogsearch"><file name="Layer.php" hash="2b6252ed8bb4c44d0a1c44b2e7dcc1d8"/></dir><dir name="Feed"><file name="Feedconfig.php" hash="013bd447dccc7cc4f073be5bd53a18c9"/><file name="Feedcreator.php" hash="fa6cf4590cf81073325b6717c8951486"/><file name="Feedfilter.php" hash="d7599a63a8d1f2033cb1e56204809c2d"/><file name="Formatter.php" hash="cb0d747319ef70e122c3558edaf89626"/></dir><file name="Feed.php" hash="ddac87d6a060bc77fb7718e7b19e1273"/><file name="Log.php" hash="27fcee49e67fe2be761b4af94aecff2b"/><file name="Observer.php" hash="5aedaf6c18314b6abee906577e77767f"/><dir name="Translator"><file name="Category.php" hash="dd209cdda3a1a62042a8a3360ee2dbac"/></dir><file name="Validate.php" hash="7a5fd226b0055e39b725975113e42ee5"/><dir name="Writer"><file name="Abstract.php" hash="6b5153c0a09f8d4ee6fe4cedc5ec8a64"/><file name="Csv.php" hash="427fea44d988302f409e1860c18875b1"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="IndexController.php" hash="c4f80c214d11fd531496e71b4951b27f"/></dir><file name="ApiController.php" hash="acee369983ece308acc6f17ed61ff7d6"/><dir name="CatalogSearch"><file name="ResultController.php" hash="9cb1406e901701ea58e663433358a4c6"/></dir><file name="ConfigController.php" hash="0fd9a9686806c26635c7db0a57a0f4ab"/><file name="IndexController.php" hash="7bfaa867dfa9bed0c7b0ebd634d2e2bb"/></dir><dir name="etc"><file name="adminhtml.xml" hash="e86ff2b7aac4d09a4c359f0047b06ca3"/><file name="config.xml" hash="f970fd1bfd4323512c929362ab3d26af"/></dir><dir name="sql"><dir name="expertrec_setup"><file name="mysql4-install-1.0.0.php" hash="4e7e163698fdca36df8c3dd2bd4ceef7"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Expertrec_Recommendation.xml" hash="c314465f907c89dfe912035be8d48e71"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="expertrec"><file name="recommendation.xml" hash="061b28ab9009ff2346977cebe2333cb8"/></dir></dir><dir name="template"><dir name="expertrec"><dir name="feed"><file name="info.phtml" hash="b7c1069fe88c3eda185383ac75884955"/></dir><dir name="recommendation"><file name="tracker.phtml" hash="c4da6289ad644d96d7dac9b5521ae3a1"/><dir name="tracking"><file name="product.phtml" hash="e02d3f870397cf351bc0ff7ca864c7e2"/></dir></dir></dir></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>