Configure checkout countries and steps
Limit checkout destinations by site, set address defaults, and add a conditional step to the buyer’s journey.
Browse guides
On this page
Choose countries by site#
In config/sellissimo.php, use uppercase two-letter country codes and your Statamic site handles. This example accepts billing addresses in three countries and delivers to two:
'checkout_countries' => [
'*' => ['shipping' => ['AT', 'HU']],
'default' => [
'billing' => ['AT', 'DE', 'HU'],
'default_billing' => 'HU',
'default_shipping' => 'HU',
],
],
An omitted country list permits the full directory. An empty list permits none for that purpose. A site-specific setting overrides the shared setting. A default preselects an allowed country. Saved addresses must also satisfy the relevant list. A physical order uses its delivery destination and a digital order checks billing. A permitted destination still needs a matching shipping service.
To supply a changing list, register a CheckoutCountryProvider with the registry’s checkoutCountries method and put its handle under provider for the site. Its countries($site, $purpose) result narrows the configured list. Return null to keep all configured choices.
Add a pickup time to checkout#
Core includes a working pickup method and a checkout step that asks the buyer for a collection time. To try it in a development store, copy the example into your project and register the copy with Composer.
mkdir -p addons
cp -R vendor/sellissimo/core/examples/local-pickup addons/local-pickup
composer config repositories.local-pickup path addons/local-pickup
composer require example/sellissimo-local-pickup:@dev
Enable the shipping method and pickup step in the existing store configuration.
'shipping' => ['flat_rate', 'pickup'],
'checkout_steps' => ['contact', 'delivery', 'pickup_window', 'review'],
To build your own step, implement Sellissimo\Core\Contracts\CheckoutStep and register the instance in your addon's service provider with $registry->checkoutStep('pickup_window', $step). Implement label(), applies($publicQuote, $site) and fields($publicQuote, $site). Return fields keyed by handle using text, date or select, with a label, required flag and options for a select. Use the shipping handle in the quote to show a pickup question only for that method.
Keep contact first, delivery in the sequence and review last. Digital carts skip delivery. Changing an earlier step clears later answers in the bundled shop. Test a pickup order, a delivery order and a draft link. The receipt should contain only the applicable answers.
Send the answers from a custom frontend#
Read checkout_step_definitions from the quote in order. When a country policy is configured, checkout_countries supplies options and defaults. Submit the answers with both quote and checkout, for example {"checkout_steps":{"pickup_window":{"window":"morning"}}}. Send the final quote’s quote_token. If the selection changes, show the recalculated quote for review.
Collect policy choices on the review step#
In the site's checkout settings, select the published terms and privacy entries and enable the acknowledgements you require. Enable Offer newsletter subscription for a separate, initially unchecked marketing choice. Buyers can leave it unchecked and still place an order. Enable Use explicit payment obligation button to show the payment wording on the final action. Additional payment notice provides space for your shop's instructions.
The order receipt records the choices, their time and the policy version. If a required document changes while a buyer is reviewing an order, the buyer must review the updated policy. Use the order's recorded newsletter choice when connecting your mailing service.
In the bundled checkout, buyers select a delivery service and payment method from labelled cards and enter discount codes in the order summary. Check both a physical basket and a download-only basket, which skips delivery.