Site design: separate booking page and basket page

The header button, the basket indicator, the shop's "view basket" links,
hero buttons and the payment return page all pointed at a hard-coded
/book. Site design now has a Booking page (where the CTA leads) and a
Basket page (where the basket leads; empty = the booking page), and
warns when the page picked is unpublished or lacks its Shop / Checkout
block. On a basket page of its own, an empty basket links to the
booking page instead of saying "pick a service above".

Sites saved before this keep their links: the booking page falls back
to the CTA's old address, then /book.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hy2vMnHJYP7QGsiH21zHxW
This commit is contained in:
agent 2026-10-26 11:19:54 +00:00
parent 76b297153e
commit c3c10229b0
12 changed files with 105 additions and 28 deletions

View file

@ -1,6 +1,6 @@
<script lang="ts">
import { page } from '$app/state';
import type { BasketLine, BookableTime, ShopBlockData, ItemRecord } from '$shared/types';
import { shopLinks, type BasketLine, type BookableTime, type ShopBlockData, type ItemRecord } from '$shared/types';
import { getBasketContext } from '$shared/basket.svelte';
import { DEFAULT_CURRENCY, DEFAULT_TIMEZONE, addMonths, createCalendarMonth, formatInstant, formatPrice, startOfMonth, zonedDateKey, zonedInputToIso } from '$shared/calendar';
import { bundleListPrice, formatDuration, lowestPrice } from '$shared/items';
@ -46,6 +46,7 @@
const weekdayLetters = ['M', 'T', 'W', 'T', 'F', 'S', 'S'];
const timezone = $derived<string>(page.data.timezone ?? DEFAULT_TIMEZONE);
const currency = $derived<string>(page.data.currency ?? DEFAULT_CURRENCY);
const basketHref = $derived(shopLinks(page.data.header).basket);
let visibleItems: ItemRecord[] = $derived.by(() => {
let result: ItemRecord[] = items;
@ -408,7 +409,7 @@
</button>
{#if itemInBasket}
<a
href="/book"
href={basketHref}
class="inline-flex items-center gap-1 text-sm font-medium text-sage-dark underline-offset-2 hover:underline"
>✓ In basket</a
>
@ -597,7 +598,7 @@
{#if ui.justAdded}
<p class="mt-3 text-sm font-medium text-sage-dark">
Added ✓ — <a href="/book" class="underline underline-offset-2 hover:no-underline">view basket</a>
Added ✓ — <a href={basketHref} class="underline underline-offset-2 hover:no-underline">view basket</a>
</p>
{/if}
</div>