Help! Where is : window.location.href =

New Member
2 0 1

Hello, 

I've just made my store live and trying to sort the cart and account login problem I have found.  

I'm now getting this message: 

It looks like this page is redirecting to a page that isn't compatible with this editor. To ensure that your redirect doesn't interfere with the editing experience, replace window.location.href = with window.top.location.href = in your theme's JavaScript 

Where can I find this on the Supply Theme? (I don't have any expreince with JavaScript or coding) 

 

Many thanks for your help. 

0 Likes
New Member
1 0 0

Same problem here, Retina theme.  

0 Likes
Tourist
3 0 1

Is there a solution to this? I have the same when i want to customize check out settings. 

0 Likes
Shopify Partner
26 0 0

same here  ... any documentation opened , so that we can read and being able to integrate code ? 

0 Likes
Shopify Expert
685 0 68

It will be in your theme JavaScript. Older themes, pre-Shopify Sections would have used the former. Any front-end dev might innocently do the same. It’s not a huge deal. If you can download a copy of your theme and open in a text editor like Atom.io you can search and replace 

I'm a million different people
1 Like
Tourist
4 0 1

Thank you so much, it is easy and work!

1 Like
Tourist
9 0 1

rickydazla or MINERVOS FASHION would you mind to give more details of editing this please?

I'm using Supply the free theme.  Have downloaded and searched through the whole theme file with atom.io but still cannot locate that piece of code.

Any help would be much appreciated.

 

0 Likes
Highlighted
Shopify Expert
685 0 68

Annie! Two things:

  1. Make sure you are searching the entire project directory and not just one file
  2. Try a narrower search like just "location.href"
I'm a million different people
0 Likes
Tourist
9 0 1

Hi rickydazla, thank you so much for your help.

Yes I've tried searching the whole project but can't find "window.location.href ="

Yet as you said I search "location.href" I've found in this file snippets\collection-sidebar.liquid has this code

"location.href = location.href"

The script reads:

  filters.on('click', function(e) {
        el = $(this);
        elGroup = el.data('group');
        elHandle = el.data('handle');
        activeTagInGroup = $('.active-filter[data-group="'+ elGroup +'"]');
        // If the tag clicked is not already active and its group contains an active tag, we will swap tag within the group.
        if ( !el.hasClass('active-filter')  && activeTagInGroup.size() ) {
          e.preventDefault();
          location.href = location.href
            // swap tag
            .replace(activeTagInGroup.data('handle'), elHandle)
            // go back to page 1
            .replace(/(&page=\d+)|(page=\d+&)|(\?page=\d+$)/, '');
        }

I'm no expect in programming, but this doesn't look like the source of our problem, or does it?  That's all I can find relevant in the project.

0 Likes
Shopify Partner
1 0 0

The file I needed to change was app.js.liquid under assets.

0 Likes