Provide Commerce product support via a new submodule

Created on 25 September 2025, 11 days ago

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.

Feature request
Status

Fixed

Version

3.0

Component

Code

Created by

🇫🇷France mably

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

No activities found.

Production build 0.71.5 2024