nerdexam
Adobe

AD0-E716 · Question #16

An Adobe Commerce developer was asked to provide additional information on a quote. When getting several quotes, the extension attributes are returned, however, when getting a single quote it fails…

The correct answer is A. The developer neglected to add coiiection="trueM to their attribute in. The extension attributes are missing because the collection="true" attribute is not set in the etc/extension_attributes.xmi file. This attribute tells Magento that the extension attributes should be returned when the quote is retrieved. To fix this issue, the developer needs to…

Troubleshooting

Question

An Adobe Commerce developer was asked to provide additional information on a quote. When getting several quotes, the extension attributes are returned, however, when getting a single quote it fails to be returned. What is one reason the extension attributes are missing?

Options

  • AThe developer neglected to add coiiection="trueM to their attribute in
  • BThe developer neglected to provide a plugin On Hagento\Quote\Api\CartRepositoryInterface:
  • CThe developer neglected to implement an observer on the coiiection_ioad_after event.

How the community answered

(48 responses)
  • A
    71% (34)
  • B
    21% (10)
  • C
    8% (4)

Explanation

The extension attributes are missing because the collection="true" attribute is not set in the etc/extension_attributes.xmi file. This attribute tells Magento that the extension attributes should be returned when the quote is retrieved. To fix this issue, the developer needs to add the collection="true" attribute to the my_attributes extension attribute. <attribute code="my_attributes" type="MyVendor\MyModule\Api\Data\AttributeInterface[]" Once the collection="true" attribute is set, the extension attributes will be returned when the quote

Topics

#extension attributes#quote#collection attribute#CartRepository

Community Discussion

No community discussion yet for this question.

Full AD0-E716 Practice