datakick Posted March 21 Posted March 21 Hello everyone, I'd like to announce new upcoming feature, and as always ask for testing and reporting any and all issues, problems, and enhancement requests. This new functionality is names List Filters. You can test it by upgrading your store to list-filters branch (using core updater in custom targets) What this new functionality do? On every (filterable) lists in back office you will find a new icon in upper right corner: When you click on it, new section will appear. Here, you can define additional filters that will be applied to the list. The new filters are applied together with the standard filters from list header. But these new filters are slightly more powerful, because you can select operator - not, contains, starts with, between, any of Also, developers can define additional filters in AdminControllers that do not depend on list columns. For example, I have added new filter fields for Order list controller - (Customer - Email, Customer - First Name, Customer - Last Name). So you can filter order list by customer email, even though customer email is non one of list columns! We will be slowly adding more and more filter fields based on your suggestions. Let us know what you need!. This functionality is not 100% completed, but it's quite stable. I've been using it on few production servers without any issues for a few weeks now, so it should be safe for you to test it as well. We already have a few enhancement we want to implement. One of them is support for filter presets -- you will be able to save your filter settings, and easily switch between different presets. Now it's your turn. Please test and give feedback. I'm sure there is a lot to improve here. I'm very excited about this new feature, as I wanted to do have this for a few years now. And finally it's coming 🙂 6
datakick Posted March 21 Author Posted March 21 For developers here: you can test adding your own filter fields by modifying Admin***Controller classes, using new property filters_list. This property accepts the fields in the same format as property fields_list (which is used to define list columns) Example from AdminOrdersController: This is all that is needed to support filtering on customer email and names: https://github.com/thirtybees/thirtybees/blob/f59054511624de2131f86e4373604f827362468e/controllers/admin/AdminOrdersController.php#L214-L230 $this->filters_list = [ 'customer_email' => [ 'title' => $this->l('Customer - Email'), 'type' => 'text', 'filter_key' => 'c!email' ], 'customer_first_name' => [ 'title' => $this->l('Customer - First Name'), 'type' => 'text', 'filter_key' => 'c!firstname' ], 'customer_last_name' => [ 'title' => $this->l('Customer - Last Name'), 'type' => 'text', 'filter_key' => 'c!lastname' ], ];
DRMasterChief Posted March 22 Posted March 22 Interesting possibility, I don't have a use for it that I can think of yet, but as always, thanks for your work and i will test it!
datakick Posted March 23 Author Posted March 23 21 hours ago, DRMasterChief said: Interesting possibility, I don't have a use for it that I can think of yet, but as always, thanks for your work and i will test it! There are a lot of use cases, but I guess it depends on what needs you have. For example, we have recently used this feature to find all products within certain profit margin range.
wakabayashi Posted March 24 Posted March 24 (edited) Thanks a lot for this new feature! It will be very helpful. Something similair was on my ToDo list as well 😏 I will have break in early april. Afterwards I will update our system to new PHP version and will also upgrade again to bleeding edge. Then I can test it with my live site 🤩 Edited March 24 by wakabayashi
wakabayashi Posted Wednesday at 04:08 PM Posted Wednesday at 04:08 PM I am now playing around with this... What is the technique behind it, where are the filter values saved? In cookies? With a pretty basic list of my module, it seems to work fine. With a very complex list, I get the following:
datakick Posted Thursday at 06:56 AM Author Posted Thursday at 06:56 AM Thanks for testing 14 hours ago, wakabayashi said: I am now playing around with this... What is the technique behind it, where are the filter values saved? In cookies? Yes, so far the values are saved in cookies. However, there is now an abstraction (ListViewStorage interface) that will make it possible to save filter values differently in the future. It's a todo task that I would like to implement soon. With this in place, cookies will be much smaller, and we will be able to implement additional features like saved filter presets. I think that will make this quite useful 14 hours ago, wakabayashi said: With a pretty basic list of my module, it seems to work fine. With a very complex list, I get the following... Thanks for bug report. I believe I have fixed this - could you please re-test on latest version of this branch? If you still get the error, please send me a controller class, so I can figure out what is wrong. 1
wakabayashi Posted Thursday at 08:12 AM Posted Thursday at 08:12 AM Thanks you very much. It works now 👍 This feature will be so great, love it. Especially, if we can save presets. 🤩 As I had this functionality in mind too. I wonder about something. Why do you implement the new $this->filters_list? I wanted to add this functionality $this->fields_list, then I would also allow an employee to select the columns he wants to display. He could then save the columns and also filters. IMO this would help merchants to customize their list to their needs even further. They can just hide unnecessary stuff and as a dev we can add more columns, without having to think a lot about "is it too much". A module like orderlistcarriers would just be obsolete with a few lines of code. Also your example with the customer email would be good. Maybe some merchants would like to see in orders list!? I hope you get my proposal. Maybe I don't see the drawbacks!? 😊 1
datakick Posted Thursday at 08:22 AM Author Posted Thursday at 08:22 AM Sure, it make sense, but only after we add support for list column customization. Without it, there would be too much clutter. 1
datakick Posted yesterday at 06:47 AM Author Posted yesterday at 06:47 AM I've added the option to set columns as hidden by default. When you create list column, you can pass 'hidden' => true, and thirtybees will not show it by default. Here's example: https://github.com/thirtybees/thirtybees/blob/f27320165d9e788af9f702af547adaaed6e0db90/controllers/admin/AdminOrdersController.php#L179 Once we implement list column customization, we will be able to show those default hidden columns, hide columns that are displayed by default, or even reorder columns in the list. 2
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now