0

I have added theme Exception for mobile user in System >> Configuration >> GENERAL >> Design.

And I want to add desktop version and mobile version link so the user can switch it.

I have no idea how to do this. Tell me where to start to make this feature?

1

2 Answers 2

0

Write below code in action to set Package and theme for the action

Mage::getDesign()->setArea('frontend') //Area (frontend|adminhtml)
->setPackageName('default') //Name of Package
->setTheme('modern'); // Name of theme
3
  • Thank you roshan for your help. But what file I need to add the above code?
    – Wakanina
    Commented Apr 13, 2013 at 1:10
  • Create a controller action and there you can put this code. Create a form that will switch theme on button click.
    – roshan lal
    Commented Apr 14, 2013 at 4:17
  • Thank you Roshan, it works. I start my project with this code :)
    – Wakanina
    Commented Apr 16, 2013 at 6:03
0

Magento mobile theme works by detecting user-agent of browser. Please refer this link - http://www.magentocommerce.com/boards/viewthread/280148/#t418581

4
  • Thank roshan lal for your response. But I don't want to make new store view to do this.
    – Wakanina
    Commented Apr 11, 2013 at 6:58
  • Well then would you try changing user-agent of browser on button click. hynchrstn.wordpress.com/2011/11/24/…
    – roshan lal
    Commented Apr 11, 2013 at 7:02
  • @Wakanina - Did you get any solution?
    – roshan lal
    Commented Apr 11, 2013 at 12:42
  • Sorry for the late Roshan. My PC was crashed yesterday. Thanks, I will try it. I will update this thread when it success.
    – Wakanina
    Commented Apr 13, 2013 at 23:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.