From f458be3293ae24499c0be063d21e2612a7b833f3 Mon Sep 17 00:00:00 2001 From: Remo Zaros Date: Thu, 28 May 2026 09:44:33 +0200 Subject: [PATCH] Change shipping fields to billing fields. Change error message to error code in switcht statement. --- session_dialog.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/session_dialog.php b/session_dialog.php index c48a207..09f8591 100644 --- a/session_dialog.php +++ b/session_dialog.php @@ -71,14 +71,14 @@ function send_postcode_data() console.log("Data returnd", data); if (data.status === "error"){ - const err = data.message; + const err = data.code; let errmsg switch (err) { - case "Huisnummer not found": + case "HUISNUMMER_NOT_FOUND": errmsg = "Adres niet gevonden."; break; - case "Multiple addresses match this huisnummer; add huisletter and/or huisnummertoevoeging": + case "HUISNUMMER_AMBIGUOUS": errmsg = "Huisnummertovoeging mist."; break; default: @@ -325,7 +325,7 @@ function modify_checkout_with_js() if (typeof wp !== 'undefined' && wp.data && wp.data.dispatch) { const store = 'wc/store/cart'; - wp.data.dispatch(store).setShippingAddress({ + wp.data.dispatch(store).setBillingAddress({ first_name: '', last_name: '', address_1: '', @@ -341,7 +341,7 @@ function modify_checkout_with_js() //make fields READONLY and ppstcode reset. setTimeout(() => { // make prefilled fiields readonly. - $('#shipping-postcode, #shipping-city, #shipping-address_1') + $('#billing-postcode, #billing-city, #billing-address_1') .prop('readonly', true) .css('background', '#f9f9f9');