0

I placed order using magento graphQL api, order placed successfully and listed in my orders section in website. I placed order of 1 product. In website's order detail page it displaying 1 item ordered. But when I fetch order items data using rest api rest/default/V1/orders/000000004, it gives me 2 item ordered.

I think there may be something naming issue, because I ordered,

product name : Portia Capri
size : 29
color : Green

Now, when I fetch ordered items data using rest api it returning 2 items which includes Portia Capri and Portia Capri-29-Green.

Please anyone can help me how to get only ordered item ?

1 Answer 1

0

When place order configurable product then magento create 2 entry sales_order_item

Check this Query

SELECT * FROM `sales_order_item` WHERE `order_id` = 'your_order_id'
5
  • Ok, but how I can get only ordered item ? Commented Sep 3, 2020 at 13:36
  • You can get only visible item use this $order->getAllVisibleItems() Commented Sep 3, 2020 at 13:38
  • Means where I pass this condition ? I am using this api to get orders : magento.redoc.ly/2.4-admin/tag/orders#operation/… Commented Sep 3, 2020 at 13:57
  • You need to mange with coding Commented Sep 3, 2020 at 13:58
  • I am using this rest api to build mobile app. How can I mange with coding there ? Commented Sep 3, 2020 at 13:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.