Skip to content

feat/show-filter-count#372

Open
ahuininga-orisha wants to merge 2 commits into
developfrom
feat/show-filter-count
Open

feat/show-filter-count#372
ahuininga-orisha wants to merge 2 commits into
developfrom
feat/show-filter-count

Conversation

@ahuininga-orisha
Copy link
Copy Markdown
Collaborator

Summary

  • Implements live product count updates on the "Show X items" button when tweakwise_layered_form_filters is enabled (issue Mobile filter - product count based on selection #302).
  • On every filter checkbox change, a lightweight AJAX request is fired to tweakwise/ajax/productcount and the button label is updated without triggering a full navigation reload.
  • The count endpoint is separate from the existing Navigation controller so no layout is rendered — only a Tweakwise API call and a JSON response.

How to test

Setup

  1. Enable both tweakwise/layered/enabled and tweakwise/layered/form_filters in Stores → Configuration → Tweakwise.
  2. Navigate to a category page that has Tweakwise facets, e.g. /women/tops-women/.

Scenario 1 — Initial page load

  1. Open the category page.
  2. Each filter group should have a "Show X items" button whose count matches the total product count for that category.

Scenario 2 — Single filter checkbox

  1. Check one filter value (e.g. size M).
  2. Without clicking the button, observe all "Show X items" buttons update to reflect the new count.
  3. Verify the count matches what Tweakwise returns for that category + filter combination.

Scenario 3 — Multiple filters combined

  1. Check a second filter value (e.g. color Gray) while size M is still checked.
  2. All buttons should update to the combined count (category + size M + color Gray).
  3. Uncheck one filter; buttons should update back to the count for the remaining filter only.

Scenario 4 — Full filter apply still works

  1. Check a filter and click the "Show X items" button.
  2. The page should navigate/reload with the filter applied as before.
  3. After the AJAX navigation response, the button count should reflect product_count from the navigation response.

Scenario 5 — formFilters disabled

  1. Disable tweakwise/layered/form_filters.
  2. Verify no count AJAX requests are fired on filter changes (the feature is inactive).

@ahuininga-orisha ahuininga-orisha changed the base branch from master to develop May 7, 2026 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant