Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add number range search options #2020

Merged

Conversation

doekenorg
Copy link
Contributor

This PR addresses #1426 by adding a new number_range field for number, quantity and total fields. For products this isn't possible as the field itself contains both a name AND a price.

This PR also resolves an issue with the removal of CAST functions from the query, that we actually still need in order to match numeric values.

image

min-max

There is some JS that prevents the From field from being higher than the value of the To field, and vice versa. There is also a backup validation with an error message if someone gets around it.

@doekenorg
Copy link
Contributor Author

  • Needs a test case

@rafaehlers
Copy link
Contributor

I'm not sure if the input type="number" is the best approach here because it prevents us from searching float/currency numbers: https://www.loom.com/share/fb6dfbdb34684449b8373e18c1efb66e

image

@doekenorg
Copy link
Contributor Author

doekenorg commented Mar 26, 2024

I'm not sure if the input type="number" is the best approach here because it prevents us from searching float/currency numbers: https://www.loom.com/share/fb6dfbdb34684449b8373e18c1efb66e

image

@rafaehlers that's because the step.size is 1 by default. But that can be set to 0.01.

But there might be a better solution. The nice thing about number is that it has the native min and max.

@mrcasual mrcasual added this to the 2.22 milestone Apr 1, 2024
@mrcasual
Copy link
Collaborator

mrcasual commented Apr 9, 2024

@doekenorg, please take a look at this: https://www.loom.com/share/96864d158a8b46dc987a86e4f361c7bb

@mrcasual
Copy link
Collaborator

mrcasual commented Apr 9, 2024

@doekenorg, also, are you able to add support for the product (user-defined price) field?

@doekenorg doekenorg force-pushed the feature/1426-search-bar-enhancement-search-by-number-range branch from 3ba568e to 9990b4b Compare April 10, 2024 10:53
@doekenorg doekenorg force-pushed the feature/1426-search-bar-enhancement-search-by-number-range branch from 7129030 to c7bfc7b Compare April 11, 2024 11:41
@doekenorg doekenorg merged commit a9dc6c4 into develop Apr 11, 2024
1 check passed
@doekenorg doekenorg deleted the feature/1426-search-bar-enhancement-search-by-number-range branch April 11, 2024 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants