Skip to content

Commit

Permalink
Added extra check on update parcelshop id
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Dohmen committed Jun 4, 2020
1 parent 5fb1686 commit 35e3082
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion includes/checkout.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' );
}
Expand Down

0 comments on commit 35e3082

Please sign in to comment.