wp-graphql-woocommerce icon indicating copy to clipboard operation
wp-graphql-woocommerce copied to clipboard

updateOrder not update order status

Open brandonqcode opened this issue 4 years ago • 1 comments

Describe the bug The updateOrder mutation is not updating the order status sending in UpdateOrderInput status, just update sending isPaid true.

To Reproduce Steps to reproduce the behavior:

  1. Mutation to run. mutation UpdateOrder($input: UpdateOrderInput!) { updateOrder(input: $input) { order { status } } }

  2. Input to send. { "input": { "orderId": 84808, "status": "FAILED" } }

Expected behavior I expect that the order status update to the status enum sended, in this case is "FAILED" but it returns me the actual order status.

Screenshots image image image

Plugin Versions

  • WooGraphQL Version: 0.10.2
  • WPGraphQL Version: 1.1.8
  • WordPress Version: 5.6.1
  • WooCommerce Version: 5.0.0

brandonqcode avatar Oct 04 '21 21:10 brandonqcode

@brandonqcode it can be fixed by updating plugin code. in file wp-graphql-woocommerce-develop/includes/mutation/class-order-update.php line no 142.

Change

$order->set_status( $input['status'] );

with this

$order->update_status( $input['status'] );

@kidunot89 i have created pull request for the same

akshaykatale99 avatar Oct 26 '21 10:10 akshaykatale99