Support catalog variants and clarify cart totals - #1485
Open
sbolinger-godaddy wants to merge 4 commits into
Open
sbolinger-godaddy wants to merge 4 commits into
sbolinger-godaddy wants to merge 4 commits into
Conversation
🦋 Changeset detectedLatest commit: d96761a The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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.
Why
Storefront code should keep working when a merchant changes products or checkout capabilities. Builders should not need to rewrite application code because a product has variants or because shipping, taxes, or discounts are enabled.
Catalog data is enough to render single-SKU and variant products dynamically. The draft-order cart is intentionally simpler: it shows a subtotal and leaves shipping, taxes, and discounts to hosted checkout, where the enabled providers perform the real calculations.
Checkout API does not yet discover those enabled providers through App Registry. Until it does, the builder must synchronize the capability flags during each initial build or rebuild so Checkout does not silently disable merchant features.
What this does
Subtotalin the draft-order cart, followed by “Shipping, taxes, and discounts are calculated at checkout.”commerce-cart-checkout-adjustments-noteclass so applications can hide it without changing the component.GODADDY_CHECKOUT_CONFIGURATIONsupport and explicitly applies its shipping, tax, and promotion flags to the checkout session./api/commerce/configresponse.commerce_checkout_configuration_get, write only its three boolean capability flags to deployment configuration, and refresh them on rebuild.The build-time flow is eventually consistent: provider changes take effect after the next rebuild. The intended long-term fix is for Checkout API to discover App Registry capabilities when it creates a session.
Verification