Code Duplication    Length = 5-5 lines in 2 locations

includes/class-wc-ajax.php 2 locations

@@ 1324-1328 (lines=5) @@
1321
					$new_stock    = $_product->reduce_stock( $stock_change );
1322
					$item_name    = $_product->get_sku() ? $_product->get_sku() : $_product->id;
1323
1324
					if ( ! empty( $_product->variation_id ) ) {
1325
						$note = sprintf( __( 'Item %s variation #%s stock reduced from %s to %s.', 'woocommerce' ), $item_name, $_product->variation_id, $new_stock + $stock_change, $new_stock );
1326
					} else {
1327
						$note = sprintf( __( 'Item %s stock reduced from %s to %s.', 'woocommerce' ), $item_name, $new_stock + $stock_change, $new_stock );
1328
					}
1329
1330
					$return[]     = $note;
1331
					$order->add_order_note( $note );
@@ 1371-1375 (lines=5) @@
1368
					$new_quantity = $_product->increase_stock( $stock_change );
1369
					$item_name    = $_product->get_sku() ? $_product->get_sku() : $_product->id;
1370
1371
					if ( ! empty( $_product->variation_id ) ) {
1372
						$note = sprintf( __( 'Item %s variation #%s stock increased from %s to %s.', 'woocommerce' ), $item_name, $_product->variation_id, $old_stock, $new_quantity );
1373
					} else {
1374
						$note = sprintf( __( 'Item %s stock increased from %s to %s.', 'woocommerce' ), $item_name, $old_stock, $new_quantity );
1375
					}
1376
1377
					$return[]     = $note;
1378
					$order->add_order_note( $note );