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

REST API Missing Product_Option values for Order Items in salesOrderManagementV1 and salesOrderItemRepositoryV1 #9326

Closed
maultby opened this issue Apr 20, 2017 · 13 comments
Labels
bug report Component: Framework/Webapi USE ONLY for FRAMEWORK RELATED BUG! E.g If bug related to Catalog WEB API use just Catalog Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release

Comments

@maultby
Copy link

maultby commented Apr 20, 2017

Preconditions

Mag CE 2.1.5
PHP 5.6.19
MySQL 5.7.11

Steps to reproduce

In Mag Admin create new Bundle product, add Bundle Items to product, set Ship Bundle Items option to Separately.
In Mag Admin create new Bundle product, add Bundle Items to product, set Ship Bundle Items option to Together.
Create and Save a separate Sales Order for each newly added Bundle Product.
Use Swagger or another development app to call salesOrderRepositoryV1 GET /V1/orders for each Sale Order and return the response body. Note that the response body model shows product_option with Order Items structure. But the REST response does not contain the product_option property and its values. The same missing content occurs with salesOrderItemRepositoryV1 GET /V1/orders/items/{id}.
When catalogProductRepositoryV1 GET /V1/products/{sku} is called for the Bundle products the response body correctly shows custom_attributes{"attribute_code": "shipment_type","value": "0"}
With Mag V1.9 SOAP API product_options is populated and the critical value shipment_type is shown. This value is critical for controlling how the sales order is to be handled in our receiving systems.

Expected result

REST API response body property product_option should be populated with values that include shipment_type.

Actual result

REST API response body property product_option is not included in response body despite the model_schema showing it and the order containing bundle product with shipment_type.

It is not possible to work around this by getting the product details during order item get because the Ship Bundle Items option may not be the same as when the order was created.

This is a show stopper for our integration project.

@veloraven veloraven added 2.1.x bug report Component: Framework/Webapi USE ONLY for FRAMEWORK RELATED BUG! E.g If bug related to Catalog WEB API use just Catalog labels Jun 23, 2017
@timtt-zz
Copy link

I am also seeing this issue with 2.1.4

@RomanKrut
Copy link

@maultby Hi. Thanks for your report. The internal ticket was created MAGETWO-70532

@veloraven veloraven added the Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development label Jul 7, 2017
@phpsyscoder
Copy link

Same issue here.... does anyone have a workaround or "quick-fix"? Would be great.
Thank you in Advance

@magento-engcom-team magento-engcom-team added 2.1.x Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development bug report Component: Framework/Webapi USE ONLY for FRAMEWORK RELATED BUG! E.g If bug related to Catalog WEB API use just Catalog Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed and removed G1 Passed labels Sep 5, 2017
@magento-engcom-team
Copy link
Contributor

@maultby, thank you for your report.
We've created internal ticket(s) MAGETWO-70532 to track progress on the issue.

@anupwankhede
Copy link

Hi this is very important issue and we would appreciate if fixed in next 2.1 version :)

@magento-engcom-team magento-engcom-team added 2.2.x Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release labels Oct 11, 2017
@crowebar
Copy link

crowebar commented Nov 8, 2017

Looks like it has been discussed previously
#9378

but rejected...
vrann suggests using GET V1/orders/items/:id request but that doesn't return them either...

magento-engcom-team pushed a commit that referenced this issue Nov 19, 2018
…der Items in salesOrderManagementV1 and salesOrderItemRepositoryV1 #9326
magento-engcom-team pushed a commit that referenced this issue Nov 19, 2018
…der Items in salesOrderManagementV1 and salesOrderItemRepositoryV1 #9326
magento-engcom-team pushed a commit that referenced this issue Nov 19, 2018
…der Items in salesOrderManagementV1 and salesOrderItemRepositoryV1 #9326
magento-engcom-team pushed a commit that referenced this issue Nov 19, 2018
…der Items in salesOrderManagementV1 and salesOrderItemRepositoryV1 #9326
magento-engcom-team pushed a commit that referenced this issue Nov 29, 2018
…der Items in salesOrderManagementV1 and salesOrderItemRepositoryV1 #9326

  - Extracted setting product options to separate class
  - Added product options setter for order items collection
  - Covered changed by API functional test
magento-engcom-team pushed a commit that referenced this issue Nov 29, 2018
…der Items in salesOrderManagementV1 and salesOrderItemRepositoryV1 #9326

  - Added product options merger
@magento-engcom-team
Copy link
Contributor

Hi @maultby.

Thank you for your report and collaboration!

The issue was fixed by Magento team. The fix was delivered into magento/magento2:2.3-develop branch(es).
Related commit(s):

The fix will be available with the upcoming 2.3.3 release.

@magento-engcom-team magento-engcom-team added the Fixed in 2.3.x The issue has been fixed in 2.3 release line label Jun 19, 2019
@philippta
Copy link

As mentioned in #9378

The constant KEY_PRODUCT_OPTION is defined as product_option, but the corresponding database field is named product_options (note the plural form).

This is still the case which means when requesting /V1/order/items/:id it does not return any product options. Is there anything I am missing?

@eastern-raviraj
Copy link

I am using the magento 2.3.5 but still I didnt see the product custom options in the response .
Can some one please confirm if this is fixed ?

@DaliTheCat
Copy link

DaliTheCat commented Jun 8, 2021

Any news on this? Both the orders/{order_id} and the orders/items/{item_id} return a list of option_values but they are keys to another table. It would be ideal to get the option string.

"product_option": {
    "extension_attributes": {
        "custom_options": [
            {
                "option_id": "491",
                "option_value": "3057" // This should be the option string to show.
            },
        ],
    },
},

Or is there another way of retrieving this info for each order items?

@webgility-amazonapi
Copy link

webgility-amazonapi commented Nov 22, 2021

Any update on product_option. We are also facing the same difficulty to get the product_option labels and selected values.
We are using Magento ver. 2.4.1.
In which version its fixed?
Magento team please answer ASAP

@mahmoud-abdelmalek
Copy link

2.4.3 still getting option id and option value ( id ) too
cannot retrieve option label or real option value (text) through order api

@mohammedTBB
Copy link

Still not getting product_options from the endpoint orders/items/{item_id} and orders/{order_id}
in magento 2.4.6-p4
Any fix for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Component: Framework/Webapi USE ONLY for FRAMEWORK RELATED BUG! E.g If bug related to Catalog WEB API use just Catalog Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release
Projects
None yet
Development

No branches or pull requests