For discussing the development and usage of Checkout UI extensions, post-purchase extensions, web pixels, Customer Accounts UI extensions, and POS UI extensions
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.
Solved! Go to the solution
This is an accepted solution.
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.
This is an accepted solution.
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.