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

  1. Create a View of Commerce Products with an exposed filter for Product type.
  2. Add the "Views Filters Summary" area to the View's header or footer.
  3. 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.

Command icon 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

mably created an issue. See original summary.

mably’s picture

Issue summary: View changes

cgalibar made their first commit to this issue’s fork.

  • mably committed 2f4cc957 on 3.x authored by cgalibar
    Issue #3548741 by mably, cgalibar: Provide Commerce product support via...
mably’s picture

Status: Active » Fixed

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.