Toggle back to mobile version

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lesliekirk
    Super Moderator











    • Aug 2008
    • 9304

    #1

    Toggle back to mobile version

    I'm wanting to be able to add a link back to the mobile commerce version for those who might want to return to it after clicking the "Desktop" link:

    Code:
    <div id="ui-toggle">
        <span>Mobile</span><a href="&mvt:global:sessionurl;" rel="nofollow" onclick="createCookie('ui','desktop',1);">Desktop</a>
    </div>
    <!-- end #ui-toggle -->
    Is it possible? Looks like the cookie that gets created would have to be cleared.

    Leslie
    Leslie Kirk
    Miva Certified Developer
    Miva Merchant Specialist since 1997
    Previously of Webs Your Way
    (aka Leslie Nord leslienord)

    Email me: [email protected]
    www.lesliekirk.com

    Follow me: X | Facebook | Pinterest
  • KNewbrough
    Mivite

    • May 2013
    • 200

    #2
    Re: Toggle back to mobile version

    Hi Leslie,

    This should do the trick:

    Code:
    <a href="[COLOR=#333333]&mvt:global:sessionurl;[/COLOR]" title="Switch to Mobile" rel="nofollow" onclick="eraseCookie('ui','desktop');">Switch to Mobile</a>
    If you wanted that button to only be available on mobile devices viewing the desktop site (and not available for regular desktop computers), you can go to the store's HTML Profile element and find this block of code, and add another variable for that purpose (all code included here for reference, but you only need the labeled line below).

    Code:
    <mvt:if expr="( 'android' CIN s.http_user_agent OR         'iphone' CIN s.http_user_agent OR 
            'opera mini' CIN s.http_user_agent OR
            'opera mobile' CIN s.http_user_agent OR 
            'ipod' CIN s.http_user_agent OR 
            'webOS' CIN s.http_user_agent OR 
            'iemobile' CIN s.http_user_agent OR 
            'blackberry' CIN s.http_user_agent) AND NOT('tablet' CIN s.http_user_agent OR 
            'GT-P1000' CIN s.http_user_agent OR 
            'SCH-I800' CIN s.http_user_agent OR 
            'is_tablet' CIN s.http_user_agent OR 
            'is_tablet' CIN s.http_user_agent) ">
                    
    <mvt:item name="toolkit" param="sassign|mobile|TRUE" />
    <mvt:item name="toolkit" param="sassign|mobileButton|truthy" /> <!-- This is the line you will add to the existing code -->
    <mvt:item name="toolkit" param="vassign|mivaScreen|l.all_settings:page:code" />
    </mvt:if>
    Then put this on the bottom of the page:

    Code:
    <mvt:if expr="g.mobileButton">
      <a href="[COLOR=#333333]&mvt:global:sessionurl;[/COLOR]" title="Switch to Mobile" rel="nofollow" onclick="eraseCookie('ui','desktop');">Switch to Mobile</a>
    </mvt:if>
    Last edited by KNewbrough; 06-19-13, 05:36 PM.
    Kyle Newbrough
    Technical Support / Web Developer
    Miva Merchant

    Comment

    • lesliekirk
      Super Moderator











      • Aug 2008
      • 9304

      #3
      Re: Toggle back to mobile version

      Hi Kyle,

      Thanks. I added this to crohns.net, but the Mobile link is not showing up in the mobile version. Also I just noticed that I have to press the Desktop link twice to get to the Desktop version of the site. The Mobile link should show up at the very bottom of the page next to the Search link.

      Leslie
      Leslie Kirk
      Miva Certified Developer
      Miva Merchant Specialist since 1997
      Previously of Webs Your Way
      (aka Leslie Nord leslienord)

      Email me: [email protected]
      www.lesliekirk.com

      Follow me: X | Facebook | Pinterest

      Comment

      • wcw
        Developer Partner

        • Mar 2006
        • 11329

        #4
        Re: Toggle back to mobile version

        You have bigger problems than that. Somebody has changed the links to the products (both in categories and search) so they are showing the store code input twice with a fatal error screen. Hence you cannot get to the product pages in mobile. Also, I did not see a switch back to mobile link in the desktop. I had no problem going from mobile to desktop but no way to get it back to mobile.
        Bill Weiland - Emporium Plus http://www.emporiumplus.com/store.mvc
        Online Documentation http://www.emporiumplus.com/tk3/v3/doc.htm
        Question http://www.emporiumplus.com/mivamodu...vc?Screen=SPTS
        Facebook http://www.facebook.com/EmporiumPlus
        Twitter http://twitter.com/emporiumplus

        Comment

        • lesliekirk
          Super Moderator











          • Aug 2008
          • 9304

          #5
          Re: Toggle back to mobile version

          Originally posted by wcw View Post
          You have bigger problems than that. Somebody has changed the links to the products (both in categories and search) so they are showing the store code input twice with a fatal error screen. Hence you cannot get to the product pages in mobile. Also, I did not see a switch back to mobile link in the desktop. I had no problem going from mobile to desktop but no way to get it back to mobile.
          Not being able to get back to the mobile version is the reason I posted the link. I'll look at the other.
          Leslie Kirk
          Miva Certified Developer
          Miva Merchant Specialist since 1997
          Previously of Webs Your Way
          (aka Leslie Nord leslienord)

          Email me: [email protected]
          www.lesliekirk.com

          Follow me: X | Facebook | Pinterest

          Comment

          • lesliekirk
            Super Moderator











            • Aug 2008
            • 9304

            #6
            Re: Toggle back to mobile version

            Originally posted by wcw View Post
            You have bigger problems than that. Somebody has changed the links to the products (both in categories and search) so they are showing the store code input twice with a fatal error screen. Hence you cannot get to the product pages in mobile. Also, I did not see a switch back to mobile link in the desktop. I had no problem going from mobile to desktop but no way to get it back to mobile.
            Not being able to get back to the mobile version is the reason I posted the link. I'll look at the other.
            Leslie Kirk
            Miva Certified Developer
            Miva Merchant Specialist since 1997
            Previously of Webs Your Way
            (aka Leslie Nord leslienord)

            Email me: [email protected]
            www.lesliekirk.com

            Follow me: X | Facebook | Pinterest

            Comment

            • lesliekirk
              Super Moderator











              • Aug 2008
              • 9304

              #7
              Re: Toggle back to mobile version

              You're right Bill - it looks like someone made changes to the .htaccess file that have now broken the product links. They use &mvte:product:link; so something in that .htaccess file has broken them. Looks like there is also a rewrite for the category links, but I may be able to fix those in the layout.

              Arrrgghhhh...too many cooks in the kitchen.
              Leslie Kirk
              Miva Certified Developer
              Miva Merchant Specialist since 1997
              Previously of Webs Your Way
              (aka Leslie Nord leslienord)

              Email me: [email protected]
              www.lesliekirk.com

              Follow me: X | Facebook | Pinterest

              Comment

              • Bruce - PhosphorMedia
                Developer Partner











                • Mar 2006
                • 11257

                #8
                Re: Toggle back to mobile version

                They don't sound like cooks to me<g>
                Bruce Golub
                Phosphor Media - "Your Success is our Business"

                Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
                phosphormedia.com

                Comment

                • wcw
                  Developer Partner

                  • Mar 2006
                  • 11329

                  #9
                  Re: Toggle back to mobile version

                  That domain seems like one I did the mobile tabs on. It was completely working when I completed my task quite some time ago. Look at the mobile content tab in the PLSTS page template and copy and paste the link to the product that is in there now.
                  Bill Weiland - Emporium Plus http://www.emporiumplus.com/store.mvc
                  Online Documentation http://www.emporiumplus.com/tk3/v3/doc.htm
                  Question http://www.emporiumplus.com/mivamodu...vc?Screen=SPTS
                  Facebook http://www.facebook.com/EmporiumPlus
                  Twitter http://twitter.com/emporiumplus

                  Comment

                  • lesliekirk
                    Super Moderator











                    • Aug 2008
                    • 9304

                    #10
                    Re: Toggle back to mobile version

                    Originally posted by wcw View Post
                    That domain seems like one I did the mobile tabs on. It was completely working when I completed my task quite some time ago. Look at the mobile content tab in the PLSTS page template and copy and paste the link to the product that is in there now.
                    It was and it's an .htaccess thing that is being worked out.
                    Leslie Kirk
                    Miva Certified Developer
                    Miva Merchant Specialist since 1997
                    Previously of Webs Your Way
                    (aka Leslie Nord leslienord)

                    Email me: [email protected]
                    www.lesliekirk.com

                    Follow me: X | Facebook | Pinterest

                    Comment

                    • Dan - Glendale Designs
                      Mega Mivite


                      • Sep 2006
                      • 2904

                      #11
                      Re: Toggle back to mobile version

                      Arrrgghhhh...too many cooks in the kitchen.
                      Me being the other cook in the kitchen, think we might want to tone back that statement a little. I fully documented the issue to the client and was able to resolve immediately. Considering the extent of what has been done to this site in terms of redirects, numerous inconsistent url structures and the fact that we have been able to resolve anything that has popped up, I am a little disappointed in what was said here.
                      Last edited by Dan - Glendale Designs; 07-05-13, 11:32 AM.

                      Comment

                      • lesliekirk
                        Super Moderator











                        • Aug 2008
                        • 9304

                        #12
                        Re: Toggle back to mobile version

                        Originally posted by Dan - Glendale Designs View Post
                        Me being the other cook in the kitchen, think we might want to tone back that statement a little. I fully documented the issue to the client and was able to resolve immediately. Considering the extent of what has been done to this site in terms of redirects, numerous inconsistent url structures and the fact that we have been able to resolve anything that has popped up, I am a little disappointed in what was said here.
                        Many apologizes to you Dan. I was not made aware that anyone else was in the kitchen when I was trying to resolve the Desktop & Mobile buttons issue. The redirects was indeed an issue that I had recommended you to help with as it is your area of expertise. There has been an issue with more than just you and I working in this kitchen. And again, in that instance I was also not aware that someone had been until I was told it was "broken".
                        Leslie Kirk
                        Miva Certified Developer
                        Miva Merchant Specialist since 1997
                        Previously of Webs Your Way
                        (aka Leslie Nord leslienord)

                        Email me: [email protected]
                        www.lesliekirk.com

                        Follow me: X | Facebook | Pinterest

                        Comment

                        • lesliekirk
                          Super Moderator











                          • Aug 2008
                          • 9304

                          #13
                          Re: Toggle back to mobile version

                          Originally posted by KNewbrough View Post
                          Hi Leslie,

                          This should do the trick:

                          Code:
                          <a href="[COLOR=#333333]&mvt:global:sessionurl;[/COLOR]" title="Switch to Mobile" rel="nofollow" onclick="eraseCookie('ui','desktop');">Switch to Mobile</a>
                          If you wanted that button to only be available on mobile devices viewing the desktop site (and not available for regular desktop computers), you can go to the store's HTML Profile element and find this block of code, and add another variable for that purpose (all code included here for reference, but you only need the labeled line below).

                          Code:
                          <mvt:if expr="( 'android' CIN s.http_user_agent OR         'iphone' CIN s.http_user_agent OR 
                                  'opera mini' CIN s.http_user_agent OR
                                  'opera mobile' CIN s.http_user_agent OR 
                                  'ipod' CIN s.http_user_agent OR 
                                  'webOS' CIN s.http_user_agent OR 
                                  'iemobile' CIN s.http_user_agent OR 
                                  'blackberry' CIN s.http_user_agent) AND NOT('tablet' CIN s.http_user_agent OR 
                                  'GT-P1000' CIN s.http_user_agent OR 
                                  'SCH-I800' CIN s.http_user_agent OR 
                                  'is_tablet' CIN s.http_user_agent OR 
                                  'is_tablet' CIN s.http_user_agent) ">
                                          
                          <mvt:item name="toolkit" param="sassign|mobile|TRUE" />
                          <mvt:item name="toolkit" param="sassign|mobileButton|truthy" /> <!-- This is the line you will add to the existing code -->
                          <mvt:item name="toolkit" param="vassign|mivaScreen|l.all_settings:page:code" />
                          </mvt:if>
                          Then put this on the bottom of the page:

                          Code:
                          <mvt:if expr="g.mobileButton">
                            <a href="[COLOR=#333333]&mvt:global:sessionurl;[/COLOR]" title="Switch to Mobile" rel="nofollow" onclick="eraseCookie('ui','desktop');">Switch to Mobile</a>
                          </mvt:if>
                          I've tried this both ways and neither seems to return the desktop version back to the mobile version on my iPhone using Safari and Chrome - it doesn't seem to want to behave for me.

                          Leslie
                          Leslie Kirk
                          Miva Certified Developer
                          Miva Merchant Specialist since 1997
                          Previously of Webs Your Way
                          (aka Leslie Nord leslienord)

                          Email me: [email protected]
                          www.lesliekirk.com

                          Follow me: X | Facebook | Pinterest

                          Comment

                          • wcw
                            Developer Partner

                            • Mar 2006
                            • 11329

                            #14
                            Re: Toggle back to mobile version

                            Is the head tag item on every page?

                            Is the javascript erasecookie function in the head tag/css tab for the store.

                            You might change the destination url for the erase from &mvt:global:sessionurl; to /SFNT.html or whatever the mobile's front page is.
                            Bill Weiland - Emporium Plus http://www.emporiumplus.com/store.mvc
                            Online Documentation http://www.emporiumplus.com/tk3/v3/doc.htm
                            Question http://www.emporiumplus.com/mivamodu...vc?Screen=SPTS
                            Facebook http://www.facebook.com/EmporiumPlus
                            Twitter http://twitter.com/emporiumplus

                            Comment

                            • lesliekirk
                              Super Moderator











                              • Aug 2008
                              • 9304

                              #15
                              Re: Toggle back to mobile version

                              Originally posted by wcw View Post

                              Is the javascript erasecookie function in the head tag/css tab for the store.
                              javascript erasecookie function? I just used the code that Kyle provided. If there is a function that is supposed to go along with it, that could be why it's not working for me.
                              Leslie Kirk
                              Miva Certified Developer
                              Miva Merchant Specialist since 1997
                              Previously of Webs Your Way
                              (aka Leslie Nord leslienord)

                              Email me: [email protected]
                              www.lesliekirk.com

                              Follow me: X | Facebook | Pinterest

                              Comment

                              Working...
                              X