Problem/Motivation
This issue was originally reported by: cgalibar.
Currently, the views_filters_summary module does not display summaries for exposed filters on Drupal Commerce Product types. This is because the filter plugin used by Commerce, commerce_entity_bundle, is not recognized by the main module.
Filtering a product catalog by its type (e.g., "T-shirts", "Shoes") is a very common and essential use case for e-commerce sites, and users expect to see a summary of the active filters.
After a discussion with the module maintainer, we've agreed that the best approach to solve this is to create a dedicated submodule for Commerce integration. This avoids adding a dependency on drupal/commerce to the main module and keeps the logic cleanly separated.
Steps to reproduce
- Create a View of Commerce Products with an exposed filter for Product type.
- Add the "Views Filters Summary" area to the View's header or footer.
- On the View page, filter by a product type.
Result: No summary is displayed for the selected product type filter, which is confusing for the end-user.
Proposed resolution
I have developed a new submodule named views_filters_summary_commerce that resolves this issue.
This submodule is very lightweight and simply implements hook_views_filters_summary_plugin_alias_alter() to inform the main module that commerce_entity_bundle should be treated like the standard bundle plugin. This is a clean and maintainable way to add the integration.
Benefits of this approach:
- The main views_filters_summary module remains completely independent of Drupal Commerce.
- Users without Commerce are not affected by this new functionality.
- The Commerce-specific logic is properly isolated.
- Installation is simple: users with Commerce just need to enable the new submodule.
A Merge Request that adds the new submodule to the project will be provided for review.
Remaining tasks
- Provide a Merge Request containing the new submodule.
- Review the submodule's code and the overall approach.
- Commit the new feature to the project.
User interface changes
A new submodule, "Views Filters Summary Commerce Integration", will be available on the module administration page for users to enable.
Issue fork views_filters_summary-3548741
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
mably commentedComment #6
mably commented