1. PHP / Говнокод #23333

    −2

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    public static function getItemGrid($settings, $site_width, $columns) {
            $products_per_row_xs = Journal2Utils::getProperty($settings, 'mobile.value', 1);
            $products_per_row_sm = Journal2Utils::getProperty($settings, 'mobile1.value', 2);
            if ($columns == 1) {
                $products_per_row_md = Journal2Utils::getProperty($settings, 'tablet1.value', 2);
            } else if ($columns == 2) {
                $products_per_row_md = Journal2Utils::getProperty($settings, 'tablet2.value', 1);
            } else {
                $products_per_row_md = Journal2Utils::getProperty($settings, 'tablet.value', 3);
            }
            if ($columns == 1) {
                $products_per_row_lg = Journal2Utils::getProperty($settings, 'desktop1.value', 4);
            } else if ($columns == 2) {
                $products_per_row_lg = Journal2Utils::getProperty($settings, 'desktop2.value', 3);
            } else {
                $products_per_row_lg = Journal2Utils::getProperty($settings, 'desktop.value', 5);
            }
            if ($columns == 1) {
                $products_per_row_xl = Journal2Utils::getProperty($settings, 'large_desktop1.value', 4);
            } else if ($columns == 2) {
                $products_per_row_xl = Journal2Utils::getProperty($settings, 'large_desktop2.value', 3);
            } else {
                $products_per_row_xl = Journal2Utils::getProperty($settings, 'large_desktop.value', 5);
            }
            return array(
                'xs'    => $products_per_row_xs,
                'sm'    => $products_per_row_sm,
                'md'    => $products_per_row_md,
                'lg'    => $products_per_row_lg,
                'xl'    => $site_width > 1200 ? $products_per_row_xl : $products_per_row_lg
            );
        }

    Метод из шаблона Journal в opencart

    Запостил: den_rad, 06 Сентября 2017

    Комментарии (1) RSS

    Добавить комментарий