Skip to content

feat: alp multi filter#58

Open
ahuininga-orisha wants to merge 12 commits into
developfrom
feat/alp-multi-filter
Open

feat: alp multi filter#58
ahuininga-orisha wants to merge 12 commits into
developfrom
feat/alp-multi-filter

Conversation

@ahuininga-orisha

@ahuininga-orisha ahuininga-orisha commented Apr 29, 2026

Copy link
Copy Markdown
Collaborator

Description

This PR enhances the Tweakwise Landing Page detection logic. Previously, if a user navigated to a category page and manually selected filters that matched a landing page's configuration (plus additional filters), the system failed to redirect/resolve to the specific Landing Page URL.

The logic has been updated to ensure that if a user is on a standard category page and selects all required filters for a Landing Page—even if additional filters (Filter Y) are active—the system will prioritize the Landing Page URL while retaining the supplemental filter parameters.

Additionally, this change addresses a bug in the QueryParameter URL strategy where selecting multiple values for the same attribute resulted in duplicated filter parameters in the query string.


Technical Changes

  • Updated the Landing Page resolver to allow "superset" filter matching (Landing Page filters ⊆ Active filters).
  • Refactored the URL building logic to sanitize query parameters, preventing duplicate keys when multiple values of the same filter are active.

How to Test

Setup

  1. Identify or create a Category A.
  2. Create a Landing Page assigned to Category A with Filter X (Value 1) as the requirement.
  3. Ensure "Hidden Filters" is set to Off for the Landing Page to allow for visible parameter merging.

Scenario 1: Redirection with Supplemental Filters

  1. Navigate to Category A.
  2. Select Filter Y (a filter not associated with the Landing Page).
  3. Select Filter X (Value 1).
  4. Expected Result: The URL should resolve to the Landing Page URL, and Filter Y should remain present in the query string.

Scenario 2: Multi-value Duplicate Check (Query Parameter Strategy)

  1. Configure the Tweakwise URL strategy to Query Parameter.
  2. Navigate to Category A.
  3. Select Filter X (Value 2) (a value NOT on the landing page).
  4. Select Filter X (Value 1) (the value that triggers the landing page).
  5. Expected Result: You should be redirected to the Landing Page. The URL must contain both values for Filter X without duplicating the parameter key (e.g., ?filter_x=val1,val2 or ?filter_x=val1&filter_x=val2 depending on config, but no redundant repetition of the same value).

Scenario 3: Regression Testing

  • Test the above scenarios using the Path Slug URL strategy to ensure the slug is correctly prepended and supplemental filters are appended as query parameters.

@jansentjeu jansentjeu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ALPs now also contain the configured filter as a query parameter. This was not the case previously.

ahuininga-orisha added 2 commits May 13, 2026 16:31

@ahuininga-orisha ahuininga-orisha left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please ignore this comment, was posted without checking it first

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.

2 participants