Test checkout UI extensions
Checkout UI extensions that render on the information and shipping and payment steps in checkout are available only to stores on a Shopify Plus plan.
Testing checkout UI extensions in different scenarios is a UX guideline. The purpose is to recreate merchant and customer experiences and ensure that extensions behave as desired.
Anchor to Test locallyTest locally
The custom field and product offer tutorials show you how to start generating and previewing extensions. Previewing UI extensions locally is different when using static and block extension targets.
Anchor to Static extension targetsStatic extension targets
When you're using a static extension target, the UI extension automatically renders in a chosen location.
Anchor to Block extension targetsBlock extension targets
When you're using a block extension target, merchants can place the UI extension in any of the supported placements on the page.
To preview a block extension in each supported placement, append ?placement-reference={name}
to the checkout URL that's outputted by Shopify CLI. For example, ?placement-reference=DELIVERY1
.
Use the following placement references to test each supported placement:
Anchor to Placement referencesPlacement references
Here are all the placement references for each page.
Anchor to CheckoutCheckout
Block extension target: purchase.checkout.block.render
Placement references: WALLETS1
, INFORMATION1
, INFORMATION2
, INFORMATION3
, DELIVERY1
, DELIVERY2
, PAYMENT1
, PAYMENT1
, PAYMENT3
, PAYMENT4
Anchor to Thank youThank you
Block extension target: purchase.thank-you.block.render
Placement references: ORDER_SUMMARY1
, ORDER_SUMMARY2
, ORDER_SUMMARY3
, ORDER_SUMMARY4
, ORDER_STATUS1
, ORDER_STATUS2
, ORDER_STATUS3
Anchor to Order StatusOrder Status
Block extension target: customer-account.order-status.block.render
Placement references: ORDER_SUMMARY1
, ORDER_SUMMARY2
, ORDER_SUMMARY3
, ORDER_SUMMARY4
, ORDER_STATUS1
, ORDER_STATUS2
, ORDER_STATUS3
To recommend a specific placement to merchants, define the default placement by using the [[extensions.targeting.default_placement]]
property in the TOML file. Learn how to configure default placement.
Anchor to Test with Shop PayTest with Shop Pay
To use extensions in Shop Pay, you need to activate Shopify Payments on your development store and enable test mode. You can develop extensions locally in Shop Pay and preview published extensions.
To test with Shop Pay Installments, you must complete the Shopify Payments setup. Stores with incomplete account information will show Shop Pay Installments as inactive.
Anchor to Step 1: Enable Shopify Payments in test modeStep 1: Enable Shopify Payments in test mode
For development stores, where you aren't accepting real payments, enable Shopify Payments.
-
From your Shopify admin, go to Settings > Payments.
-
Initiate the signup process by clicking
Activate Shopify Payments
. -
Once on the signup page, click back to go to the payment settings page.
-
Follow the steps to enable test mode.
NoteTo save changes, you require a valid Customer statement descriptor and Phone number.
Learn more about setting up Shopify payments.
Anchor to Step 2: Complete test orders in Shop PayStep 2: Complete test orders in Shop Pay
To complete test orders in Shop Pay, you'll need to create a Shop Pay account with a vaulted test card.
-
Create a guest checkout using a test card for the payment method. Use an email that doesn't have a Shop Pay Account attributed to it.
-
Click Save my information for a faster checkout and enter a valid phone number.
You should now have a new Shop Pay account with a vaulted test credit card that you can use to complete checkouts from Shop Pay.
Anchor to Test the extension in the checkout editorTest the extension in the checkout editor
To test the extension in the checkout editor, you need to install your app on a development store that has the Checkout and Customer Accounts Extensibility developer preview enabled.
After you've published your extension, you'll test the experience of Plus merchants who have installed your app.
In this step, you'll preview different placements for extensions using the checkout editor. Checkout UI extensions don't display in checkout until the merchant uses the checkout editor to add the app and place it in checkout.
-
From the Shopify admin click Settings > Checkout. Then click Customize checkout.
-
Use the dropdown list at the top of the page to navigate to the checkout step where you want to add your extension.
-
To activate your extension, click Add app block on the bottom left of the page, and select your extension from the list.
If your extension doesn't appear in the list, then you need to enable a preview of your extension:
- In your Partner Dashboard, go to Apps.
- Click the name of your app.
- Click Extensions, and click the name of your extension.
- Click Enable.
-
Preview different placements for the extension by dragging and dropping the extension between the different targets. Test extension experiences in other checkout contexts like One-page checkout, Three-page checkout, and Shop Pay.
-
When you've chosen a placement, click Save.
Anchor to Three-page checkoutThree-page checkout
Three-page checkout is the default checkout context. To test your extension on three-page checkout, complete the following steps:
- Open the Settings tab.
- Under Checkout layout, click One-page checkout.
- Click Three-page checkout.
Anchor to One-page checkoutOne-page checkout
To test your extension on one-page checkout, complete the following steps:
- Open the Settings tab.
- Under Checkout layout, click Three-page checkout.
- Click One-page checkout.
Anchor to Shop PayShop Pay
To test your extension on Shop Pay, complete the following steps:
- From checkout, click Add app block, and select your extension from the list.
- Enable Include app in Shop Pay using the checkout behavior controls.
- Click the cart icon in the editor header.
- Click Preview Shop Pay from the list of options.
Anchor to Troubleshooting with source mapsTroubleshooting with source maps
Sometimes it can be useful to debug your extension on a merchant's shop in production. Your extension's code is bundled and minified and can be difficult to read, but you can use a sourcemap which will allow you to debug your extension with your source code.
Anchor to Find your sourcemapFind your sourcemap
If you're using Shopify CLI version 3.70.0 or higher, the command to deploy your extension will also produce a source map file for your extension on your local file system within your extension's project directory. Look for a dist folder within your extension's project directory.
Passing the verbose
flag on the app deploy
command will indicate the source map file's location.
Anchor to Link your sourcemap in developer toolsLink your sourcemap in developer tools
Now that you have your sourcemap, you'll need to link that to the extension code. The following instructions assume you are using the Google Chrome browser.
- Open Chrome DevTools
- Click on the Sources tab
- Each extension has its own service worker with a human-readable name that includes the extension type, app name, and other identifying information. You'll need to expand the appropriate service worker and find your javascript bundle. It should be under the path:
- Right-click within the script content window and select add sourcemap to link your sourcemap.
The most convenient way is to link to your local filesystem where you have your sourcemap, but you may need to enable loading from file paths (i.e. 'file://{path_to_sourcemap}') in Chrome Dev Tools settings. Otherwise, you can serve your sourcemap from a local/remote server.
Anchor to Debugging with sourcemapsDebugging with sourcemaps
Once you've linked your sourcemap, you should see your source code in the developer tools and be able to add breakpoints and step through your code.
Due to a limitation of Chrome DevTools, you may need to re-link your sourcemap if you reload the page.
Anchor to Integrate sourcemaps with application monitoring toolsIntegrate sourcemaps with application monitoring tools
If you're using application monitoring tools like Sentry or BugSnag, you may be able to upload the source map file to de-obfuscate JavaScript stack traces. However, this is dependent on the tool you're using and is not officially supported at this time.
Anchor to Next stepsNext steps
- Learn how to deploy extensions to release changes to users.