Code Duplication    Length = 5-5 lines in 2 locations

includes/class-wc-ajax.php 2 locations

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