Page keeps refreshing after being redirected

George673
Visitor
1 0 0

I am trying to create a website https://fone-kase-plus.myshopify.com/ that will detect what device model it's being accessed from (for example GALAXY A40) so it will immediately redirect the user to a corresponding page. It seems to be working, but it will reload the page multiple times after redirecting. If I try to redirect it to non-shopify page (eg stackoverflow.com) this problem doesn't occur.

I'm pretty sure the problem is within the https://fone-kase-plus.myshopify.com/pages/galaxy-a40 page code.

But how do I access this particular page's code? Is it even possible in Shopify?

 

Below is the code which does redirecting(it's in theme.liquid layout):

<script>
   function deviceAPIcallback(result){

     if(result.deviceName === "desktop"){
         window.location.href = "https://fone-kase-plus.myshopify.com/pages/galaxy-a40";

     }

      else{
          alert(result.deviceName);
       }

     }
</script>

Replies 0 (0)