Code Duplication    Length = 5-5 lines in 2 locations

includes/class-wc-ajax.php 2 locations

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