Skip to content

Add POS cart intercept template - #427

Draft
vctrchu wants to merge 9 commits into
mainfrom
vctrchu/pos-intercept-bugbash
Draft

vctrchu wants to merge 9 commits into
mainfrom
vctrchu/pos-intercept-bugbash

Conversation

@vctrchu

@vctrchu vctrchu commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Background

Provide a minimal, standalone POS intercept example for a temporary bug bash. This draft is for review and testing, not for merging the temporary template into main.

Related SDK changes: Shopify/ui-extensions#4713 and Shopify/ui-extensions#4714.

Solution

  • Add pos-intercept/ and an opt-in templates.pos-intercept.json catalog exposing pos_intercept. Leave the public templates.json and existing POS templates unchanged.
  • Return one blocking ERROR at $.cart for a nonempty cart without example_cart_reviewed="true".
  • Pair the interceptor with pos.cart.validations.resolution.render. The target registers shopify.resolution.onSave; Shopify-owned Save/Next/Done waits for the handler to persist example_cart_reviewed, confirm the cart signal, and return before POS revalidates.
  • Report an absent or rejected write without granting completion. No product configuration, selection state, event subscription, or custom completion API.
  • Use API 2026-10, SDK 2026.10.0-rc.13, Preact, and offline support.

Local verification

  • Rendered the Liquid template with the generator's Preact context; verified generated identity, .jsx module paths, paired targets, locales, catalog, and exact SDK pin.
  • Installed generated dependencies and passed shopify app build --skip-dependencies-installation plus tsc --noEmit -p extensions/pos-onsave-cart/tsconfig.json in a disposable app.
  • Passed a focused Preact/API smoke check covering one onSave registration, no write before POS save, awaited property persistence, signal-confirmed revalidation, and absent or rejected writes that keep the finding active.
  • Authenticated CLI generation reached App Management but was blocked by Cannot find a valid organization. Real POS behavior remains unverified and requires an approved app in a preview-enabled POS environment.

Generate for the internal bug bash

Run these commands from your Shopify app root—the directory containing shopify.app.toml. To create an app first, follow Build your first POS UI extension. Change --name if you want a different extension name.

curl --fail --location \
  "https://raw.githubusercontent.com/Shopify/extensions-templates/vctrchu/pos-intercept-bugbash/templates.pos-intercept.json" \
  --output /tmp/templates.pos-intercept.json

SHOPIFY_CLI_APP_TEMPLATES_JSON_PATH="/tmp/templates.pos-intercept.json" \
  shopify app generate extension \
  --template pos_intercept \
  --name pos-intercept-bugbash \
  --clone-url "https://github.com/Shopify/extensions-templates#vctrchu/pos-intercept-bugbash" \
  --path "$PWD"

What these commands do:

  1. curl --fail --location … --output /tmp/… downloads this branch's temporary template catalog. --fail stops on an HTTP error, --location follows redirects, and /tmp keeps the temporary file outside the app.
  2. SHOPIFY_CLI_APP_TEMPLATES_JSON_PATH=… shopify app generate extension … uses that catalog for this invocation. The catalog registers the temporary template identifier and maps it to its Preact directory. --clone-url supplies the branch containing the actual template files; it does not register the identifier. --name controls the generated extension name, and --path "$PWD" adds it to the current Shopify app.

The custom catalog replaces CLI's default template catalog only for this command.

Use Shopify CLI 4.8.0 or later; do not pass --flavor. These branch URLs are only for the internal bug bash/developer preview. Deployment and runtime testing still require an approved app and preview-enabled POS environment.

Checklist

  • I have tophat'd these changes in a real POS environment
  • I have squashed my commits into chunks of work with meaningful commit messages

@vctrchu vctrchu changed the title Add opt-in POS cart acknowledgment template Add POS cart acknowledgment template Sep 21, 2026
@vctrchu vctrchu changed the title Add POS cart acknowledgment template Add POS cart intercept template Sep 21, 2026
@vctrchu
vctrchu force-pushed the vctrchu/pos-intercept-bugbash branch from 46b9f8b to f658efa Compare September 22, 2026 00:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant