Last Updated: February 25, 2016
·
909
· lefakir

Prestashop 1.5, force mobile theme display

I'm working on a prestashop mobile theme integration and i wondered how to force display in mobile context for a desktop browser (usefull for debugging and coding).

As I don't want to alter the standart User Agent, i found a simple way to do this with code.

Open classes/Context.php and edit getMobileDevice() function :

public function getMobileDevice()
{
       if (is_dir('/Users/jefio')) return true;
       // whatever code

Go back to code !

Naturally, it's a good idea to wrap this code in an override module like this one https://github.com/cahri/Prestashop-force-mobile-theme