Jump to content

module to let the user choose mobile or desktop version?


Recommended Posts

I have seen several websites with a simple link in the footer to change between mobile or desktop.

 

Is any module available for PrestaShop 1.6?

In PS 1.6 I activated the option of mobile and it looks not very nice and some features are missing (such as Advance Search 4 module.)

 

How can the user change between mobile/tablet/desktop version?

 

Thanks

Navid

Share this post


Link to post
Share on other sites

prestashop 1.6 uses responsive theme

it's not possible to "select" mobile or pc view of page because in this case everything depends on screen size.

 

simple link you mentioned appears only in prestashop 1.5 where was no responsive theme

each theme (mobile, desktop) was separated, this is why there was possibility to create button like you want now.

  • Like 1

Share this post


Link to post
Share on other sites

Hi Vekia,

 

thank you for taking time to reply but I don't understand.

 

On my smartphone I see most site in desktop version, now in PS 1.6 I am happy to see that my site had a responsive theme but surfing is not so friendly.

 

If the site has both desktop and mobile versions and in the back office I can manage them, why the user can not choose which version to see?

 

Navid

Share this post


Link to post
Share on other sites
  • 1 month later...

The responsive theme use CSS. No Javascript, no cookies, no PHP. CSS can apply different styles depending on screen size without "programming", so there is no mobile detector (I know PS 1.6 also provides the Mobile_Detect.php, but doesn't use it for responsive themes).

 

For example, you can find in themes/(YourTheme)/css/global.css code like this one. The style in the brackets is applied depending of screen size.

  @media (min-width: 768px) {... }

    @media (min-width: 991px) {... }
    @media (max-width: 479px) {... }
 

The only way to disable that is to delete these styles or to override the style. You can use also a main class for html or body class, add it to all responsive styles, and remove the responsive interaction deleting the style with Javascript or PHP/smarty. I mean:

HTML

<html class='responsive'>

    ...

    <a href="javascript: document.getElementsByTagName('HTML')[0].className = 'notResponive'; ">Disable responsive theme</a>

    ....

</html>

new CSS

@media (max-width: 767px) {

  .responive #myelement {

    float:left;

    width: 100%; }  }

previous CSS

@media (max-width: 767px) {
  #myelement {
    float:left;
    width: 100%; }  }

 

If you resize your desktop screen, you can see how it applies one style or another, even if you disable Javascript.

Edited by ouroz (see edit history)

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More