Skip to content

Commit b460ba4

Browse files
authored
FFWEB-3329: Add Popular Searches
Add Popular Searches Upgrade Web Components version to v5.1.0 Implement redirection to search result page for searchTerm and brand suggests
1 parent ebee4de commit b460ba4

12 files changed

Lines changed: 87 additions & 15 deletions

File tree

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
11
# Changelog
2+
## Unreleased
3+
### Add
4+
- Add Popular Searches
5+
6+
### Change
7+
- Upgrade Web Components default styles
8+
- Upgrade Web Components version to v5.1.0
9+
10+
### Fix
11+
- Implement redirection to search result page for searchTerm and brand suggests
12+
213
## [v6.0.0] - 2025.02.05
314
### BREAKING
415
- IMPORTANT! Update Fact-Finder Web Components library from v4 to v5

assets/css/styles.css

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -649,20 +649,16 @@ ff-slider-control .ffw-slider-control-default .ffw-slider-control-line {
649649
background-color: black;
650650
}
651651

652-
ff-slider-control .ffw-sliderSection {
653-
margin-top: 10px;
654-
}
655-
656652
ff-slider {
657653
display: block;
658-
z-index: -1001;
659654
pointer-events: none;
660655
}
661656

662657
ff-slider .ffw-slider-container {
663658
top: 0;
664659
position: relative;
665660
pointer-events: none;
661+
height: 51px;
666662
}
667663

668664
ff-slider .ffw-triangle {
@@ -697,11 +693,7 @@ ff-slider .ffw-triangle.ffw-no-transition {
697693

698694
ff-slider .ffw-line {
699695
pointer-events: auto;
700-
z-index: 999;
701-
top: 50%;
702-
position: absolute;
703696
height: 1px;
704-
transform: translateY(-50%);
705697
background-color: black;
706698
background-clip: padding-box;
707699
border-top: 25px solid transparent;
@@ -801,3 +793,24 @@ ff-record { margin-top: 10px !important}
801793
#productContainer { background: #fff; margin-top: 30px }
802794

803795
.ff-asn { width: 200px; margin-left: 20px; background: #ffffff; }
796+
797+
ff-suggest .ff-popular-searches {
798+
width: 300px;
799+
padding-bottom: 20px;
800+
background: #fff;
801+
}
802+
ff-suggest .ff-popular-searches h3 {
803+
background: #6a7281;
804+
padding: 10px;
805+
color: #ffffff;
806+
}
807+
808+
ff-suggest .ff-popular-searches div {
809+
margin: 2px 10px;
810+
cursor: pointer;
811+
}
812+
813+
#searchContainer {
814+
background: #fff;
815+
}
816+

assets/js/ff-web-components/bundle.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/js/ff-web-components/bundle.js.LICENSE

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
/**
23
* @license
34
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
@@ -26,7 +27,13 @@
2627
* http://polymer.github.io/PATENTS.txt
2728
*/
2829

29-
/*!
30-
* mustache.js - Logic-less {{mustache}} templates with JavaScript
31-
* http://github.com/janl/mustache.js
32-
*/
30+
/**
31+
@license
32+
Copyright (c) 2019 The Polymer Project Authors. All rights reserved.
33+
This code may only be used under the BSD style license found at
34+
http://polymer.github.io/LICENSE.txt The complete set of authors may be found at
35+
http://polymer.github.io/AUTHORS.txt The complete set of contributors may be
36+
found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
37+
part of the polymer project is also subject to an additional IP rights grant
38+
found at http://polymer.github.io/PATENTS.txt
39+
*/

metadata.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,13 @@
147147
'value' => false,
148148
'position' => $settingPosition++,
149149
],
150+
[
151+
'group' => 'ffFeatures',
152+
'name' => 'ffPopularSearches',
153+
'type' => 'bool',
154+
'value' => false,
155+
'position' => $settingPosition++,
156+
],
150157
[
151158
'group' => 'ffFeed',
152159
'name' => 'ffExportAttributes',

translations/de/ffwebcomponents_de_lang.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@
1818
'FF_YOUR_SEARCH_FOR' => 'Deine Suche nach:',
1919
'FF_RECOMMENDATION' => 'Empfohlene Produkte',
2020
'FF_SIMILAR_PRODUCTS' => 'Ähnliche Produkte',
21+
'FF_POPULAR_SEARCHES' => 'Beliebte Suchanfragen',
2122
];

translations/en/ffwebcomponents_en_lang.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@
1818
'FF_YOUR_SEARCH_FOR' => 'Your search for:',
1919
'FF_RECOMMENDATION' => 'Recommended Products',
2020
'FF_SIMILAR_PRODUCTS' => 'Similar Products',
21+
'FF_POPULAR_SEARCHES' => 'Popular Searches',
2122
];

views/admin_twig/de/ffwebcomponents_de_lang.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
'SHOP_MODULE_ffRecommendations' => 'Empfehlungen',
2626
'SHOP_MODULE_ffSimilarProducts' => 'Ähnliche Produkte',
2727
'SHOP_MODULE_ffPushedProducts' => 'Pushed products',
28+
'SHOP_MODULE_ffPopularSearches' => 'Beliebte Suchanfragen',
2829
'SHOP_MODULE_GROUP_ffFeed' => 'Feed-Einstellungen',
2930
'SHOP_MODULE_ffExportAttributes' => 'Exportierte Attribute',
3031
'HELP_SHOP_MODULE_ffExportAttributes' => 'Wähle die Attribute aus, die du exportieren möchtest. Multi-Attribute werden in einer Spalte gruppiert, und stellen typischerweise Filter dar.',

views/admin_twig/en/ffwebcomponents_en_lang.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
'SHOP_MODULE_ffRecommendations' => 'Recommendations',
2626
'SHOP_MODULE_ffSimilarProducts' => 'Similar products',
2727
'SHOP_MODULE_ffPushedProducts' => 'Pushed products',
28+
'SHOP_MODULE_ffPopularSearches' => 'Popular Searches',
2829
'SHOP_MODULE_GROUP_ffFeed' => 'Feed settings',
2930
'SHOP_MODULE_ffExportAttributes' => 'Exported Attributes',
3031
'HELP_SHOP_MODULE_ffExportAttributes' => 'Select attributes which you want to export. Multi-Attribute set to `No` means that specific attribute will be exported in separate column.',

views/twig/extensions/themes/default/layout/base.html.twig

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,23 @@
5454
}
5555
});
5656
57+
{% if oView.getClassKey() != "search_result" %}
58+
factfinder.notifications.addSuggestClickListener(origin => {
59+
if (origin.suggestion.type === `searchTerm` || origin.suggestion.type === `brand`) {
60+
window.location.href = `?query=${origin.suggestion.searchParams.query}&cl=search_result`;
61+
62+
return false;
63+
}
64+
});
65+
66+
factfinder.notifications.addPopularSearchClickListener(({ origin, popularSearch }) => {
67+
window.location = `?query=${popularSearch.name}&cl=search_result`;
68+
69+
return false;
70+
});
71+
72+
{% endif %}
73+
5774
{% if oViewConf.getSearchImmediate()|escape("js") and oView.getClassKey() == "search_result" %}
5875
const searchParams = factfinder.utils.env.searchParamsFromUrl({ categoryFieldName: `{{oViewConf.getFFStringConfigParam('ffCategoryPathFieldName')}}` });
5976
initialSearch(searchParams, { requestOptions: { origin: `initialSearch` } });

0 commit comments

Comments
 (0)