@riosst100/pwa-marketplace 1.7.6 → 1.7.7
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
|
@@ -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) {
|