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

@@ 1050-1052 (lines=3) @@
1047
		$item = new WC_Order_Item_Product( $args );
1048
1049
		// Handle backorders
1050
		if ( $product->backorders_require_notification() && $product->is_on_backorder( $args['qty'] ) ) {
1051
			$item->add_meta_data( apply_filters( 'woocommerce_backordered_item_meta_name', __( 'Backordered', 'woocommerce' ) ), $args['qty'] - max( 0, $product->get_total_stock() ), true );
1052
		}
1053
1054
		$item->set_order_id( $this->get_id() ? $this->get_id() : $this->save() );
1055
		$item->save();