Ankita Agrawal
Ankita Agrawal

Reputation: 504

Disable a Magento mobile theme for tablet & iPad

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.

Upvotes: 4

Views: 5586

Answers (3)

Ankita Agrawal
Ankita Agrawal

Reputation: 504

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.

Upvotes: 2

mongbatstar
mongbatstar

Reputation: 21

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.

Upvotes: 1

ANKIT
ANKIT

Reputation: 341

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.

Upvotes: 0

Related Questions