- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 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
);
}