diff --git a/includes/class-wc-ajax.php b/includes/class-wc-ajax.php index d7fe9278a90..55785ddbd83 100644 --- a/includes/class-wc-ajax.php +++ b/includes/class-wc-ajax.php @@ -131,9 +131,11 @@ class WC_AJAX { $chosen_shipping_methods = WC()->session->get( 'chosen_shipping_methods' ); - if ( isset( $_POST['shipping_method'] ) && is_array( $_POST['shipping_method'] ) ) - foreach ( $_POST['shipping_method'] as $i => $value ) + if ( isset( $_POST['shipping_method'] ) && is_array( $_POST['shipping_method'] ) ) { + foreach ( $_POST['shipping_method'] as $i => $value ) { $chosen_shipping_methods[ $i ] = wc_clean( $value ); + } + } WC()->session->set( 'chosen_shipping_methods', $chosen_shipping_methods );