-
-
Notifications
You must be signed in to change notification settings - Fork 194
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
Multiple default filters interfere with each other #1151
Comments
Also, when you have default filters (doesn't matter wether its single or I believe the same happens when you clear and search for something. |
The problem would be that when a filter is empty, it would instead apply the default value. There's no way for a filter to send a POST value to indicate it is empty and not populate the default value. I had the same issue with an ecommerce site (being able to filter between order status as well as completed or incomplete orders), and I had to change the "completed" filter to a checkbox that, when ticked, only included "completed" orders. You could possibly do the same with your "shipped" filter. EDIT: These were the scopes I used scopes:
paid:
label: Completed orders only
type: checkbox
default: 1
conditions: placed_at IS NOT NULL
status:
label: Status
type: group
scope: isStatus
modelClass: \BennoThommo\Snowcart\Models\Status
options: getList
placed_at:
label: Placed at
type: daterange
yearRange: 10
conditions: DATE(placed_at) >= ':afterDate' AND DATE(placed_at) <= ':beforeDate' |
I'm not entirely following:
Or does the checkbox avoid this problem..? |
Sorry for the delay @AIC-BV. As I recall, my setup above didn't exhibit any problems when switching pages. If you're willing, would you mind providing us an example in the Test plugin? |
Winter CMS Build
dev-develop
PHP Version
8.1
Database engine
MySQL/MariaDB
Plugins installed
No response
Issue description
When you have multiple defined default filters in
config_filter.yaml
and do the following action:Steps to replicate
See description
Workaround
No response
The text was updated successfully, but these errors were encountered: