Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

How to detect if checkout extension is running 'Shop Checkout Editor' vs. a real cart?

How to detect if checkout extension is running 'Shop Checkout Editor' vs. a real cart?

jmondi
Shopify Partner
1 0 4

I'm developing a checkout extension and need to differentiate between the "Online Shop Checkout Editor" environment and a real cart. My extension requires a valid checkout/user to display properly, resulting in empty space when previewed in the editor.


Is there a way to detect if the extension is running in the editor vs. a real cart? I've tried using window.location, but there's no access to the window object within the extension.

Ideally, I'd like to:

  1. Show a preview version of my extension in the editor
  2. Display the full, functional version in actual checkouts

Has anyone found a reliable method to achieve this? Any insights or workarounds would be greatly appreciated.

 

 2024-09-06 at 11.09.10 AM.png

Replies 0 (0)