diff --git a/composer.json b/composer.json index c526b1a..3daccac 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,7 @@ "description":"Isotope Stock.", "type": "contao-bundle", "license":"AGPL-3.0-or-later", - "version": "1.0.15", + "version": "1.0.16", "require": { "contao/core-bundle": "^4.9", "isotope/isotope-core": "^2.6", diff --git a/src/Helper/ProductHelper.php b/src/Helper/ProductHelper.php index 5cb5d91..1cc921b 100644 --- a/src/Helper/ProductHelper.php +++ b/src/Helper/ProductHelper.php @@ -141,9 +141,9 @@ public static function loadStockInfoForProducts(array $product_ids) { `tl_isotope_stock_account`.`type`, `tl_isotope_stock_booking`.`product_id` FROM `tl_isotope_stock_booking_line` - LEFT JOIN `tl_isotope_stock_booking` ON `tl_isotope_stock_booking`.`id` = `tl_isotope_stock_booking_line`.`pid` - LEFT JOIN `tl_isotope_stock_period` ON `tl_isotope_stock_period`.`id` = `tl_isotope_stock_booking`.`period_id` AND `tl_isotope_stock_period`.`active` = '1' - LEFT JOIN `tl_isotope_stock_account` ON `tl_isotope_stock_account`.`id` = `tl_isotope_stock_booking_line`.`account` + INNER JOIN `tl_isotope_stock_booking` ON `tl_isotope_stock_booking`.`id` = `tl_isotope_stock_booking_line`.`pid` + INNER JOIN `tl_isotope_stock_period` ON `tl_isotope_stock_period`.`id` = `tl_isotope_stock_booking`.`period_id` AND `tl_isotope_stock_period`.`active` = '1' + INNER JOIN `tl_isotope_stock_account` ON `tl_isotope_stock_account`.`id` = `tl_isotope_stock_booking_line`.`account` WHERE `tl_isotope_stock_booking`.`product_id` IN(".implode(",", $pids).") OR `tl_isotope_stock_booking`.`product_id` IS NULL GROUP BY `tl_isotope_stock_booking_line`.`account`, `tl_isotope_stock_booking`.`product_id` ORDER BY `tl_isotope_stock_booking`.`product_id`