Support combination feature values in feature filters - #1292
Open
jf-viguier wants to merge 2 commits into
Open
Conversation
Feature filters now also take combination (product_attribute) feature values into account, so a feature carried only by combinations appears in the facets with correct product counts. Gated by PrestaShop >= 9.3 and the combination_feature_values feature flag.
Narrow the container to Psr\Container\ContainerInterface so PHPStan resolves get() through an interface available on every PrestaShop version, instead of the ContainerBuilder branch that is not resolvable under the 9.0.3 analysis target.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
PrestaShop 9.3 introduced feature values at combination level (PrestaShop/PrestaShop#41830). This PR brings them into the faceted search: feature filters now also take combination (
product_attribute) feature values into account, so a feature carried only by combinations shows up in the facets with correct product counts.The behavior is gated first by PrestaShop
>= 9.3, then by thecombination_feature_valuesfeature flag. On older versions, or with the flag off, nothing changes.About
rawTableThe MySQL adapter maps each filter field to a DB table, and the query builder prepends
_DB_PREFIX_to that name. To merge product-level and combination-level values,id_feature/id_feature_valueare now mapped to a derived sub-select (aUNIONoffeature_productand combination values resolved throughproduct_attribute) instead offeature_product. Since a derived table is already a full SQL expression and not a table name, a newrawTableflag on the join mapping tells the builder to use it as-is, without prepending the prefix.How to test
>= 9.3, enable thecombination_feature_valuesfeature flag.