protected function switchTheme(Controller $controller)
    {
        if (!$controller->isInternalRoute()) {

            try {

                $device = $this->getDeviceType();
                $store_id = $controller->getStoreId();
                $settings = $this->module->getSettings('device');

                if (!$controller->isBackend() && $device !== 'desktop' && !empty($settings['theme'][$store_id][$device])) {
                    $theme = $settings['theme'][$store_id][$device];
                    if ($this->module->isEnabled($theme)) {
                        $controller->setCurrentTheme($theme);
                    }
                }

            } catch (Exception $ex) {
                trigger_error($ex->getMessage());
            }
        }
    }
protected function switchTheme(Controller $controller)
    {
        if (!$controller->isInternalRoute()) {

            try {

                $device = $this->getDeviceType();
                $store_id = $controller->getStoreId();
                $settings = $this->module->getSettings('device');

                if (!$controller->isBackend() && $device !== 'desktop' && !empty($settings['theme'][$store_id][$device])) {
                    $theme = $settings['theme'][$store_id][$device];
                    if ($this->module->isEnabled($theme)) {
                        $controller->setCurrentTheme($theme);
                    }
                }

            } catch (Exception $ex) {
                trigger_error($ex->getMessage());
            }
        }
    }
protected function switchTheme ( Controller $ controller ) { if ( ! $ controller -> isInternalRoute ( ) ) { try { $ device = $ this -> getDeviceType ( ) ; $ store_id = $ controller -> getStoreId ( ) ; $ settings = $ this -> module -> getSettings ( 'device' ) ; if ( ! $ controller -> isBackend ( ) && $ device !== 'desktop' && ! empty ( $ settings [ 'theme' ] [ $ store_id ] [ $ device ] ) ) { $ theme = $ settings [ 'theme' ] [ $ store_id ] [ $ device ] ; if ( $ this -> module -> isEnabled ( $ theme ) ) { $ controller -> setCurrentTheme ( $ theme ) ; } } } catch ( Exception $ ex ) { trigger_error ( $ ex -> getMessage ( ) ) ; } } }
Switch the current theme
@param Controller $controller
Switch the current theme