Disable a Magento mobile theme for tablet & iPad

末鹿安然 提交于 2020-01-02 05:12:06

问题


I made a website that include desktop as well as mobile theme. It works perfectly fine, but in tablet & iPad it shows mobile theme that I don't want. so I use the following exception

(iPhone|iPod|BlackBerry|Pre|Palm|Googlebot-Mobile|mobi|Safari Mobile|Windows Mobile|Android|Opera Mini|mobile)|(!iPad|Silk|Kindle|Xoom|SCH-I800|Tablet)

but now also it shows mobile theme. Please help me how can I call desktop theme in tablet & iPad.


回答1:


I try a lot of strings. At last by using this string:

iPhone|iPod|Mobile

problem is solved. It shows desktop theme in table & in mobile shows mobile theme.




回答2:


For me, the mobile theme would still load on iPad when using "iPhone|iPod|Mobile" as the expression.

In the end I created two exceptions for each section as they work like an if / elseif statement.

First match was to match the devices I wanted the desktop theme to load for e.g. iPad|Tablet to load "default". The second match was for the other devices e.g. "iPhone|Mobile" to load the mobile theme.




回答3:


I have done recently same thing in my project. You need to specify some width of user agent to which you can show mobile site else your desktop site. You can get width from object of whatever API you are using or from backend part by creating some tab in configuration and specifying width there.

Hope it will help you.



来源:https://stackoverflow.com/questions/15741131/disable-a-magento-mobile-theme-for-tablet-ipad

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!