Code Duplication    Length = 5-5 lines in 2 locations

includes/class-wc-ajax.php 2 locations

@@ 240-244 (lines=5) @@
237
238
		$chosen_shipping_methods = WC()->session->get( 'chosen_shipping_methods' );
239
240
		if ( isset( $_POST['shipping_method'] ) && is_array( $_POST['shipping_method'] ) ) {
241
			foreach ( $_POST['shipping_method'] as $i => $value ) {
242
				$chosen_shipping_methods[ $i ] = wc_clean( $value );
243
			}
244
		}
245
246
		WC()->session->set( 'chosen_shipping_methods', $chosen_shipping_methods );
247
@@ 283-287 (lines=5) @@
280
281
		$chosen_shipping_methods = WC()->session->get( 'chosen_shipping_methods' );
282
283
		if ( isset( $_POST['shipping_method'] ) && is_array( $_POST['shipping_method'] ) ) {
284
			foreach ( $_POST['shipping_method'] as $i => $value ) {
285
				$chosen_shipping_methods[ $i ] = wc_clean( $value );
286
			}
287
		}
288
289
		WC()->session->set( 'chosen_shipping_methods', $chosen_shipping_methods );
290
		WC()->session->set( 'chosen_payment_method', empty( $_POST['payment_method'] ) ? '' : $_POST['payment_method'] );