Pankaj Yogi
Pankaj Yogi

Reputation: 207

How to add Mobile_Detect.php in prestashop 1.7?

I need to add Mobile_Detect.php in prestashop 1.7. I tried to override FrontController.php according to this post https://www.prestashop.com/forums/topic/224983-need-help-including-class-to-detect-mobile-phones/

but no class added in tpl file.

Upvotes: 2

Views: 4554

Answers (1)

Md Kamruzzaman
Md Kamruzzaman

Reputation: 394

You can use prestashop default device detect functionality :

get device :

Context::getContext()->getDevice();

Check Mobile :

Context::getContext()->isMobile();

Check Tablet:

Context::getContext()->isTablet();

You can find the prestashop default class: prestashop_root_path/classes/Context.php

Upvotes: 7

Related Questions