1

I create custom address attribute, same as suggested here: https://codeblog.experius.nl/magento-2-add-extra-billing-or-shipping-field-to-the-checkout/

But when I place an order there is error occurs:

Property "Example" does not have accessor method "getExample" in class "Magento\Quote\Api\Data\AddressExtensionInterface".

I know that this accessor must be in generated/code folder but it's empty there, I don't understand why it's not creating after I run di:compile. All other modules creating well.

This code must create it as well:

<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd">
    <extension_attributes for="Magento\Customer\Api\Data\AddressInterface">
        <attribute code="example" type="string"/>
    </extension_attributes>
</config>

Can you help, please?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.