You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since Craft Commerce no longer controls Addresses (they are a part of Craft CMS now), the model for Address changed. In doing so, the stateId / stateText field is no longer used.
You can read more on countries and states here.
It's my understanding that administrativeArea is now the appropriate field on the Address model for what most people consider a state / province. From the Craft CMS link above:
While Commerce has removed support for managing custom countries and states, the commerce/upgrade command prompts you to map the custom countries to real country codes, and copies the state abbreviation (if a custom state was created) or the stateName entered by the customer to the administrativeArea field on relevant addresses and zones.
So it looks like all we need to do is update $state = $this->getState($address); to be $state = $address->administrativeArea:
Hey Guys,
There's a bug with the address validation controller endpoint:
actions/avatax/json/validate-address
Before making your plugin compatible with Commerce v4, you had the following method inside of
SalesTaxService.php
:craft-avatax/src/services/SalesTaxService.php
Line 723 in 9c0a6c7
It's my understanding that
administrativeArea
is now the appropriate field on the Address model for what most people consider a state / province. From the Craft CMS link above:So it looks like all we need to do is update
$state = $this->getState($address);
to be$state = $address->administrativeArea
:craft-avatax/src/services/SalesTaxService.php
Line 759 in c497b63
The text was updated successfully, but these errors were encountered: