Skip to content

[Rule][Index][Frontend] Indexable price rule conditions and pluggable category sorting (2026.x) - #3243

Merged
dpfaffenbauer merged 8 commits into
2026.xfrom
issue/3242-indexable-price-rule-conditions
Sep 15, 2026
Merged

dpfaffenbauer merged 8 commits into
2026.xfrom
issue/3242-indexable-price-rule-conditions

Conversation

@dpfaffenbauer

Copy link
Copy Markdown
Member

Groundwork for coreshop/product-price-index-bundle, which precomputes product prices per store / currency / country / customer group / company / customer so listings can filter and sort by price. The core only gains generic extension points, nothing price-index specific.

Changes

  • Rule component: IndexableConditionCheckerInterface (a condition declares the context dimensions its outcome depends on) and IndexableConditionValuesInterface (the ids it explicitly references). Implemented by the store, currency, country, zone, customer group, guest, customers, companies, products, categories and timespan condition checkers. Quantity, cart voucher and custom conditions without the interface are treated as not indexable.
  • New product price rule condition companies (CompaniesConditionChecker, CompaniesConfigurationType, translations).
  • Studio: every price rule condition shows an "Indexable" / "Not indexable" badge. ConditionMetaCollector (RuleBundle) computes the meta, the product price rule config and the specific price rules adapter expose it as conditionMeta, the ConditionRegistry carries it to ConditionItem.
  • Index component: IdSubselectListingInterface, implemented by the MySQL listing: the ids matching a listing as an SQL subselect (optionally excluding one filter field) for set based joins with other tables.
  • FrontendBundle: CategorySortApplierInterface with a default implementation; CategoryController delegates sorting to it so bundles can decorate it to add sort options. Sort labels come from coreshop.ui.sort.<key>_<direction> with the previous " ascending" fallback. Fixed the swapped German name sort labels.
  • Product component: ValidRulesFetcherInterface::CONTEXT_NO_CACHE; a price context carrying it bypasses MemoryCachedValidRuleFetcher.
  • Config: removed the enum: string mapping type from config/packages/doctrine_mapping_types.yaml. DBAL 4.4 maps ENUM natively and the mapping broke every schema introspection (Column "type" has invalid type) in migrations and bundle installers.
  • Behat: steps for the companies condition and for a nested condition with customer group and country children; fixed the regex of the "is also priced at ... for store" step.
  • Docs: Studio product price rules page (indexability badge), CHANGELOG 2026.2.2.

Notes

  • The Studio build archives (Resources/build-dist) are not part of this PR; the frontend-build workflow regenerates them on merge.
  • Behat suites domain_filter and domain_index were run locally against these changes; the bundle's own suite (42 scenarios) runs against this branch via a composer path repository.

Closes #3242

dpfaffenbauer and others added 4 commits September 14, 2026 21:08
… category sorting

Groundwork for coreshop/product-price-index-bundle. The core only gains
generic extension points:

- IndexableConditionCheckerInterface / IndexableConditionValuesInterface in
  the Rule component, implemented by the store, currency, country, zone,
  customer group, guest, customers, companies, products, categories and
  timespan condition checkers
- new product price rule condition "companies"
- Studio badge "Indexable" / "Not indexable" on price rule conditions via
  ConditionMetaCollector and conditionMeta in the rule config
- IdSubselectListingInterface, implemented by the MySQL listing
- CategorySortApplierInterface in the FrontendBundle, the category page
  delegates its sorting; sort labels via coreshop.ui.sort.<key>_<direction>
- ValidRulesFetcherInterface::CONTEXT_NO_CACHE bypasses the memory cached
  rule fetcher
- fixed swapped German name sort labels
- removed the enum: string DBAL mapping type (breaks schema introspection
  with DBAL 4.4)
- Behat: step for the companies condition, nested condition with customer
  group and country, fixed "is also priced at" step regex

The Studio build archives are not part of this change; the frontend-build
workflow regenerates them.
…nding")

The category page now renders the sort options from coreshop.ui.sort.<key>_<direction>.
The existing English values used a lowercase direction, which changed the visible labels
and broke the Behat UI scenario "Sorting in category". Align them with the previous output.
… none

ConditionMetaCollector merges the results of all services tagged
coreshop.rule.condition_meta_provider (ConditionMetaProviderInterface)
instead of computing the price index indexability itself. The Studio
rule editor only renders the "Indexable" / "Not indexable" badge when a
provider delivered the "indexable" key, so without the product price
index bundle nothing is shown.
@coreshop-bot

coreshop-bot Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

🚦 PR Guardrail

⚠️ Advisory mode: this PR is not blocked (yet). Once the guardrail is switched to enforce: true, the points below would be violations.

❌ R5 — CI

Failed checks on the current head: ^2026.2, PHP 8.4, Deps highest, ^2026.2, PHP 8.4, Deps lowest, ^2026.2, PHP 8.5, Deps highest.

➡️ Fix the failed checks and push the fix. The guardrail re-evaluates automatically once CI completes.

ℹ️ Some CI checks are still running. The CI result is re-evaluated automatically once they finish.

Automated comment by the PR guardrail — details and FAQ: docs/GUARDRAILS.md in coreshop/workflow-collection.

coreshop-bot Bot and others added 4 commits September 15, 2026 06:31
The core documents only the ConditionMetaProviderInterface mechanism; what a specific
bundle contributes belongs into that bundle's documentation.
bin/console lint:yaml runs without custom tags, so !tagged_iterator is not
allowed in the bundle configs. ConditionMetaProviderPass hands the tagged
services to the ConditionMetaCollector instead.
@sonarqubecloud

Copy link
Copy Markdown

@dpfaffenbauer
dpfaffenbauer merged commit fda28f5 into 2026.x Sep 15, 2026
64 of 65 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 15, 2026
@dpfaffenbauer
dpfaffenbauer deleted the issue/3242-indexable-price-rule-conditions branch September 15, 2026 06:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Indexable price rule conditions and pluggable category sorting (groundwork for the product price index bundle)

1 participant