From e3c022f3fd187d39280c373ee8116fbeb0b54fa0 Mon Sep 17 00:00:00 2001 From: piloujp <117885587+piloujp@users.noreply.github.com> Date: Fri, 14 Jul 2023 09:49:34 +0900 Subject: [PATCH] States pull down menu error when creating account (#5711) Fixes issue #5707 When submitting create account form, message 'Please select a state from the States pull down menu.' appears although state field (input text) has been properly filled. Only when 'Configuration>Customers Details>State field - Display as pulldown when possible?' is set to false and has zones defined. --- includes/modules/checkout_new_address.php | 2 +- includes/modules/create_account.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/modules/checkout_new_address.php b/includes/modules/checkout_new_address.php index 1f944ebf9a..930588f892 100644 --- a/includes/modules/checkout_new_address.php +++ b/includes/modules/checkout_new_address.php @@ -79,7 +79,7 @@ $check_query = $db->bindVars($check_query, ':zoneCountryID', $country, 'integer'); $check = $db->Execute($check_query); $entry_state_has_zones = ($check->fields['total'] > 0); - if ($entry_state_has_zones == true) { + if ($entry_state_has_zones == true && ACCOUNT_STATE_DRAW_INITIAL_DROPDOWN === 'true') { $zone_query = "SELECT distinct zone_id, zone_name, zone_code FROM " . TABLE_ZONES . " WHERE zone_country_id = :zoneCountryID diff --git a/includes/modules/create_account.php b/includes/modules/create_account.php index e81e1b3e16..23c7525739 100644 --- a/includes/modules/create_account.php +++ b/includes/modules/create_account.php @@ -198,7 +198,7 @@ $check_query = $db->bindVars($check_query, ':zoneCountryID', $country, 'integer'); $check = $db->Execute($check_query); $entry_state_has_zones = ($check->fields['total'] > 0); - if ($entry_state_has_zones == true) { + if ($entry_state_has_zones == true && ACCOUNT_STATE_DRAW_INITIAL_DROPDOWN === 'true') { $zone_query = "SELECT distinct zone_id, zone_name, zone_code FROM " . TABLE_ZONES . " WHERE zone_country_id = :zoneCountryID