wp-graphql-woocommerce
wp-graphql-woocommerce copied to clipboard
CreateOrder returning empty line items
Describe the bug When I use the CreateOrder Mutation the it is creating an empty line item for each one I send over.
To Reproduce Steps to reproduce the behavior:
- Send CreateOrder Mutation with two line items
- Response sends back order with four line items
Expected behavior An Order with the same amount of line items as sent over
Using version 0.7.0
Mutation
{"input":
{
"clientMutationId":"47f37973-f317-4a7b-b978-1656fa2e8814",
"isPaid":false,
"customerId":XXXX,
"shippingLines":
[
{
"methodId":"flat_rate",
"methodTitle":"Flat Rate",
"total":"250"
}
],
"lineItems":
[
{
"id":"cHJvZHVjdDo1Mjk2",
"productId":5296,
"quantity":1,
"total":"$3,490.00"
},
{
"id":"cHJvZHVjdDo1OTIw",
"productId":5920,
"quantity":1,
"total":"$588.00"
}
],
"billing":{...},
"shipping":{...}
}
}
Response
"data": {
"__typename": "RootMutation",
"createOrder": {
"order": {
"databaseId": 1000108089,
"orderNumber": "1000108089",
"lineItems": {
"nodes": [
{
"databaseId": 404757,
"quantity": null,
"productId": null,
"total": null,
"totalTax": null
},
{
"databaseId": 404758,
"quantity": 1,
"productId": 5296,
"total": "3490.00",
"totalTax": null
},
{
"databaseId": 404759,
"quantity": null,
"productId": null,
"total": null,
"totalTax": null
},
{
"databaseId": 404760,
"quantity": 1,
"productId": 5920,
"total": "588.00",
"totalTax": null
}
]
}
}
}
}
@pandabrand Sorry for late response. Can you elaborate more about the product being used in the order? Are they all simple products? And do you have the DEBUG option check in you WPGraphQL Settings.
@kidunot89 No worries, they are both Simple products, one is virtual. I didn't have the DEBUG option checked initially but I do know.
@pandabrand Has there been any movement on this issue?