Add a default address for estimating taxes - #260
Merged
Conversation
when the cart has no shipping or billing address, taxes are calculated against the address configured in `taxes.default_address`, so customers see estimated taxes before reaching the checkout. the cart's own `taxableAddress` is left untouched, so an address is still required to checkout. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Released as part of v1.10.0. |
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.
This pull request implements a
default_addressconfig option, allowing taxes to be estimated before the customer has provided their address.Until now, taxes were only calculated once the cart had a shipping or billing address. When prices are exclusive of tax, that meant customers saw no tax at all on the cart until they reached the checkout.
You can now configure an address for Cargo to estimate taxes against:
Only the
country,stateandpostcodeare used when matching tax zones. As soon as the customer provides their own address, taxes are recalculated against it.The default address is only used when calculating taxes — the cart's
taxableAddressis left untouched, so customers still need to provide a real address before they can checkout.This PR also migrates Simple Commerce's
default_addressoption into the new config option, when itsno_address_providedbehaviour was set todefault_address.The option is unset by default, so nothing changes for existing sites.
Related: #259