wp-graphql-woocommerce
wp-graphql-woocommerce copied to clipboard
createOrder with currency does not work as expected
Describe the bug Can not create order with different currency code.
To Reproduce
Go to GraphiQL IDE and run mutation:
mutation CreateOrderMutation( $address: String, $name: String, $phone: String, $currency: String, $lineItems: [LineItemInput]) { createOrder( input: { currency: $currency, lineItems: $lineItems, shipping: {address1: $address, firstName: $name, phone: $phone}} ) { orderId order { currency } } }
Variables:
{ "currency": "VND", "lineItems":[ { "productId": 58, "quantity": 1, "subtotal": "198000", "total": "198000" } ], "address": "Ba Dinh", "name": "Hung Nguyen", "phone": "0123456789" }
Expected behavior The order was succesfully created but with default currency (JPY), not the currency provide with the input (VND). When the input had only lineItems, it works (the currency is correct as VND). But when input has additional shipping information, the order was created with default currency - JPY
Screenshots
Plugin Versions
- WooGraphQL Version: 0.10.7
- WPGraphQL Version: 1.6.11
- WordPress Version: 5.9.2
- WooCommerce Version: 6.0.1
Additional context Add any other context about the problem here.