| @@ 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 | } |
|
| @@ 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(); |
|