Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CreateOrder returning empty line items #413

Open
pandabrand opened this issue Dec 22, 2020 · 3 comments
Open

CreateOrder returning empty line items #413

pandabrand opened this issue Dec 22, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@pandabrand
Copy link

pandabrand commented Dec 22, 2020

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:

  1. Send CreateOrder Mutation with two line items
  2. 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
            }
          ]
        }
      }
    }
  }
@kidunot89
Copy link
Member

@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.

@pandabrand
Copy link
Author

@kidunot89 No worries, they are both Simple products, one is virtual. I didn't have the DEBUG option checked initially but I do know.

@kidunot89
Copy link
Member

@pandabrand Has there been any movement on this issue?

@kidunot89 kidunot89 added the bug Something isn't working label Oct 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants