From 893b0f6ada45d650d273309443fd6c0a4a4351f3 Mon Sep 17 00:00:00 2001 From: metatroncubeswdev Date: Tue, 13 Oct 2026 21:23:21 -0400 Subject: [PATCH] fix(admin): theme editor deep links use block file handles activateAppId pointed at a non-existent 'datewise-embed' handle; the embed is 'embed'. Adds an addAppBlockId link that places the scheduler block on the cart template. Co-Authored-By: Claude Opus 5.5 --- app/routes/app._index.tsx | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/app/routes/app._index.tsx b/app/routes/app._index.tsx index cc387f0..beb3703 100644 --- a/app/routes/app._index.tsx +++ b/app/routes/app._index.tsx @@ -55,7 +55,11 @@ export const loader = async ({ request }: LoaderFunctionArgs) => { return { today, todayCount, weekCount, review, waiting, rows, peaks, setup, plan: cfg.shop.plan, monthCount, monthlyLimit: features.monthlyBookings, - themeEditor: `https://${cfg.shop.domain}/admin/themes/current/editor?context=apps&activateAppId=${process.env.SHOPIFY_API_KEY}/datewise-embed`, + // Deep links: handles are the Liquid file names in extensions/datewise-widget/blocks/. + themeEditor: { + embed: `https://${cfg.shop.domain}/admin/themes/current/editor?context=apps&activateAppId=${process.env.SHOPIFY_API_KEY}/embed`, + block: `https://${cfg.shop.domain}/admin/themes/current/editor?template=cart&addAppBlockId=${process.env.SHOPIFY_API_KEY}/scheduler&target=newAppsSection`, + }, }; }; @@ -140,7 +144,7 @@ function Kpi({ label, value, href, alert }: { label: string; value: number; href type Setup = { anyLocation: boolean; widgetLive: boolean; guardOn: boolean }; -function SetupGuide({ setup, themeEditor }: { setup: Setup; themeEditor: string }) { +function SetupGuide({ setup, themeEditor }: { setup: Setup; themeEditor: { embed: string; block: string } }) { const steps = [ { id: "location", @@ -148,13 +152,15 @@ function SetupGuide({ setup, themeEditor }: { setup: Setup; themeEditor: string title: "Turn on a pickup or delivery location", body: "Your Shopify locations were imported switched off. Check the opening hours, time slots and capacity, then turn one on.", action: { label: "Open Locations & hours", href: "/app/locations" }, + secondary: null, }, { id: "widget", done: setup.widgetLive, title: "Add the scheduler to your cart", - body: "In the theme editor, add the Delivery date & time block to the cart page and switch on the Datewise app embed so it also shows in the cart drawer. This step is marked done after the first shopper picks a time.", - action: { label: "Open theme editor", href: themeEditor, external: true }, + body: "Add the Delivery date & time block to your cart page, then switch on the Datewise app embed so the scheduler also appears in the cart drawer and checkout buttons wait for a time. Save in the theme editor after each. This step is marked done after the first shopper picks a time.", + action: { label: "Add block to cart page", href: themeEditor.block, external: true }, + secondary: { label: "Turn on app embed", href: themeEditor.embed }, }, { id: "guard", @@ -162,6 +168,7 @@ function SetupGuide({ setup, themeEditor }: { setup: Setup; themeEditor: string title: "Require a time at checkout", body: "The checkout guard stops orders without a valid date and time, including Buy it now and express checkouts. It works on every Shopify plan.", action: { label: "Open Settings", href: "/app/settings" }, + secondary: null, }, ]; const doneCount = steps.filter((x) => x.done).length; @@ -206,6 +213,11 @@ function SetupGuide({ setup, themeEditor }: { setup: Setup; themeEditor: string {step.action.label} + {step.secondary && ( + + {step.secondary.label} + + )} )}