Unable to Redirect Within Store Using Get Parameters

Anthony39
Shopify Partner
4 0 1

Now that the new design experience is starting to roll out I've noticed an issue with one of our apps that I believe must be a bug with the new theme customizer:

When you're customizing your theme with the new customizer you can redirect to a page within the store (including app proxy pages) but if you include any query parameters in the redirect URL the redirect fails and Shopify throws up the link to the troubleshooting page (https://help.shopify.com/en/manual/online-store/os/using-themes/change-the-layout/troubleshooting).

I've tried changing:

window.location.href = "store.myshopify.com/apps/appproxy/endpoint?parameter=12345"

 to

window.parent.location.href = "store.myshopify.com/apps/appproxy/endpoint?parameter=12345"

 like they suggest in the troubleshooting page but that just causes javascript errors instead of a redirect.

This redirect works:

window.location.href = "store.myshopify.com/apps/appproxy/endpoint"

 I have a hard time imagining that this is intended behaviour. Adding query parameters does not change the fact we are redirecting within the shop which, according to the documentation, should be supported.

Anyone else notice this?

Replies 3 (3)

rcl2020
Visitor
2 0 0

Hi I am having the same issue with the redirect, I'm trying to change the code in my them. Could you kindly advice which file you pasting the new code? 

Thanks

Anthony39
Shopify Partner
4 0 1

I'm afraid I can't really say what's wrong with your theme. The code I posted above was an illustrative example of some testing I did and I haven't found a solution myself. Seems like a Shopify bug to me.

rcl2020
Visitor
2 0 0
Ok thanks anyways!