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
When an Order has two address with matching address expect for the fullName, hasMatchingAddress returns true.
It looks like when getting the Address attributes for comparison it is looking for givenName and familyName however when calling toArray on the Address element it's returning the name parts as firstName and lastName.
Steps to reproduce
Create two address with the same fields except for the full name and use hasMatchingAddress
Expected behavior
hasMatchingAddress returns false when all but the full name matches.
Actual behavior
hasMatchingAddress returns true when all but the full name matches.
Craft CMS version
Craft Pro 4.1.4.1
Craft Commerce version
4.1.0
PHP version
No response
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
The text was updated successfully, but these errors were encountered:
Thank you for bringing this to our attention. We have pushed a fix for this which will be included in the next release of Commerce.
We are also looking to add to this feature in the upcoming 4.2 release that will allow developers to specify by which attributes addresses are determined as "matching". So for example you could decide that addresses do match if everything is the same but the names are different.
What happened?
Description
When an Order has two address with matching address expect for the fullName,
hasMatchingAddress
returns true.It looks like when getting the Address attributes for comparison it is looking for
givenName
andfamilyName
however when callingtoArray
on the Address element it's returning the name parts asfirstName
andlastName
.Steps to reproduce
hasMatchingAddress
Expected behavior
hasMatchingAddress
returnsfalse
when all but the full name matches.Actual behavior
hasMatchingAddress
returnstrue
when all but the full name matches.Craft CMS version
Craft Pro 4.1.4.1
Craft Commerce version
4.1.0
PHP version
No response
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
The text was updated successfully, but these errors were encountered: