Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2008
    Posts
    4
    Plugin Contributions
    0

    Default trouble getting mobile redirection to go back to the full site

    Hi

    FYI I have a mobile version of my zen cart site, it's done in wordpress. I have no problem with redirection to the zen cart 'full site' as I have been given a script for this, but trying to get the 'mobi' wordpress site to override the redirection to go back to the full site is an issue at present. As my customers are searching for specified products I need them to go to the full site for the cart & product info. The mobi site is really only what we are about, location etc as the site has to be small to be efficient in terms of upload time etc... I'm a newbee at this & have no techincal knowledge, so please bear with me on the terminology... also I have turned off the redirection in the short term till I get it right.... so if you have any answers let me know :)
    full site www.footforward.co.nz
    mobi site www.footforward.mobi

  2. #2
    Join Date
    Aug 2009
    Location
    Tampa Bay
    Posts
    251
    Plugin Contributions
    1

    Have a Drink Re: trouble getting mobile redirection to go back to the full site

    I just created a mobile site also
    can you share how to get the full website to recognize mobile devices so it will auto load or transfer to the condensed site???????????
    blessed be the day we make tomorrow a better yesterday

  3. #3
    Join Date
    Aug 2009
    Location
    Tampa Bay
    Posts
    251
    Plugin Contributions
    1

    Default Re: trouble getting mobile redirection to go back to the full site

    I found a couple of scripts but dont have an idea how to implement them
    ==========================================
    1. Place the following code ABOVE the </head> tag
    Remember to change http://m.google.com to your mobile url
    ==========================================

    <!--Simple Mobile Redirect-->
    <script type="text/javascript">
    if(window.location.hash != '#r=off') {
    if (screen.width <= 1023) {
    document.location = "http://m.google.com";
    }
    }
    </script>

    ==========================================
    2. Place the following code ABOVE the </body> tag
    ==========================================

    <script type="text/javascript">
    if(window.location.hash == '#r=off') {
    var a = document.getElementsByTagName('a'), href;
    for(var i = 0; i < a.length; i++) {
    href = a[i].href.toLowerCase();
    if((href.indexOf("http://") == -1 && href.indexOf("https://") == -1) || (window.location.hostname && href.indexOf(window.location.hostname) != -1)) {
    a[i].href = href + '#r=off'
    }
    }
    }
    </script>
    <?php

    $mobile_browser = '0';

    if(preg_match('/(up.browser|up.link|mmp|symbian|smartphone|midp|wap|phone)/i',
    strtolower($_SERVER['HTTP_USER_AGENT']))){
    $mobile_browser++;
    }

    if((strpos(strtolower($_SERVER['HTTP_ACCEPT']),'application/vnd.wap.xhtml+xml')>0) or
    ((isset($_SERVER['HTTP_X_WAP_PROFILE']) or isset($_SERVER['HTTP_PROFILE'])))){
    $mobile_browser++;
    }

    $mobile_ua = strtolower(substr($_SERVER['HTTP_USER_AGENT'],0,4));
    $mobile_agents = array(
    'w3c ','acs-','alav','alca','amoi','audi','avan','benq','bird','blac',
    'blaz','brew','cell','cldc','cmd-','dang','doco','eric','hipt','inno',
    'ipaq','java','jigs','kddi','keji','leno','lg-c','lg-d','lg-g','lge-',
    'maui','maxo','midp','mits','mmef','mobi','mot-','moto','mwbp','nec-',
    'newt','noki','oper','palm','pana','pant','phil','play','port','prox',
    'qwap','sage','sams','sany','sch-','sec-','send','seri','sgh-','shar',
    'sie-','siem','smal','smar','sony','sph-','symb','t-mo','teli','tim-',
    'tosh','tsm-','upg1','upsi','vk-v','voda','wap-','wapa','wapi','wapp',
    'wapr','webc','winw','winw','xda','xda-');

    if(in_array($mobile_ua,$mobile_agents)){
    $mobile_browser++;
    }
    if (strpos(strtolower($_SERVER['ALL_HTTP']),'OperaMini')>0) {
    $mobile_browser++;
    }
    if (strpos(strtolower($_SERVER['HTTP_USER_AGENT']),'windows')>0) {
    $mobile_browser=0;
    }


    if($mobile_browser>0){
    header('Location: http://YourSite.mobi/mobile');
    } else {
    header('Location: http://YourSite.mobi/pc');
    }

    ?>
    the only thing I can think of is have a landing page (intro)
    Last edited by Lackew; 11 Nov 2011 at 06:09 PM. Reason: ad on
    blessed be the day we make tomorrow a better yesterday

 

 

Similar Threads

  1. v153 FEC affecting mobile checkout (redirection)
    By norber in forum General Questions
    Replies: 2
    Last Post: 3 Aug 2015, 05:11 PM
  2. Replies: 2
    Last Post: 13 Jan 2010, 01:37 PM
  3. Getting the 'click for larger image' back
    By v.kirk in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 13 May 2009, 03:32 PM
  4. Getting back on the right track
    By camay123 in forum Templates, Stylesheets, Page Layout
    Replies: 7
    Last Post: 22 Aug 2006, 02:34 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR