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' ); }