Page 3 of 5 FirstFirst 12345 LastLast
Results 21 to 30 of 50
  1. #21
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Mobile template

    Good philosophical (and technical) information on "responsive design" which is relevant to deciding how to address mobile devices:
    http://www.alistapart.com/articles/r...ve-web-design/
    Also a recent Sitepoint article:
    http://blogs.sitepoint.com/2011/01/1...s-framework-3/

  2. #22
    Join Date
    Mar 2007
    Posts
    248
    Plugin Contributions
    6

    Default Re: Mobile template

    Quick question for Vittorio.

    thanks for the mod, works perfectly for me.

    If using the overides, can you provide a solution that allows the customer to view the "usual" version of the site if they choose too?

    I was thinking about adding a link in the footer where the mobile user can click to view the full version of the site, thinking of using session variables in order to do this, but running out of skill level rapidly!

  3. #23
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,589
    Plugin Contributions
    30

    Default Mobile template testing tool

    This is a useful tool to test functionality of the Opera Mobile browser on a pc/mac, to make code changes that display in real time using this emulator in conjunction with Opera Dragonfly:
    http://www.opera.com/developer/tools/

  4. #24
    Join Date
    Mar 2007
    Posts
    248
    Plugin Contributions
    6

    Default Re: Mobile template

    To answer my own question, if using the browscap method as Vittorio posted and you want iphone customers to see the full site, then this is how i did it.

    1. Create a new file called redirect.php and place it in the public_html folder

    2. put the following code in it -changing the domain name to you own

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en">
    <?php
    $value = 'full';
    setcookie("TestCookie", $value);
    setcookie("TestCookie", $value, time()+1800); /* expire in 1/2 hour */ 
    ?>
    <head>
    <meta HTTP-EQUIV="REFRESH" content="0; url=http://www.yourdomain.com/">
    </head>
    </html>
    3. On your site, put a link to the redirect.php file for users to click on to see the full site

    4. Alter the code slightly that vittorio posted to look like this

    Code:
    * Determine if client is a mobile device or not ($mobile = 1 ==> it is | $mobile = 0 ==> it is not)
    */
    $browser = get_browser($_SERVER['HTTP_USER_AGENT'], true);
    $mobile = ($browser['ismobiledevice'] == null ? 0 : $browser['ismobiledevice']);
    $platform = strtolower($browser['browser']);
    
    /**
    * Check if user wants full version or not use it
    */
    
     $is_mobile = "true";
    
    if(isset($_COOKIE['TestCookie'])){
     $is_mobile = "false";
    }
    
    
    /**
    * Check if there is a specific template for this mobile platform and use it
    */
    if ($mobile == 1){
    if ($is_mobile == "true"){
      $exists_mobile = file_exists(DIR_WS_TEMPLATES . $template_dir . '_mobile');
      $exists_platform = file_exists(DIR_WS_TEMPLATES . $template_dir . '_mobile_' . $platform);
      if ($exists_platform) {
        $template_dir .= '_mobile_' . $platform;
      } else {
        if ($exists_mobile) {
          $template_dir .= '_mobile';
        }
      }
    }
    }
    
    /**
    * EOF : SPECIFIC TEMPLATE FOR MOBILE CLIENT

    Hope this helps someone out with creating mobile based zen cart templates for iphones etc

  5. #25
    Join Date
    Apr 2008
    Location
    Flint, Michigan
    Posts
    687
    Plugin Contributions
    0

    Default Re: Mobile template

    I noticed when looking through my site's awstats that there are blackberry and android users. My husband has an android and my site shows with just a little corner snippet. I am very interested in this process.

    From the postings I am gathering that you...

    1st. create a new stylesheet post #6
    2nd override init_templates.php with coding given in post #19 from includes/init_includes/overrides, restart Apache, load browscap.ini, not sure what to do after that.....

    This should allow customers with handheld internet devices to view my site and login and purchase.

    Has anyone completed the steps with it working? and have orders come through?

    Thanks, Kim

  6. #26
    Join Date
    May 2006
    Location
    Gardiner, Maine
    Posts
    2,296
    Plugin Contributions
    22

    Default Re: Mobile template

    Good information, thanks everyone.

    I'm presently in the planning stages for a default mobile template for Zen Cart and I see the checkout as a bottleneck. I tried Numinix's Ajax checkout but I couldn't even login to checkout on my iPhone.

    I'm thinking a jQuery checkout would be better.

    Any thoughts on this.
    The full-time Zen Cart Guru. WizTech4ZC.com

  7. #27
    Join Date
    Apr 2004
    Location
    UK
    Posts
    5,821
    Plugin Contributions
    2

    Default Re: Mobile template

    You can check the general look by viewing in Opera.
    open the a site in the opera browser click view and then "small screen"
    Latest Opera no longer has this option...instead use following method:-
    Opera 11 for Windows: View -> Developer Tools -> Page Information -> View button -> Small Screen.

  8. #28
    Join Date
    Feb 2009
    Location
    Landrum SC
    Posts
    141
    Plugin Contributions
    0

    Default Re: Mobile template

    Quote Originally Posted by clydejones View Post
    first name the css file "handheld_stylesheet.css and upload it to:

    includes/templates/YOUR_TEMPLATE/css

    next

    open includes/templates/YOUR_TEMPLATE/common/html_header.php

    find the following section of code:

    /**
    * load printer-friendly stylesheets -- named like "print*.css", alphabetically
    */
    $directory_array = $template->get_template_part($template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css'), '/^print/', '.css');
    sort($directory_array);
    while(list ($key, $value) = each($directory_array)) {
    echo '<link rel="stylesheet" type="text/css" media="print" href="' . $template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css') . '/' . $value . '" />'."\n";
    }

    immediately after add the following:

    /**
    * load handheld-friendly stylesheets -- named like "handheld*.css", alphabetically
    */
    $directory_array = $template->get_template_part($template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css'), '/^handheld/', '.css');
    sort($directory_array);
    while(list ($key, $value) = each($directory_array)) {
    echo '<link rel="stylesheet" type="text/css" media="handheld" href="' . $template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css') . '/' . $value . '" />'."\n";
    }
    OK, so I took post #6 and named it handheld_mobile.css
    THEN followed the directions in this post.

    No change in the size or format on my Verizon Android Vortex smart phone.

    I'm sure I missed something.... any clues?
    http://www.thedumbdog.com (freeyellow.com is the host)
    TIA
    Keith

  9. #29
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Mobile template

    View source shows
    <link rel="stylesheet" type="text/css" media="handheld" href="includes/templates/dd/css/handheld_stylesheet.css" />
    which indicates that there is a file named handheld_stylesheet.css. Does it exist? Does it have any content? Does handheld_mobile.css exist on your server?

  10. #30
    Join Date
    Feb 2009
    Location
    Landrum SC
    Posts
    141
    Plugin Contributions
    0

    Default Re: Mobile template

    Quote Originally Posted by gjh42 View Post
    View source shows
    <link rel="stylesheet" type="text/css" media="handheld" href="includes/templates/dd/css/handheld_stylesheet.css" />
    which indicates that there is a file named handheld_stylesheet.css. Does it exist? Does it have any content? Does handheld_mobile.css exist on your server?
    I have it in the dir includes/templates/CUSTOM_TEMPLATE/css

    My bad. I do not have a handheld_mobile.css file I can find that where? Sorry, I'm not up to speed on css technology.
    Last edited by xcergy; 12 May 2011 at 07:34 PM.

 

 
Page 3 of 5 FirstFirst 12345 LastLast

Similar Threads

  1. v139h I bought a mobile template; how do I Mobile Device to Show Desktop version by Default
    By explorer1979 in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 2 Mar 2013, 03:42 PM
  2. v139d Mobile Template?
    By ha75 in forum Addon Templates
    Replies: 0
    Last Post: 4 Oct 2012, 09:11 AM
  3. My mobile template
    By luisitolozano in forum Addon Templates
    Replies: 11
    Last Post: 20 Sep 2012, 05:00 PM
  4. mobile template
    By juneloweelyn in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 12 Sep 2012, 03:33 PM
  5. Mobile CSS Template for Admin?
    By dgent in forum Addon Templates
    Replies: 0
    Last Post: 8 Nov 2011, 04:50 PM

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