Skip to content

[6.x] Bring back the catalog pricing rules table on the variant price field - #4386

Draft
nfourtythree wants to merge 1 commit into
6.xfrom
feature/6x-variant-slideout-updates
Draft

nfourtythree wants to merge 1 commit into
6.xfrom
feature/6x-variant-slideout-updates

Conversation

@nfourtythree

Copy link
Copy Markdown
Contributor

Description

In 5.x the price field showed which catalog pricing rules applied to a variant. That got lost when the field moved to the new UI system, so this brings it back.

The price field now has a collapsible "Pricing rules" section with a table of the rules currently applied to the variant, cheapest first. Each row shows the rule's effect and resulting price. Badges mark the rule a customer without a customer-specific rule pays ("Lowest for everyone") and rules limited to certain customers ("Specific customers").

Rule names and "Add catalog price" open in a wide slideout. The table refreshes after a save, and keeps checking while a pricing job is running. Editing the price shows a note that prices will update once it's saved. Links and the add button only show for users who can manage pricing rules. Nothing shows for a variant that hasn't been saved yet.

Variants also open in a wider slideout now. This needs craftcms/cms#19947 for slideoutWidth(), so merge that first.

craftcms/cms#19956 and craftcms/cms#19957 add slideout and refresh options to admin tables, and double-click to open a row. Once they're merged I'll update this PR to use them in place of the custom click handling in CatalogPricesNode.

Other changes:

  • Fixed catalog price generation on Postgres. Base prices came back as strings, and the base price insert used unquoted camelCase column names.
  • Fixed saving a pricing rule with a customer condition, which failed because the rule/user rows had no dateCreated or dateUpdated.
  • Removed the old Twig/jQuery version of the price field, its asset bundle, Purchasable::catalogPricingRulesTableByPurchasableId(), and the unused commerce/catalog-pricing/get-catalog-prices action.
  • Moved the rule effect wording into CatalogPricingRule::getEffectLabel() so the rules index and the new table share it.

@nfourtythree nfourtythree self-assigned this Oct 14, 2026
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