Repository navigation
[6.x] Bring back the catalog pricing rules table on the variant price field - #4386
Draft
nfourtythree wants to merge 1 commit into
Draft
nfourtythree wants to merge 1 commit into
nfourtythree wants to merge 1 commit into
Conversation
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
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:
dateCreatedordateUpdated.Purchasable::catalogPricingRulesTableByPurchasableId(), and the unusedcommerce/catalog-pricing/get-catalog-pricesaction.CatalogPricingRule::getEffectLabel()so the rules index and the new table share it.