Code Duplication    Length = 3-3 lines in 2 locations

includes/abstracts/abstract-wc-legacy-order.php 1 location

@@ 57-59 (lines=3) @@
54
55
		// Handly qty if set
56
		if ( isset( $args['qty'] ) ) {
57
			if ( $product->backorders_require_notification() && $product->is_on_backorder( $args['qty'] ) ) {
58
				$item->add_meta_data( apply_filters( 'woocommerce_backordered_item_meta_name', __( 'Backordered', 'woocommerce' ) ), $args['qty'] - max( 0, $product->get_total_stock() ), true );
59
			}
60
			$args['subtotal'] = $args['subtotal'] ? $args['subtotal'] : $product->get_price_excluding_tax( $args['qty'] );
61
			$args['total']	= $args['total'] ? $args['total'] : $product->get_price_excluding_tax( $args['qty'] );
62
		}

includes/abstracts/abstract-wc-order.php 1 location

@@ 903-905 (lines=3) @@
900
		$item = new WC_Order_Item_Product( $args );
901
902
		// Handle backorders
903
		if ( $product->backorders_require_notification() && $product->is_on_backorder( $args['qty'] ) ) {
904
			$item->add_meta_data( apply_filters( 'woocommerce_backordered_item_meta_name', __( 'Backordered', 'woocommerce' ) ), $args['qty'] - max( 0, $product->get_total_stock() ), true );
905
		}
906
907
		$item->set_order_id( $this->get_id() ? $this->get_id() : $this->save() );
908
		$item->save();