Skip to content
Open
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions blocks/product-list-page/product-list-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,11 @@ function getFilterFromParams(filterParam) {
attribute,
in: value.split(commaRegex),
});
} else if (value.includes('-')) {
// Handle range values (like price)
}

const rangeRegex = /^\d+(\.\d+)?-\d+(\.\d+)?$/;

if (rangeRegex.test(value)) {
const [from, to] = value.split('-');
results.push({
attribute,
Expand All @@ -263,7 +266,7 @@ function getFilterFromParams(filterParam) {
},
});
} else {
// Handle single values (like categories with one value)
// Supports hyphens in category/url keys
results.push({
attribute,
in: [value],
Expand Down
Loading