@riosst100/pwa-marketplace 2.5.7 → 2.5.9

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.
Files changed (32) hide show
  1. package/package.json +1 -1
  2. package/src/components/FilterContent/filterContent.js +376 -0
  3. package/src/components/FilterContent/filterContent.module.css +76 -0
  4. package/src/components/FilterContent/filterDefault.js +84 -0
  5. package/src/components/FilterContent/filterDefault.module.css +0 -0
  6. package/src/components/FilterContent/filterItem.js +80 -0
  7. package/src/components/FilterContent/index.js +1 -0
  8. package/src/components/FilterListContent/filterListPage.js +414 -0
  9. package/src/components/FilterListContent/index.js +1 -0
  10. package/src/components/FilterListPage/index.js +1 -0
  11. package/src/components/Seller/seller.js +0 -6
  12. package/src/components/SetsData/setsData.js +1 -1
  13. package/src/overwrites/peregrine/lib/store/actions/cart/asyncActions.js +0 -21
  14. package/src/overwrites/peregrine/lib/talons/FilterSidebar/useFilterSidebar.js +0 -12
  15. package/src/overwrites/peregrine/lib/talons/RootComponents/Category/categoryContent.gql.js +2 -0
  16. package/src/overwrites/venia-ui/lib/RootComponents/Category/category.js +14 -1
  17. package/src/overwrites/venia-ui/lib/RootComponents/Category/categoryContent.js +2 -6
  18. package/src/overwrites/venia-ui/lib/components/CartPage/ProductListing/productListing.js +0 -9
  19. package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/paymentMethods.js +0 -9
  20. package/src/overwrites/venia-ui/lib/components/FilterModal/CurrentFilters/currentFilter.js +12 -2
  21. package/src/overwrites/venia-ui/lib/components/FilterModal/CurrentFilters/currentFilter.module.css +4 -3
  22. package/src/overwrites/venia-ui/lib/components/FilterModal/CurrentFilters/currentFilters.js +2 -1
  23. package/src/overwrites/venia-ui/lib/components/FilterModal/CurrentFilters/currentFilters.module.css +7 -4
  24. package/src/overwrites/venia-ui/lib/components/FilterModal/FilterList/filterList.js +13 -3
  25. package/src/overwrites/venia-ui/lib/components/FilterSidebar/filterSidebar.js +0 -3
  26. package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/item.js +0 -1
  27. package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/orderDetails.js +0 -1
  28. package/src/talons/FilterContent/useFilterContent.js +291 -0
  29. package/src/talons/FilterTop/useFilterTop.js +0 -2
  30. package/src/talons/SellerProducts/productContent.gql.js +1 -0
  31. package/src/talons/SellerProducts/useSellerProducts.js +0 -2
  32. package/src/talons/ShopBy/useShopBy.js +15 -20
@@ -0,0 +1,414 @@
1
+ import React, { Fragment, useEffect, useMemo, useState } from 'react';
2
+ import ErrorView from '@magento/venia-ui/lib/components/ErrorView';
3
+ import { StoreTitle, Meta } from '@magento/venia-ui/lib/components/Head';
4
+ import { useSetsData } from '@riosst100/pwa-marketplace/src/talons/SetsData/useSetsData';
5
+ import { Link } from 'react-router-dom';
6
+ import resourceUrl from '@magento/peregrine/lib/util/makeUrl';
7
+ import defaultClasses from '@riosst100/pwa-marketplace/src/components/FilterListContent/setsData.module.css';
8
+ import { useStyle } from '@magento/venia-ui/lib/classify';
9
+ import cn from 'classnames';
10
+ import Divider from '@riosst100/pwa-marketplace/src/components/Divider';
11
+ import { SetsDataShimmer } from '@riosst100/pwa-marketplace/src/components/SetsData';
12
+ import CustomSortBy from '@riosst100/pwa-marketplace/src/components/CustomSortBy';
13
+ import ArraySearchInput from '@riosst100/pwa-marketplace/src/components/ArraySearchInput';
14
+ import { useCustomSort } from '@riosst100/pwa-marketplace/src/hooks/useCustomSort';
15
+ import Breadcrumbs from '@magento/venia-ui/lib/components/Breadcrumbs';
16
+ import { useLocation } from 'react-router-dom';
17
+ import { getFiltersFromSearch } from '@magento/peregrine/lib/talons/FilterModal/helpers';
18
+
19
+ const FilterListPage = props => {
20
+ const { categoryId } = props
21
+
22
+ const { location } = globalThis;
23
+
24
+ const { search } = useLocation();
25
+
26
+ const query = new URLSearchParams(location.search);
27
+
28
+ const [active, setActive] = useState('all');
29
+ const [activeTab, setActiveTab] = useState('all');
30
+ const [activeFilter, setActiveFilter] = useState('');
31
+ const [activeYear, setActiveYear] = useState('');
32
+ const [searchQuery, setSearchQuery] = useState('');
33
+
34
+ const shopby = query.get('shopby') || null;
35
+ const setType = query.get('set_type') || null;
36
+
37
+ let defaultSort = {
38
+ sortText: 'All (A-Z)',
39
+ value: 'all'
40
+ };
41
+
42
+ if (shopby == "release_year") {
43
+ defaultSort = {
44
+ sortText: 'All (By Year)',
45
+ value: 'date'
46
+ };
47
+ }
48
+
49
+ // Sorting
50
+ const sortProps = useCustomSort({ sortFromSearch: false, defaultSort: defaultSort});
51
+ const [currentSort] = sortProps;
52
+ // const [sortBy, setSortBy] = useState({
53
+ // sortText: 'All (A-Z)',
54
+ // value: 'all'
55
+ // });
56
+
57
+ // let availableSortBy = [
58
+ // {
59
+ // 'label': 'All (A-Z)',
60
+ // 'value': 'all'
61
+ // },
62
+ // {
63
+ // 'label': 'By Year',
64
+ // 'value': 'newest'
65
+ // }
66
+ // ];
67
+
68
+ const classes = useStyle(defaultClasses);
69
+
70
+ const talonProps = useFilterListPage({ activeFilter, activeYear, searchQuery, setActive, currentSort, shopby, setType, categoryId, activeTab });
71
+
72
+ const { error, loading, setsData, categoryUrlSuffix, categoryUrlKey, productType, filteredSetsData, availableGroups, availableYears, category, attributeData, pageInfo } = talonProps;
73
+
74
+ if (loading && !setsData)
75
+ return <SetsDataShimmer />;
76
+ if (error && !setsData) return <ErrorView />;
77
+
78
+ if (!setsData && !loading && !error) {
79
+ return <SetsDataShimmer />;
80
+ }
81
+
82
+ const setsLengthArr = [];
83
+
84
+ const newSetsData = searchQuery || activeYear ? filteredSetsData : setsData;
85
+
86
+ // useEffect(() => {
87
+ if (setsData && setsData.length) {
88
+ setsData.map((setRelease, index) => {
89
+ const { group, sets } = setRelease;
90
+
91
+ setsLengthArr[group] = sets.length
92
+ })
93
+ }
94
+ // }, [setsData])
95
+
96
+ const splitToNChunks = (array, n) => {
97
+ let result = [];
98
+ for (let i = n; i > 0; i--) {
99
+ result.push(array.splice(0, Math.ceil(array.length / i)));
100
+ }
101
+ return result;
102
+ }
103
+
104
+ let allSetsTitle = "Sets";
105
+ let attributeCode = attributeData ? attributeData.attribute_code : '';
106
+ let byYearTitle = "By Year";
107
+ // if (shopby == "singles") {
108
+ // attributeCode = "lego_set_name";
109
+ // // allSetsTitle = "Singles";
110
+ // byYearTitle = "By Year";
111
+ // }
112
+
113
+ let newfilterSearchArr = search ? search.split('&') : [];
114
+ newfilterSearchArr = newfilterSearchArr.filter(function(data) {
115
+ return !data.includes(attributeCode + '%5Bfilter%5D') && !data.includes('shopby');
116
+ });
117
+
118
+ let filterSearch = newfilterSearchArr.join('&')
119
+
120
+ if (!filterSearch.includes('?')) {
121
+ filterSearch = '?'+filterSearch;
122
+ }
123
+
124
+ const setRelases = newSetsData && newSetsData.length && newSetsData.map((setRelease, index) => {
125
+ const { group, release_year, sets } = setRelease;
126
+
127
+ const setsResult = [];
128
+
129
+ if (sets.length) {
130
+ sets.map((set, index) => {
131
+ const { products_count, set_name, option_id, release_year } = set;
132
+
133
+ const categoryUrl = resourceUrl(
134
+ `/${category?.url_path}${categoryUrlSuffix || ''}${filterSearch || ''}&${attributeCode}[filter]=${set_name},${option_id}`
135
+ );
136
+
137
+ if (parseInt(products_count) > 0) {
138
+ setsResult.push(<li key={index} className='list-none'>
139
+ <Link to={categoryUrl} className="hover_bg-darkblue-900 hover_text-white w-full block text-[14px] py-[2px] px-0">
140
+ {set_name} <span className='text-[12px]'>({products_count})</span>
141
+ </Link>
142
+ </li>)
143
+ } else {
144
+ setsResult.push(<li key={index} className='list-none'>
145
+ <span className="text-[#8f8f8f] w-full block text-[14px] py-[2px] px-0">
146
+ {set_name} <span className='text-[12px]'>({products_count})</span>
147
+ </span>
148
+ </li>)
149
+ }
150
+ })
151
+ }
152
+
153
+ let setsResultSplitted = [];
154
+ if (active && active == group || newSetsData.length == 1) {
155
+ setsResultSplitted = splitToNChunks(setsResult, 3);
156
+ }
157
+
158
+ return (
159
+ <>
160
+ {active == "all" && activeYear && activeYear == release_year && newSetsData.length > 1 || active == "all" && !activeYear && newSetsData.length > 1 ?
161
+ <div className={cn('singles_group-wrapper mb-4 px-2 inline-block', classes.singlesGroupWrapper)}>
162
+ {shopby == "secret_lair" ? <div className='singles_item_group_letter text-[14px] font-medium border-b border-gray-100 pb-1 mb-2'>
163
+ {group}
164
+ </div> : <div className='singles_item_group_letter text-xl font-medium border-b border-gray-100 pb-1 mb-2' >
165
+ {group}
166
+ </div>}
167
+ <div className={cn('singles_item-list flex flex-col')}>{setsResult}</div>
168
+ </div> : ''}
169
+ {active == group || newSetsData.length == 1 ? setsResultSplitted && setsResultSplitted.length && setsResultSplitted.map((setsResult, index) =>
170
+ <div key={index} className={cn('singles_group-wrapper mb-4 px-2 inline-block', classes.singlesGroupWrapper)}>
171
+ {index == 0 ? shopby == "secret_lair" ? <div className='singles_item_group_letter text-[14px] font-medium border-b border-gray-100 pb-1 mb-2'>
172
+ {group}
173
+ </div> : <div className='singles_item_group_letter text-xl font-medium border-b border-gray-100 pb-1 mb-2' >
174
+ {group}
175
+ </div> :
176
+ (shopby == "secret_lair" ? <div className='singles_item_group_letter text-[14px] font-medium pb-1 mb-2' style={{"marginTop":"22px"}}></div> : <div className='singles_item_group_letter text-xl font-medium pb-1 mb-2' style={{"marginTop":"35px"}}></div>)}
177
+ <div className={cn('singles_item-list flex flex-col')}>{setsResult}</div>
178
+ </div>
179
+ )
180
+ : ''}
181
+ </>
182
+ );
183
+ });
184
+
185
+ const handleActive = (val) => {
186
+ setActive(val);
187
+
188
+ setSearchQuery('')
189
+ }
190
+
191
+ const handleActiveTab = (val) => {
192
+ setActiveTab(val);
193
+ setActive('all');
194
+ setActiveFilter('');
195
+
196
+ setSearchQuery('')
197
+ }
198
+
199
+ const handleActiveYear = (val) => {
200
+ setActiveYear(val);
201
+ setActive('all');
202
+ setActiveFilter('');
203
+ setSearchQuery('')
204
+ }
205
+
206
+ const handleSearchQuery = (val) => {
207
+ setSearchQuery(val)
208
+ setActiveYear('');
209
+ setActive('all')
210
+ }
211
+
212
+ let alpha = ['#', 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'];
213
+
214
+ let title = pageInfo ? pageInfo.title : 'All S2ets';
215
+ if (activeTab == "year") {
216
+ title = "Sets | By Year";
217
+ }
218
+
219
+ const availableFilters = [
220
+ 'Theme',
221
+ 'Sub-Theme',
222
+ 'Interest',
223
+ 'Age Level'
224
+ ];
225
+
226
+ const handleActiveFilter = (val) => {
227
+ setActiveFilter(val);
228
+
229
+ setActive('all');
230
+
231
+ setSearchQuery('')
232
+ }
233
+
234
+ const activeFilters = [];
235
+
236
+ const allActiveFilters = getFiltersFromSearch(search);
237
+
238
+ if (allActiveFilters && allActiveFilters.size > 0) {
239
+ allActiveFilters.forEach((value, key) => {
240
+ value.forEach((value) => {
241
+ const filterArr = value.split(',');
242
+
243
+ const label = filterArr[0];
244
+ const optionId = filterArr[1];
245
+ if (label == "Singles") {
246
+ isSingles = true;
247
+ }
248
+ if (key == "bricks_categories" || key == "sc_sports_categories" || key == "card_game" || key == "product_line" && urlKey == "brands" || key == "product_line" && urlKey == "franchise" || key == "franchise" && urlKey == "brands" || key == "franchise" && urlKey == "franchise" || key == "brands" && urlKey == "franchise" || key == "brands" && urlKey == "brands" || virtualCategoryFilters && virtualCategoryFilters.includes(key)) {
249
+ activeFilters.push(
250
+ {
251
+ 'label': label,
252
+ 'code': key,
253
+ 'option_id': optionId
254
+ }
255
+ )
256
+ }
257
+ })
258
+ });
259
+ }
260
+
261
+ return (
262
+ <Fragment>
263
+ <StoreTitle>{title}</StoreTitle>
264
+ <Breadcrumbs categoryId={categoryId} currentFilter={activeFilters} customPage={shopby == "singles" ? "Mini-Figures" : title} />
265
+ {shopby == "secret_lair" ? <>
266
+ <ul className={classes.nav}>
267
+ {availableYears.map((group, index) => (
268
+ <li key={index} className={classes.nav_item}>
269
+ <button
270
+ onClick={() => {
271
+ handleActiveYear(group)
272
+ }}
273
+ >
274
+ {activeYear == group ? <b>{group}</b> : group}
275
+ </button>
276
+ </li>
277
+ ))}
278
+ <li key={"all"} className={classes.nav_item}>
279
+ <button
280
+ onClick={() => {
281
+ handleActiveYear('')
282
+ }}
283
+ >
284
+ {!activeYear ? <b>All Year</b> : 'All Year'}
285
+ </button>
286
+ </li>
287
+ </ul>
288
+ </> : ''}
289
+ {shopby == "lego_set_name" && activeTab == "all" ? <>
290
+ <ul className={classes.nav}>
291
+ {availableFilters.map((group, index) => (
292
+ <li key={index} className={classes.nav_item}>
293
+ <button
294
+ onClick={() => {
295
+ handleActiveFilter(group)
296
+ }}
297
+ >
298
+ {activeFilter == group ? <b>{group}</b> : group}
299
+ </button>
300
+ </li>
301
+ ))}
302
+ <li key={"all"} className={classes.nav_item}>
303
+ <button
304
+ onClick={() => {
305
+ handleActiveFilter('')
306
+ }}
307
+ >
308
+ {!activeFilter ? <b>A-Z</b> : 'A-Z'}
309
+ </button>
310
+ </li>
311
+ </ul>
312
+ </> : ''}
313
+ {!pageInfo.hide_title && <h1 className='mx-auto relative block text-xl font-bold text-center pt-10 pb-4'>
314
+ {title}
315
+ </h1>}
316
+ {activeTab == "year" && availableGroups ? <ul className={classes.nav}>
317
+ {availableGroups.map((group, index) => (
318
+ <li key={index} className={classes.nav_item}>
319
+ <button
320
+ onClick={() => {
321
+ handleActive(group)
322
+ }}
323
+ >
324
+ {active == group ? <b>{group}</b> : group}
325
+ </button>
326
+ </li>
327
+ ))}
328
+ <li key={'all'} className={classes.nav_item}>
329
+ <button
330
+ onClick={() => {
331
+ handleActive('all')
332
+ }}
333
+ >
334
+ {active == 'all' ? <b>All</b> : 'All'}
335
+ </button>
336
+ </li>
337
+ </ul> : ''}
338
+ {pageInfo.filter_group && <ul className={classes.nav}>
339
+ {availableGroups.map((group, index) => (
340
+ <li key={index} className={classes.nav_item}>
341
+ <button
342
+ onClick={() => {
343
+ handleActive(group)
344
+ }}
345
+ >
346
+ {active == group ? <b>{group}</b> : group}
347
+ </button>
348
+ </li>
349
+ ))}
350
+ {availableGroups && availableGroups.length ? <li key={'all'} className={classes.nav_item}>
351
+ <button
352
+ onClick={() => {
353
+ handleActive('all')
354
+ }}
355
+ >
356
+ {active == 'all' ? <b>All</b> : 'All'}
357
+ </button>
358
+ </li> : ''}
359
+ </ul>}
360
+ <div className='border border-gray-100 px-6'>
361
+ {setsData ? (
362
+ <div
363
+ className={classes.toolbar}
364
+ >
365
+ <div style={{"width":"35%"}}><ArraySearchInput active={active} searchQuery={searchQuery} placeholder="Search sets..." isOpen={true} setSearchQuery={handleSearchQuery} /></div>
366
+ {/* <CustomSortBy sortProps={sortProps} availableSortMethods={availableSortBy} /> */}
367
+ </div>
368
+ ) : ''}
369
+ {shopby != "secret_lair" && <section className='single_list-indexing-container relative m-auto pt-5'>
370
+ {shopby != "secret_lair" && !activeFilter && activeTab != "year" && <ul className='flex gap-2 justify-center flex-wrap'>
371
+ <li key={'all'}>
372
+ <button
373
+ className={cn(
374
+ 'rounded-md border border-solid border-gray-100 p-2 min-w-[28px]',
375
+ 'leading-4 font-medium text-base hover_bg-gray-50'
376
+ )}
377
+ onClick={() => {
378
+ handleActive('all')
379
+ }}
380
+ >
381
+ {active == 'all' ? <b>All</b> : 'All'}
382
+ </button>
383
+ </li>
384
+ {alpha.map((letter, index) => (
385
+ <li key={index}>
386
+ <button
387
+ className={cn(
388
+ 'rounded-md border border-solid border-gray-100 p-2 min-w-[28px]',
389
+ 'leading-4 font-medium text-base ',
390
+ setsLengthArr[letter] > 0 ? 'hover_bg-gray-50' : 'bg-gray-100 text-gray-400',
391
+ )}
392
+ onClick={() => {
393
+ handleActive(letter)
394
+ }}
395
+ disabled={setsLengthArr[letter] > 0 ? false : true}
396
+ >
397
+ {active == letter ? <b>{letter}</b> : letter}
398
+ </button>
399
+ </li>
400
+ ))}
401
+ </ul>}
402
+ </section>}
403
+ <Divider className="mb-5 px-4 mt-5" />
404
+ <section className='singles-container'>
405
+ <div className={cn('singles-wrapper block -mx-4', classes.singlesWrapper)}>
406
+ {newSetsData && newSetsData.length ? setRelases : (searchQuery ? <div className='singles_group-wrapper mb-4 px-2 inline-block w-full'>No sets found for <b>{searchQuery}</b> search query.</div> : <div className='singles_group-wrapper mb-4 px-2 inline-block w-full'>No sets found.</div>)}
407
+ </div>
408
+ </section>
409
+ </div>
410
+ </Fragment>
411
+ );
412
+ }
413
+
414
+ export default FilterListPage;
@@ -0,0 +1 @@
1
+ export { default } from '@riosst100/pwa-marketplace/src/components/FilterListContent/filterListPage';
@@ -0,0 +1 @@
1
+ export { default } from './filterListPage';
@@ -9,18 +9,12 @@ import SellerDetail from '@riosst100/pwa-marketplace/src/components/SellerDetail
9
9
  const Seller = props => {
10
10
  const { categoryUrlKey } = props;
11
11
 
12
- console.log('categoryUrlKey+'+categoryUrlKey)
13
- console.log(props)
14
-
15
12
  const talonProps = useSeller({
16
13
  mapSeller
17
14
  });
18
15
 
19
16
  const { error, loading, seller } = talonProps;
20
17
 
21
- console.log('---seller')
22
- console.log(seller)
23
-
24
18
  if (loading && !seller)
25
19
  return '';
26
20
  // return <SellerShimmer />;
@@ -402,7 +402,7 @@ const SetsData = props => {
402
402
  </section>}
403
403
  <Divider className="mb-5 px-4 mt-5" />
404
404
  <section className='singles-container'>
405
- <div className={cn('singles-wrapper block -mx-4', classes.singlesWrapper)}>
405
+ <div className={cn('singles-wrapper block', classes.singlesWrapper)}>
406
406
  {newSetsData && newSetsData.length ? setRelases : (searchQuery ? <div className='singles_group-wrapper mb-4 px-2 inline-block w-full'>No sets found for <b>{searchQuery}</b> search query.</div> : <div className='singles_group-wrapper mb-4 px-2 inline-block w-full'>No sets found.</div>)}
407
407
  </div>
408
408
  </section>
@@ -21,20 +21,10 @@ export const createSellerCart = payload =>
21
21
  }
22
22
  });
23
23
 
24
- console.log('datadatadatadata')
25
- console.log(data)
26
-
27
- console.log('data.initCheckoutSplitCart')
28
- console.log(data.initCheckoutSplitCart)
29
-
30
- console.log('data.initCheckoutSplitCart.quote_id')
31
- console.log(data.initCheckoutSplitCart.quote_id)
32
-
33
24
  let receivePayload;
34
25
 
35
26
  if (errors) {
36
27
  receivePayload = new Error(errors);
37
- console.log(errors)
38
28
  } else {
39
29
  receivePayload = data.initCheckoutSplitCart.quote_id;
40
30
  // write to storage in the background
@@ -385,16 +375,9 @@ export const getCartDetails = payload => {
385
375
  const { isSignedIn } = user;
386
376
 
387
377
  const isCheckoutActive = await retrieveCheckoutState();
388
- console.log('isCheckoutActive')
389
- console.log(isCheckoutActive)
390
-
391
378
  const isSplitCartActive = await retrieveSellerCartId();
392
- console.log('isSplitCartActive')
393
- console.log(isSplitCartActive)
394
379
 
395
380
  if (cartId && isSplitCartActive && !isCheckoutActive) {
396
- console.log('JALANIN = removeCart')
397
-
398
381
  await dispatch(removeCart());
399
382
 
400
383
  // Clear cart data from Apollo cache
@@ -402,7 +385,6 @@ export const getCartDetails = payload => {
402
385
 
403
386
  // Create a new cart
404
387
  try {
405
- console.log('JALANIN RESET SPLIT CART')
406
388
  await dispatch(
407
389
  resetSplitCart({
408
390
  removeSplitCart
@@ -411,8 +393,6 @@ export const getCartDetails = payload => {
411
393
 
412
394
  await clearSellerCartId();
413
395
 
414
- console.log('JALANIN CREATE CART')
415
-
416
396
  await dispatch(
417
397
  createCart({
418
398
  fetchCartId
@@ -420,7 +400,6 @@ export const getCartDetails = payload => {
420
400
  );
421
401
  } catch (error) {
422
402
  alert(error);
423
- console.log(error);
424
403
  // If creating a cart fails, all is not lost. Return so that the
425
404
  // user can continue to at least browse the site.
426
405
  return;
@@ -47,18 +47,6 @@ export const useFilterSidebar = props => {
47
47
  nextFetchPolicy: 'cache-first'
48
48
  });
49
49
 
50
- console.log('subFilterItemsCalled')
51
- console.log(subFilterItemsCalled)
52
-
53
- console.log('subFilterItemsLoading')
54
- console.log(subFilterItemsLoading)
55
-
56
- console.log('subFilterItemsError')
57
- console.log(subFilterItemsError)
58
-
59
- console.log('subFilterItems')
60
- console.log(subFilterItems)
61
-
62
50
  const attributeCodes = useMemo(
63
51
  () => filters.map(({ attribute_code }) => attribute_code),
64
52
  [filters]
@@ -12,6 +12,7 @@ export const GET_PRODUCT_FILTERS_BY_CATEGORY = gql`
12
12
  options {
13
13
  label
14
14
  value
15
+ count
15
16
  }
16
17
  position
17
18
  }
@@ -83,6 +84,7 @@ export const GET_STORE_CONFIG_DATA = gql`
83
84
  query GetStoreConfigForBreadcrumbs {
84
85
  # eslint-disable-next-line @graphql-eslint/require-id-when-available
85
86
  storeConfig {
87
+ category_url_suffix
86
88
  store_code
87
89
  custommarketplace_plp_filters_virtualcategory
88
90
  }
@@ -19,6 +19,7 @@ import NonSportCardsSets from '@riosst100/pwa-marketplace/src/components/NonSpor
19
19
  import LegoSets from '@riosst100/pwa-marketplace/src/components/LegoSets/legoSets';
20
20
  import TrainsSets from '@riosst100/pwa-marketplace/src/components/TrainsSets/trainsSets';
21
21
  import SetsData from '@riosst100/pwa-marketplace/src/components/SetsData/setsData';
22
+ import FilterContent from '@riosst100/pwa-marketplace/src/components/FilterContent/filterContent';
22
23
 
23
24
  const MESSAGES = new Map().set(
24
25
  'NOT_FOUND',
@@ -39,6 +40,7 @@ const Category = props => {
39
40
 
40
41
  const query = new URLSearchParams(location.search);
41
42
  const shopby = query.get('shopby') || null;
43
+ const filterby = query.get('filterby') || null;
42
44
  const showSubcategory = query.get('show_subcategory') || null;
43
45
 
44
46
  const talonProps = useCategory({
@@ -91,7 +93,18 @@ const Category = props => {
91
93
  categoryId={uid}
92
94
  isLoading={loading} />
93
95
  ) : (
94
- allowedShopby.includes(shopby) ? <ShopBy
96
+ filterby ? (
97
+ <FilterContent
98
+ categoryId={uid}
99
+ classes={classes}
100
+ data={categoryData}
101
+ filterby={filterby}
102
+ isLoading={loading}
103
+ pageControl={pageControl}
104
+ sortProps={sortProps}
105
+ pageSize={pageSize}
106
+ />
107
+ ) : allowedShopby.includes(shopby) ? <ShopBy
95
108
  categoryId={uid}
96
109
  shopby={shopby}
97
110
  isLoading={loading} /> : shopby == "release_year" || shopby == "secret_lair" || shopby == "expansion_sets" || shopby == "sets" || shopby == "release" ? <SetsData
@@ -317,10 +317,9 @@ const CategoryContent = props => {
317
317
  </div>
318
318
  {/* {activeFilters.size <= 0 && category && category.custom_landing_page ? ( */}
319
319
  <>
320
- {currentFilter && <AlphaFilter isSingles={isSingles} items={items} handleActiveLetter={handleActiveLetter} activeLetter={activeLetter} />}
320
+ {/* {currentFilter && <AlphaFilter isSingles={isSingles} items={items} handleActiveLetter={handleActiveLetter} activeLetter={activeLetter} />} */}
321
321
  {!currentFilter && <CustomSubCategory categoryName={category ? category.name : null} customSubCategory={category ? category.custom_subcategory : null} />}
322
322
  {shopby != "gauge" && category?.name != "Collectible Card Games" ? <SubCategory parent={parent} children={children} /> : ''}
323
-
324
323
  </>
325
324
  {/* ) : ( */}
326
325
  <>
@@ -341,10 +340,7 @@ const CategoryContent = props => {
341
340
  {maybeSortContainer}
342
341
  </div>
343
342
  <div className={cn(classes.heading)}>
344
- <div
345
- data-cy="CategoryContent-categoryInfo"
346
- className={classes.categoryInfo}
347
- >
343
+ <div data-cy="CategoryContent-categoryInfo" className={classes.categoryInfo}>
348
344
  {categoryResultsHeading}
349
345
  </div>
350
346
  </div>
@@ -58,9 +58,6 @@ const ProductListing = props => {
58
58
  );
59
59
  }
60
60
 
61
- console.log('items')
62
- console.log(items)
63
-
64
61
  // Grouping berdasarkan seller_id dengan data seller di atas
65
62
  const groupedItems = items.reduce((acc, item) => {
66
63
  if (!item.seller) {
@@ -83,16 +80,10 @@ const ProductListing = props => {
83
80
  acc[seller_id].items.push(item);
84
81
  return acc;
85
82
  }, {});
86
-
87
- console.log('groupedItems')
88
- console.log(groupedItems)
89
83
 
90
84
  // Ubah hasil ke dalam array
91
85
  const itemsBySeller = Object.values(groupedItems);
92
86
 
93
- console.log('itemsBySeller != []')
94
- console.log(itemsBySeller)
95
-
96
87
  if (itemsBySeller.length) {
97
88
  const productBySellerComponents = itemsBySeller.map((sellerItems, index) => (
98
89
  <ProductListingBySeller
@@ -37,12 +37,6 @@ const PaymentMethods = props => {
37
37
  return null;
38
38
  }
39
39
 
40
- console.log('payments')
41
- console.log(payments)
42
-
43
- console.log('availablePaymentMethods')
44
- console.log(availablePaymentMethods)
45
-
46
40
  const radios = availablePaymentMethods
47
41
  .map(({ code, title }) => {
48
42
  // If we don't have an implementation for a method type, ignore it.
@@ -80,9 +74,6 @@ const PaymentMethods = props => {
80
74
  })
81
75
  .filter(paymentMethod => !!paymentMethod);
82
76
 
83
- console.log('radios != [] harusny')
84
- console.log(radios)
85
-
86
77
  const noPaymentMethodMessage = !radios.length ? (
87
78
  <div className={classes.payment_errors}>
88
79
  <span>