Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

house_number is required for some countries but the plugin is sending addressLine2 (which is sometimes empty and not usually a house number) #16

Closed
bleepsandblops opened this issue Jun 26, 2023 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@bleepsandblops
Copy link
Contributor

bleepsandblops commented Jun 26, 2023

Description

This line is sending the addressLine2 field instead of the Sendcloud 'house_number'
https://github.com/white-nl/commerce-sendcloud/blob/71754d24f57162d732c0c1ab30af05bebc4f3247/src/client/JouwWebSendcloudAdapter.php#L245C32-L245C32

Problem is on some countries (Switzerland is where I got the bug but there may be more), that field is required. So if the line 2 is empty, we're getting this back from sendcloud:
Screenshot 2023-06-26 at 12 29 25

And actually, there is a field for addressLine2 which currently is sending as blank:

A solution could be to extract the house number from the address Craft-side, and use that instead, + send address line 2 where it should be. Only thing is I feel like the extraction logic could potentially be quite tricky...

Steps to reproduce

Additional info

  • Craft version: 4.4.14
  • PHP version: 2.2.1
  • Database driver & version:
  • Plugins & versions: Commerce 4.2.11
@bleepsandblops bleepsandblops added the bug Something isn't working label Jun 26, 2023
@bleepsandblops
Copy link
Contributor Author

New problem with sending addressLine2 as house_number:
house_number: "Ensure this field has no more than 20 characters."

@WHITE-developer
Copy link
Contributor

Hi @bleepsandblops,
Thanks for reporting, we're going to look how we can best change this, to minimize braking changes.
Probably in combination with Webador/sendcloud#23

@WHITE-developer
Copy link
Contributor

3.0.0 is now released with the fix. Thank you for your patience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants