Code Duplication    Length = 5-5 lines in 2 locations

includes/class-wc-ajax.php 2 locations

@@ 243-247 (lines=5) @@
240
241
		$chosen_shipping_methods = WC()->session->get( 'chosen_shipping_methods' );
242
243
		if ( isset( $_POST['shipping_method'] ) && is_array( $_POST['shipping_method'] ) ) {
244
			foreach ( $_POST['shipping_method'] as $i => $value ) {
245
				$chosen_shipping_methods[ $i ] = wc_clean( $value );
246
			}
247
		}
248
249
		WC()->session->set( 'chosen_shipping_methods', $chosen_shipping_methods );
250
@@ 302-306 (lines=5) @@
299
300
		$chosen_shipping_methods = WC()->session->get( 'chosen_shipping_methods' );
301
302
		if ( isset( $_POST['shipping_method'] ) && is_array( $_POST['shipping_method'] ) ) {
303
			foreach ( $_POST['shipping_method'] as $i => $value ) {
304
				$chosen_shipping_methods[ $i ] = wc_clean( $value );
305
			}
306
		}
307
308
		WC()->session->set( 'chosen_shipping_methods', $chosen_shipping_methods );
309
		WC()->session->set( 'chosen_payment_method', empty( $_POST['payment_method'] ) ? '' : $_POST['payment_method'] );