How to get query parameters of the current URL in the Checkout UI Extension

How to get query parameters of the current URL in the Checkout UI Extension

anthony-thomas
Shopify Partner
8 0 4

Hello,

 

I need to get query params of the current checkout url in the Checkout UI Extension, but I can't access to windows object in the extension. How to get query parameters?

Anthony
Replies 2 (2)

alexifrim
Shopify Partner
2 0 0

I'm also interested in this. We need functionality like this in order to determine if the app is running from inside an app

scottshop
Shopify Partner
9 1 1

You can't read query parameters from within the Checkout UI Extension. You may be able to link to a cart permalink and pass attributes in the URL so that they are applied to the cart, then read those attributes from within your checkout extension. There is a tutorial on YT about this, but it doesn't work with links that go directly into checkout (like a cart abandonment URL).