Checkout UI Extension preview in editor (design_mode)

Hi,

We have created a checkout UI extension that works well for test checkouts, but the block is not rendered during the preview in checkout editor (Thank you page):

For theme app blocks in similar situations we use the following code:

{% if request.design_mode %}

We checked available documentation but can’t find any way to create a conditional logic for editor preview / real execution modes. Any help will be highly appreciated.

1 Like

You can use useExtensionEditor() to check the type of editor. This hook will return {type: “checkout”} when you preview in the editor and return undefined on the thank you page.

2 Likes