When I used User Agent Rules and select another theme for iphone (for example), changes are done in CSS only, but I want to change content and layout too.
-
Welcome to Magento SE. Please explain your configuration in a bit more detail. The title looks like you have different store views for mobile and desktop ("store view" has a specific meaning in Magento), but the question does not mention store views at all, only user agent rules.– Fabian SchmenglerCommented Aug 4, 2017 at 8:38
-
pls check pepperfry.com in desktop and mobile I search best soulation to build website smilar it . I already done 70% desktop view and now I want to adabt mobile view - u will notic mobile view not used same layout in desktop . thanks– mohammedCommented Aug 4, 2017 at 15:13
1 Answer
The User Agent Rule only changes the theme but the store view remains the same.
To achieve what you want, you have 2 possibilities. Both of them require you create a new store view for mobile
users.
First solution is to assign a different subdomain for the new store view, like m.domain.com
, and on .htaccess
level redirect the users to the correct store view based on user agent (see here)
The second solution is to filter the user agent in index.php
and for each set, load the correct store view. This way you can keep both store views on the same domain
-
-
about " The second solution is to filter the user agent in index.php and for each set, load the correct store view. This way you can keep both store views on the same domain " any guide reference ?– mohammedCommented Aug 4, 2017 at 14:11