Отключение мобильного шаблона в webasyst (Shop-Script)

07.07.2014 12:28:10
По умолчанию webasyst отображаете магазин, на всех мобильных устройствах, не через основной шаблон, а через стандартный мобильный шаблон. Выглядит он очень криво, а иногда и вообще никак.

Для его отключения нужно в файле /published/SC/html/scripts/core_functions/functions.php найти функцию detectPDA, закомментировать (или удалить) ее тело и всегда возвращать FALSE.
Было:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
function detectPDA(){
    $container = $_SERVER['HTTP_USER_AGENT'];
    $useragents = array (
        'iPhone','iPod',"Elaine/3.0","Palm","EudoraWeb","Blazer","AvantGo","Windows CE","Cellphone","Small","MMEF20","Danger","hiptop"
        ,"Proxinet","ProxiNet","Newt","PalmOS","NetFront","SHARP-TQ-GX10","SonyEricsson","SymbianOS","UP.Browser"
        ,"UP.Link","TS21i-10","BlackBerry","MOT-V",'portalmmm','Nokia','DoCoMo','Opera Mini'
        ,"Palm" ,"Handspring","Nokia","Kyocera","Samsung","Motorola","Mot" ,"Smartphone","Blackberry"
        ,"WAP","PlayStation Portable","LG","MMP","OPWV","Symbian","EPOC"
        ,"Android");
        $pda = false;
        foreach ( $useragents as $useragent ) {
            if (preg_match("@{$useragent}@i",$container)){
                $pda = true;
                break;
            }
        }
        return FALSE;
}

Стало:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
function detectPDA(){
        return FALSE;
/*
    $container = $_SERVER['HTTP_USER_AGENT'];
    $useragents = array (
        'iPhone','iPod',"Elaine/3.0","Palm","EudoraWeb","Blazer","AvantGo","Windows CE","Cellphone","Small","MMEF20","Danger","hiptop"
        ,"Proxinet","ProxiNet","Newt","PalmOS","NetFront","SHARP-TQ-GX10","SonyEricsson","SymbianOS","UP.Browser"
        ,"UP.Link","TS21i-10","BlackBerry","MOT-V",'portalmmm','Nokia','DoCoMo','Opera Mini'
        ,"Palm" ,"Handspring","Nokia","Kyocera","Samsung","Motorola","Mot" ,"Smartphone","Blackberry"
        ,"WAP","PlayStation Portable","LG","MMP","OPWV","Symbian","EPOC"
        ,"Android");
        $pda = false;
        foreach ( $useragents as $useragent ) {
            if (preg_match("@{$useragent}@i",$container)){
                $pda = true;
                break;
            }
        }
        return $pda;
*/
}


Категории: WebAsyst (shop-script)
Яндекс.Метрика