[API] Fixed create order method
This commit is contained in:
parent
99896f8410
commit
7ab0d01aa2
|
@ -374,8 +374,6 @@ class WC_API_Orders extends WC_API_Resource {
|
|||
public function create_order( $data ) {
|
||||
global $wpdb;
|
||||
|
||||
$data = isset( $data['order'] ) ? $data['order'] : array();
|
||||
|
||||
$wpdb->query( 'START TRANSACTION' );
|
||||
|
||||
try {
|
||||
|
@ -951,6 +949,8 @@ class WC_API_Orders extends WC_API_Resource {
|
|||
$item_args['totals']['subtotal_tax'] = floatval( $item['subtotal_tax'] );
|
||||
}
|
||||
|
||||
error_log( print_r( $item_args, true ) );
|
||||
|
||||
if ( $creating ) {
|
||||
|
||||
$item_id = $order->add_product( $product, $item_args['qty'], $item_args );
|
||||
|
|
Loading…
Reference in New Issue