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

@ -1,5 +1,6 @@
import { env } from '$env/dynamic/private';
import { defaultColors } from '$lib/types';
import { shopCurrency } from '$shared/calendar';
import type { LayoutServerLoad } from './$types';
async function getGlobal(pb: App.Locals['pb'], key: string, fallback: unknown) {
@ -19,6 +20,6 @@ export const load: LayoutServerLoad = async ({ locals }) => {
// Admin dates/times are entered and shown in the site's timezone, and
// prices in the shop currency — same settings the booking emails use.
timezone: env.SITE_TIMEZONE || 'Europe/Oslo',
currency: (env.STRIPE_CURRENCY || 'eur').toUpperCase()
currency: shopCurrency(env.STRIPE_CURRENCY)
};
};