diff --git a/core/country.class.php b/core/country.class.php index c8ac357..a422252 100644 --- a/core/country.class.php +++ b/core/country.class.php @@ -261,6 +261,14 @@ class Country extends Main { public static function getShippingAreaById($countryId, $customer_group_id = false) { $db = Registry::get('base')->db; + // 22.09.2026: leeres Land (Gast-Kasse per Enter abgeschickt, Land nicht gewaehlt) lief in + // "WHERE id = " und damit in einen SQL-Fatal -> HTTP 500 mit leerer Seite in der Kasse. + $countryId = (int) $countryId; + $customer_group_id = (int) $customer_group_id; + if ($countryId <= 0) { + return false; + } + $sql = "SELECT shipping_area_id FROM countries WHERE id = $countryId"; diff --git a/modules/website_cashdesk.php b/modules/website_cashdesk.php index 7e95802..a6d3b7b 100644 --- a/modules/website_cashdesk.php +++ b/modules/website_cashdesk.php @@ -694,6 +694,10 @@ class website_cashdesk { if (isset($_POST['shipping']) && $_POST['shipping']['address'] == -1) { $this->shipping_address = $_POST['billing']; + if (empty($this->shipping_address['country'])) { + // 22.09.2026: Land nicht gewaehlt -> Standardland fuer die Versandgebiet-Suche, sonst SQL-Fatal + $this->shipping_address['country'] = $this->customer_data->default_address_country_id; + } $_POST['shipping'] = $_POST['billing']; } else if (isset($_POST['shipping'])) { if (!$this->shipping_address['country']) {