From 35e3082e6c8d478240168145febf92377fa454df Mon Sep 17 00:00:00 2001 From: Tim Dohmen Date: Thu, 4 Jun 2020 09:34:36 +0200 Subject: [PATCH] Added extra check on update parcelshop id --- includes/checkout.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/checkout.php b/includes/checkout.php index c8a9e7e..bd1e105 100644 --- a/includes/checkout.php +++ b/includes/checkout.php @@ -184,7 +184,7 @@ function wcwp_get_order_weight($order_id) add_action('woocommerce_checkout_update_order_meta', 'wcwp_update_parcelshop_id'); function wcwp_update_parcelshop_id($order_id) { - if (!empty($_POST['parcelshop_id']) && (isset($_POST['shipping_method'][0]) && 'wuunder_parcelshop' === sanitize_text_field($_POST['shipping_method'][0]))) { + if (!empty($_POST['parcelshop_id']) && isset($_POST['shipping_method']) && (isset($_POST['shipping_method'][0]) && 'wuunder_parcelshop' === sanitize_text_field($_POST['shipping_method'][0]))) { update_post_meta($order_id, 'parcelshop_id', sanitize_text_field($_POST['parcelshop_id'])); WC()->session->__unset( 'WCWP_SELECTED_PARCELSHOP_ID' ); }