2017-04-20 109 views

回答

2

可以使用的Prestashop默认设备检测功能:

获得设备:

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

验证手机号:

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

检查平板电脑:

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

你可以找到公关estashop默认分类: prestashop_root_path/classes/Context.php

+0

我可以在tpl文件中使用 –

+0

是的,你可以在任何地方使用。 –

+0

感谢您的快速答复。当我打印{Context :: getContext() - > getDevice();}这返回1不是设备名称。另外我想知道是否有任何方法知道prestashop tpl中的视口大小。 –