0

I have an order collection get out via API enter image description here

How can I change some value in API response via custom module enter image description here

5
  • Instead of changing existing attribute value , use extension_attribute for send additional data. Commented Oct 17, 2019 at 7:59
  • I already know how to send more data, my problem is how to change the existing attribute value.
    – MichaelHa
    Commented Oct 17, 2019 at 8:07
  • As far as I understand, you want change product_option.extension_attributes.custom_options.option_value ?
    – underser
    Commented Oct 17, 2019 at 8:23
  • exactly, do you have any idea?
    – MichaelHa
    Commented Oct 17, 2019 at 8:24
  • @MichaelHa Are you able to resolve this issue? Commented Dec 23, 2019 at 12:45

1 Answer 1

0

As far as I understand, this product_option.extension_attributes.custom_options.option_value it's a value that added via extension attributes.

In Magento 2 extension attributes are not magically saved to the database or populated, so based on this value above have to be added via plugin, observer or even rewrite.

The idea is to locate this logic which is responsible for filling that extension attribute and change as you want.

For example, if this is a plugin you can disable it via di, and create your own plugin which modifies the data.

2
  • Thank for the answer, Where does this value come from. how to find exactly.
    – MichaelHa
    Commented Oct 17, 2019 at 8:49
  • To help you with that, I need more information. Please update your answer: 1. Which REST endpoint you use? 2. Do you have any modules installed which are related to REST? 3. Which version of Magento you have?
    – underser
    Commented Oct 17, 2019 at 9:04

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.