fix(kasse): HTTP 500 in der Gast-Kasse bei leerem Land

- Country::getShippingAreaById: Land/Gruppe als int, leeres Land -> false
  statt 'WHERE id = ' (SQL-Fatal, leere Seite, 16x seit 03.09.2026)
- manage_guest_order_address: Lieferadresse = Rechnungsadresse ohne Land
  -> Standardland fuer die Versandgebiet-Suche
This commit is contained in:
Tom Bartelt
2026-09-22 21:21:38 +02:00
parent 40b4774f0d
commit 6cea66126a
2 changed files with 12 additions and 0 deletions
+8
View File
@@ -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";
+4
View File
@@ -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']) {