hello, I took over a shop. the shop owner has no problem accessing the customizer but when I try to enter it shows me an error message “Failed to load the page”. According to the Shopify community, I have to replace the Theme.js window. location.href = with window.top.location.href I did that but didn’t work. In the documentation, it says I have to do this; “to ensure your redirect doesn’t interfere with the editor experience, use a reference to the window.Shopify.designMode variable in JavaScript to disable the redirect when you visit the theme editor. This variable is set to true when the storefront is loaded in the editor, and false when it is not.” I don’t know what to do exactly…
3 Likes
Hey any help with the problem? here is also the code of the theme.liquid file
Had a similar issue just now for a client
Looks like maybe Shopify using the Shopify object so need to guard against it. If in your theme you are declaring a Shopify object then need to add some guard clauses.
We had a file that created our own object and had to add the first few lines
From here we could edit in the theme editor as normal