| @@ 134-144 (lines=11) @@ | ||
| 131 | } |
|
| 132 | ||
| 133 | // BW compatibility with old args |
|
| 134 | if ( isset( $args['totals'] ) ) { |
|
| 135 | foreach ( $args['totals'] as $key => $value ) { |
|
| 136 | if ( 'tax' === $key ) { |
|
| 137 | $args['total_tax'] = $value; |
|
| 138 | } elseif ( 'tax_data' === $key ) { |
|
| 139 | $args['taxes'] = $value; |
|
| 140 | } else { |
|
| 141 | $args[ $key ] = $value; |
|
| 142 | } |
|
| 143 | } |
|
| 144 | } |
|
| 145 | ||
| 146 | // Handly qty if set |
|
| 147 | if ( isset( $args['qty'] ) ) { |
|
| @@ 993-1003 (lines=11) @@ | ||
| 990 | $args = wp_parse_args( $args, $default_args ); |
|
| 991 | ||
| 992 | // BW compatibility with old args |
|
| 993 | if ( isset( $args['totals'] ) ) { |
|
| 994 | foreach ( $args['totals'] as $key => $value ) { |
|
| 995 | if ( 'tax' === $key ) { |
|
| 996 | $args['total_tax'] = $value; |
|
| 997 | } elseif ( 'tax_data' === $key ) { |
|
| 998 | $args['taxes'] = $value; |
|
| 999 | } else { |
|
| 1000 | $args[ $key ] = $value; |
|
| 1001 | } |
|
| 1002 | } |
|
| 1003 | } |
|
| 1004 | ||
| 1005 | $item = new WC_Order_Item_Product( $args ); |
|
| 1006 | $item->set_backorder_meta(); |
|