@riosst100/pwa-marketplace 1.7.7 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@riosst100/pwa-marketplace",
3
3
  "author": "riosst100@gmail.com",
4
- "version": "1.7.7",
4
+ "version": "1.7.8",
5
5
  "main": "src/index.js",
6
6
  "pwa-studio": {
7
7
  "targets": {
@@ -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>{currentFilter ? currentFilter : categoryName}</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
- {currentFilter ? currentFilter : categoryTitle}
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={filter.path}
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(