cancel
Showing results for 
Search instead for 
Did you mean: 

custom address attribute - setters and getters

custom address attribute - setters and getters

Hi,

following this:

https://codeblog.experius.nl/magento-2-add-extra-billing-or-shipping-field-to-the-checkout/

I am trying to add a custom attribute to customers addresses, I can see it appearing for example when I do checkout, but when I try to save I get this exception:

 main.CRITICAL: LogicException: Property "Taxcode" does not have corresponding setter in class "Magento\Quote\Api\Data\AddressExtensionInterface". in /var/www/coronelli/vendor/magento/framework/Reflection/NameFinder.php

and in fact, when they say:

"

Checkpoint 2: The following files are generated

var/generation/Magento/Quote/Api/Data/AddressExtension.php
var/generation/Magento/Quote/Api/Data/AddressExtensionInterface.php

It should contain getters and setters for your address attribute. In this case. setExample(), getExample()"

I have the classes inside that folder but getters and setters are not there.

Any help?

thanks

2 REPLIES

Re: custom address attribute - setters and getters

@agiorgini

Could you post your code for module, which you have tried till now?

 

Thanks.

If Issue Solved, Click Kudos/Accept As solutions.

Re: custom address attribute - setters and getters

hello,

 

this is quite a lot of code, so you can find it here: https://ufile.io/rwqlk

 

thanks!