...
|
...
|
@@ -204,13 +204,14 @@ exports.processProductList = (list, options) => { |
|
|
*/
|
|
|
exports.termsSuggestion = (list, options) => {
|
|
|
let termsSuggestion = [];
|
|
|
let query = options.query && decodeURIComponent(options.query.replace(/\%/g, escape('%'))) || '';
|
|
|
|
|
|
_.each(list, (terms, index) => {
|
|
|
termsSuggestion.push({
|
|
|
name: terms,
|
|
|
link: helpers.urlFormat('/', {needSuggestion: 'Y', query: terms, from: 'search'}, 'search'),
|
|
|
select: (options.isChangedQuery && index === 0) ||
|
|
|
(options.needSuggestion === 'Y' && terms === decodeURIComponent(options.query))
|
|
|
(options.needSuggestion === 'Y' && terms === query)
|
|
|
});
|
|
|
});
|
|
|
|
...
|
...
|
|