Skip to content

Add a default address for estimating taxes - #260

Merged
duncanmcclean merged 2 commits into
1.xfrom
default-tax-address
Jul 25, 2026
Merged

Add a default address for estimating taxes#260
duncanmcclean merged 2 commits into
1.xfrom
default-tax-address

Conversation

@duncanmcclean

Copy link
Copy Markdown
Owner

This pull request implements a default_address config 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:

// config/statamic/cargo.php

'taxes' => [
    'default_address' => [
        'country' => 'GBR',
        // 'state' => null,
        // 'postcode' => null,
    ],
],

Only the country, state and postcode are 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 taxableAddress is left untouched, so customers still need to provide a real address before they can checkout.

This PR also migrates Simple Commerce's default_address option into the new config option, when its no_address_provided behaviour was set to default_address.

The option is unset by default, so nothing changes for existing sites.

Related: #259

duncanmcclean and others added 2 commits July 25, 2026 11:17
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>
@duncanmcclean
duncanmcclean merged commit dbb246c into 1.x Jul 25, 2026
14 checks passed
@duncanmcclean
duncanmcclean deleted the default-tax-address branch July 25, 2026 10:27
@github-actions

Copy link
Copy Markdown

Released as part of v1.10.0.

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