Identify via BurnEngine PHP, if user is on mobile

ThemeBurn SupportForumsOpenCart ThemesBurnEngineIdentify via BurnEngine PHP, if user is on mobile

This topic has been marked as resolved.

Hi Support,

I would like to implement a custom JS via PHP module, which should be loaded only on desktop. Does Burnengine has some sort of function, variable or class telling me, if user is on mobile?

Something like
if ($tbData->isMobile) {}

Thanks,
Axanne

 axanne
November 18, 2016 at 8:40 pm #53339

Hi Axanne,

We’ve removed all server side device detection and for the moment use only JS to detect screen size or touch screen options:

// Check for screen size
if (tbApp.windowWidth < 768) {
  // do something
}

// Check for touch screen
if (tbUtils.is_touch) {
  // do something
}

P.S. Have in mind that these checks can be used only in Javascript.

BR,
ThemeBurn team

November 21, 2016 at 10:13 am #53422

Ok, thanks. Will use the JS code for my logic.

 axanne
November 23, 2016 at 11:33 am #53530

Glad we’ve helped.

BR,
ThemeBurn team

November 28, 2016 at 2:19 pm #53731
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.