Show prices in the shop currency (STRIPE_CURRENCY), not hard-coded EUR

formatPrice always formatted EUR, so the public shop, checkout, basket
and order confirmation showed € even when Stripe charged another
currency. It now takes a currency; both apps pass STRIPE_CURRENCY to the
blocks as layout data `currency` (like `timezone`), so one setting drives
what Stripe charges and every price shown.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qq6FzyGitv5gDZEcCHDGoo
This commit is contained in:
agent 2026-10-25 14:48:12 +00:00
parent de8d29beb4
commit e29eaaa8e8
9 changed files with 93 additions and 65 deletions

View file

@ -3,7 +3,7 @@
import { page } from '$app/state';
import type { HeaderGlobal } from '$lib/types';
import { getBasketContext } from '$lib/basket.svelte';
import { formatPrice } from '$shared/calendar';
import { DEFAULT_CURRENCY, formatPrice } from '$shared/calendar';
let { header } = $props<{ header: HeaderGlobal }>();
@ -30,7 +30,7 @@
return href === '/' ? path === '/' : path === href || path.startsWith(href + '/');
}
const formatTotal = formatPrice;
const formatTotal = (amount: number) => formatPrice(amount, page.data.currency ?? DEFAULT_CURRENCY);
</script>
{#snippet basketIcon()}