Selling in Several Currencies¶
A Badger site sells in one currency (siteCurrencyCode). A shop that sells in more than one runs a
site per currency, for example Sauce Panic in pounds and Sauce Panic US in dollars, each with
its own locale, prices, delivery options and tax. The Sister sites in other currencies setting
links them, so shoppers can move between them and search engines know they are versions of the same
shop.
Price lists (one site, several currencies) are planned. When they ship, the same menu will switch the price list instead of the site.
What shoppers see¶
When a site has sister sites, every theme's header shows a currency menu beside the account and
basket (and beside the language menu, if the shop has one). The button shows the current currency's
sign and code (£ GBP; just the code on a phone). It opens a small menu that lists every site's
currency, with this site's marked as current. Each entry opens the same page on the other site:
/product/scotch-bonnet on the UK site links to /product/scotch-bonnet on the US site.
The menu also tells shoppers that each currency is a separate shop and that their basket stays on
the current site. The menu's text comes from Site Text (ui.currency.menu, ui.currency.title,
ui.currency.note), so it can be reworded or translated.
The menu is a native popover: it needs no script, and it closes on a click elsewhere or on Escape.
What it doesn't do¶
- The basket doesn't follow. Each site has its own basket, account sign-in and checkout.
- Products aren't checked. The link goes to the same address on the other site. If that site doesn't sell the product, the shopper sees its "not found" page, which offers a search. Checking every link would cost a lookup per sister on every page, so the sites should share their page addresses (product, collection and page seoNames), as the Sauce Panic demos do.
- The query string is dropped. Filters, sorting and tracking parameters stay behind.
Search engines (hreflang)¶
The head of every page lists each site's copy of the page, this one included:
<link rel="alternate" hreflang="en-GB" href="https://saucepanic.example/product/scotch-bonnet" />
<link rel="alternate" hreflang="en-US" href="https://us.saucepanic.example/product/scotch-bonnet" />
The hreflang is each site's own locale (set on the site in System → Tenants). These links are left out when:
- Two sites share a locale. A pound site and a euro site both in
en_GBcan't be told apart byhreflang, so no links are written. The menu still works. Give each site the locale of the shoppers it serves (en_IEfor the euro site, for example). - The shop also has language sites. The language sites'
hreflanglinks already describe the shop, so the currency links are left out of the head. Both menus still show in the header.
There is no x-default link. Each site lists its sisters in its own order, so no one site is the
default everywhere, and search engines ignore an x-default that differs between the sites. A
shopper whose language and country match none of the sites gets whichever site the search engine
picks.
Setting it up¶
- On each site, open Admin → Settings → Checkout and payments and find Sister sites in other
currencies (
alternate-sites). - Enter the site IDs of the shop's other sites, in the order the menu should list them. Leave this site out.
- Do the same on every other site, so each links to the others.
When the setting is saved, each site ID must be:
- another site, not this one;
- in this site's site group (sites that share their staff and customer accounts);
- not archived;
- listed once.
A sister that is later archived, deleted or left without a domain drops out of the menu on its own. Changes to a sister's domain or currency show on the other sites within five minutes.
The setting can also be changed by an AI agent through the MCP manageSiteConfig tool
(configKey: alternate-sites, value: ["saucepanic-us"]), with the same checks.
Site data transfer¶
The setting names other sites, so it is site-bound: it is never exported or imported. A copy of a site has to be linked to its own sisters by hand.
Demo sites¶
The saucepanic and saucepanic-us demos are linked by the demo seeder (alternateSites in each
demo's site.json). They aren't in one site group, so the seeder writes the setting directly rather
than through the settings page.
For developers¶
ConfigKeyDefaults.ALTERNATE_SITES(alternate-sites, grouppayment-config) holds the siteIds.AlternateSiteService(commerce-core) resolves the sites once per site and caches them for five minutes (AlternateSites: the site and its live sisters, each with locale, currency code, name and sign, and base URL). The cache is dropped whenever site caches are evicted, and an entry is rebuilt as soon as the site's own setting changes.problem(siteIds, site)is the save-time check, run by the admin settings endpoints and the MCP tool.AlternateSitesInterceptor(web-mvc) adds the page's path and putsalternateSites(AlternateSiteLinks) on every rendered page's model. Templates must cope with it being absent.ui/currency-menu.htmlis the shared component:currency-menu(keys)for the header andalternates()for the head. Themes re-skin it with the--currency-*tokens on.nova-currency(see Shared components).