Code Duplication    Length = 3-3 lines in 2 locations

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

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

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

@@ 916-918 (lines=3) @@
913
		$item = new WC_Order_Item_Product( $args );
914
915
		// Handle backorders
916
		if ( $product->backorders_require_notification() && $product->is_on_backorder( $args['qty'] ) ) {
917
			$item->add_meta_data( apply_filters( 'woocommerce_backordered_item_meta_name', __( 'Backordered', 'woocommerce' ) ), $args['qty'] - max( 0, $product->get_total_stock() ), true );
918
		}
919
920
		$item->set_order_id( $this->get_id() ? $this->get_id() : $this->save() );
921
		$item->save();