@riosst100/pwa-marketplace 1.7.6 → 1.7.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/components/FilterTop/FilterBlockList/filterTopItem.js +1 -1
- package/src/components/FilterTop/FilterBlockList/filterTopItemGroup.js +1 -0
- package/src/components/ShopBy/shopBy.js +10 -2
- package/src/overwrites/venia-ui/lib/RootComponents/Category/categoryContent.js +16 -3
- package/src/overwrites/venia-ui/lib/components/Breadcrumbs/breadcrumbs.js +18 -3
- package/src/overwrites/venia-ui/lib/components/FilterModal/CurrentFilters/currentFilters.js +1 -1
package/package.json
CHANGED
|
@@ -27,7 +27,7 @@ const FilterTopItem = props => {
|
|
|
27
27
|
[group, item, onApply, removeGroup, toggleItem]
|
|
28
28
|
);
|
|
29
29
|
|
|
30
|
-
const element = group == "shopby" ? (
|
|
30
|
+
const element = group == "shopby" || group == "shopby_with_all" ? (
|
|
31
31
|
<Link className={classes.item} to={search ? search + '&shopby=' + value : '?shopby=' + value}>{title}</Link>
|
|
32
32
|
) : (
|
|
33
33
|
activeFilters.includes(value) ? (
|
|
@@ -84,6 +84,7 @@ const FilterTopItemGroup = props => {
|
|
|
84
84
|
return (
|
|
85
85
|
<div className={classes.root}>
|
|
86
86
|
{radioItems}
|
|
87
|
+
{filterElements && filterElements.length > 10 ? <span className={classes.item}><b>More Item</b></span> : ''}
|
|
87
88
|
{filterElements && filterElements.length ? filterElements : group != "shopby" ? (<span className={classes.item}><b>All</b></span>) : ''}
|
|
88
89
|
</div>
|
|
89
90
|
);
|
|
@@ -89,6 +89,7 @@ const ShopBy = props => {
|
|
|
89
89
|
|
|
90
90
|
const [searchQuery, setSearchQuery] = useState('');
|
|
91
91
|
|
|
92
|
+
const { search } = useLocation();
|
|
92
93
|
|
|
93
94
|
const sortProps = useCustomSort({ sortFromSearch: false, defaultSort: {
|
|
94
95
|
sortText: 'All (A-Z)',
|
|
@@ -127,6 +128,10 @@ const ShopBy = props => {
|
|
|
127
128
|
return result;
|
|
128
129
|
}
|
|
129
130
|
|
|
131
|
+
const filterSearchArr = search ? search.split('&') : [];
|
|
132
|
+
filterSearchArr.pop();
|
|
133
|
+
const filterSearch = filterSearchArr.join('&')
|
|
134
|
+
|
|
130
135
|
const setRelases = newAvailableGroups.map((group, index) => {
|
|
131
136
|
const optionsResult = [];
|
|
132
137
|
|
|
@@ -134,8 +139,11 @@ const ShopBy = props => {
|
|
|
134
139
|
dataResult[group].map((option, index) => {
|
|
135
140
|
const { label, value } = option;
|
|
136
141
|
|
|
142
|
+
const filter = attributeData.attribute_code + '[filter]=' + label + ',' + value;
|
|
143
|
+
const params = filterSearch ? filterSearch + '&' + filter : '?' + filter;
|
|
144
|
+
|
|
137
145
|
const categoryUrl = resourceUrl(
|
|
138
|
-
`/${category.url_path}${categoryUrlSuffix || ''}
|
|
146
|
+
`/${category.url_path}${categoryUrlSuffix || ''}${params}`
|
|
139
147
|
);
|
|
140
148
|
|
|
141
149
|
optionsResult.push(<li className='list-none'>
|
|
@@ -143,7 +151,7 @@ const ShopBy = props => {
|
|
|
143
151
|
{label}
|
|
144
152
|
</Link>
|
|
145
153
|
</li>)
|
|
146
|
-
})
|
|
154
|
+
});
|
|
147
155
|
|
|
148
156
|
let optionsResultSplitted = [];
|
|
149
157
|
if (active == group) {
|
|
@@ -226,6 +226,8 @@ const CategoryContent = props => {
|
|
|
226
226
|
|
|
227
227
|
let isSingles = false;
|
|
228
228
|
|
|
229
|
+
console.log(allActiveFilters)
|
|
230
|
+
|
|
229
231
|
if (allActiveFilters && allActiveFilters.size > 0) {
|
|
230
232
|
allActiveFilters.forEach((value, key) => {
|
|
231
233
|
value.forEach((value) => {
|
|
@@ -239,7 +241,9 @@ const CategoryContent = props => {
|
|
|
239
241
|
if (virtualCategoryFilters && virtualCategoryFilters.includes(key)) {
|
|
240
242
|
activeFilters.push(
|
|
241
243
|
{
|
|
242
|
-
'label': label
|
|
244
|
+
'label': label,
|
|
245
|
+
'code': key,
|
|
246
|
+
'option_id': optionId
|
|
243
247
|
}
|
|
244
248
|
)
|
|
245
249
|
}
|
|
@@ -249,10 +253,19 @@ const CategoryContent = props => {
|
|
|
249
253
|
|
|
250
254
|
const currentFilter = activeFilters && activeFilters.length ? activeFilters[activeFilters.length - 1].label : '';
|
|
251
255
|
|
|
256
|
+
// console.log(activeFilters.length)
|
|
257
|
+
// console.log(activeFilters.map(u => u.label).join(' - '))
|
|
258
|
+
|
|
259
|
+
const title = activeFilters ? (
|
|
260
|
+
activeFilters.length > 1 ?
|
|
261
|
+
activeFilters.map(u => u.label).join(' - ')
|
|
262
|
+
: currentFilter
|
|
263
|
+
) : categoryName;
|
|
264
|
+
|
|
252
265
|
return (
|
|
253
266
|
<Fragment>
|
|
254
267
|
<Breadcrumbs categoryId={categoryId} currentFilter={activeFilters} />
|
|
255
|
-
<StoreTitle>{
|
|
268
|
+
<StoreTitle>{title}</StoreTitle>
|
|
256
269
|
<article className={classes.root} data-cy="CategoryContent-root">
|
|
257
270
|
<div className={classes.categoryHeader}>
|
|
258
271
|
<h1 aria-live="polite" className={classes.title}>
|
|
@@ -260,7 +273,7 @@ const CategoryContent = props => {
|
|
|
260
273
|
className={classes.categoryTitle}
|
|
261
274
|
data-cy="CategoryContent-categoryTitle"
|
|
262
275
|
>
|
|
263
|
-
{
|
|
276
|
+
{title}
|
|
264
277
|
</span>
|
|
265
278
|
</h1>
|
|
266
279
|
{categoryDescriptionElement}
|
|
@@ -73,8 +73,12 @@ const Breadcrumbs = props => {
|
|
|
73
73
|
// console.log(currentFilter)
|
|
74
74
|
|
|
75
75
|
const filterBreadcrumbsElement = [];
|
|
76
|
+
|
|
77
|
+
const lastIndex = currentFilter.length - 1;
|
|
78
|
+
// const filterpath = ;
|
|
76
79
|
|
|
77
80
|
currentFilter && currentFilter.length && currentFilter.map((filter, index) => {
|
|
81
|
+
console.log(filter)
|
|
78
82
|
currentProduct ? (
|
|
79
83
|
filterBreadcrumbsElement.push(
|
|
80
84
|
<>
|
|
@@ -82,7 +86,7 @@ const Breadcrumbs = props => {
|
|
|
82
86
|
<Link
|
|
83
87
|
key={index}
|
|
84
88
|
className={classes.link}
|
|
85
|
-
to={
|
|
89
|
+
to={resourceUrl('/'+currentCategoryPath)}
|
|
86
90
|
onClick={handleClick}
|
|
87
91
|
>
|
|
88
92
|
{filter.label}
|
|
@@ -97,7 +101,7 @@ const Breadcrumbs = props => {
|
|
|
97
101
|
<Link
|
|
98
102
|
key={index}
|
|
99
103
|
className={classes.link}
|
|
100
|
-
to={resourceUrl(currentCategoryPath)}
|
|
104
|
+
to={resourceUrl('/'+currentCategoryPath)}
|
|
101
105
|
onClick={handleClick}
|
|
102
106
|
>
|
|
103
107
|
{filter.label}
|
|
@@ -105,10 +109,21 @@ const Breadcrumbs = props => {
|
|
|
105
109
|
</>
|
|
106
110
|
)
|
|
107
111
|
) : filterBreadcrumbsElement.push(
|
|
112
|
+
index == lastIndex ?
|
|
108
113
|
<span key={index}>
|
|
109
114
|
<span className={classes.divider}>{DELIMITER}</span>
|
|
110
115
|
<span className={cn(classes.currentCategory, 'text-blue-700 font-medium')}>{filter.label}</span>
|
|
111
|
-
</span>
|
|
116
|
+
</span> : <>
|
|
117
|
+
<span className={classes.divider}>{DELIMITER}</span>
|
|
118
|
+
<Link
|
|
119
|
+
key={index}
|
|
120
|
+
className={classes.link}
|
|
121
|
+
to={resourceUrl('/'+currentCategoryPath+'?' + filter.code + '[filter]=' + filter.label + ',' + filter.option_id)}
|
|
122
|
+
onClick={handleClick}
|
|
123
|
+
>
|
|
124
|
+
{filter.label}
|
|
125
|
+
</Link>
|
|
126
|
+
</>
|
|
112
127
|
)
|
|
113
128
|
);
|
|
114
129
|
});
|
|
@@ -20,7 +20,7 @@ const CurrentFilters = props => {
|
|
|
20
20
|
const { title, value } = item || {};
|
|
21
21
|
const key = `${group}::${title}_${value}`;
|
|
22
22
|
|
|
23
|
-
const customAttributeLandingPage = ['card_set', 'sc_baseball_release','auction','special_price','lof_preorder'];
|
|
23
|
+
const customAttributeLandingPage = ['card_set', 'sc_baseball_release','auction','special_price','lof_preorder','sc_baseball_inserts','sc_baseball_parallel'];
|
|
24
24
|
|
|
25
25
|
if (!customAttributeLandingPage.includes(group)) {
|
|
26
26
|
elements.push(
|