1

i am trying to add extension attribute for Magento\Quote\Api\Data\AddressInterface but i am facing below issue.

Message: Property "Addressfiled" does not have corresponding setter in class "Magento\Quote\Api\Data\AddressExtensionInterface". 

Any one could you please provide solution for this.

4
  • Once you create an extension attribute the corresponding setter class will be set in "/generated/code/Magento/Quote/Api/Data/AddressExtension.php" file.. Check If your extenstion att.is set in this file else try after clearing the generated files.
    – Haritha
    Mar 5, 2018 at 7:43
  • my attribute not appearing in that file.
    – Ramesh
    Mar 5, 2018 at 7:52
  • 1
    Try clearing the generated files and check if the setter is autogenerated in interface and implementation classes.
    – Haritha
    Mar 5, 2018 at 8:18
  • Maybe you made a spelling mistake? Addressfiled -> addressfield Feb 13, 2021 at 13:58

1 Answer 1

1

Add the attribute to your extension_attributes.xml file:

<extension_attributes for="Magento\Quote\Api\Data\AddressInterface">
    <attribute code="attribute_code_here" type="string" />
</extension_attributes>

After adding it you will have to run:

bin/magento setup:di:compile 

Hope it works

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.