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

[BUG] Inserting a valid postcode doesn't always return an address #50

Closed
jeroen-dhm opened this issue Sep 22, 2022 · 5 comments
Closed

Comments

@jeroen-dhm
Copy link

To Reproduce
Steps to reproduce the behavior:

  1. Go to a checkout page
  2. Enter a valid postcode
  3. Wait for validation

Expected result
A valid postcode should always return a street and city and place them in the corresponding field. The address and city fields should become visible for the end user.

Actual result
No address is being returned and an error is being displayed, telling the end user that the address is invalid and they have to manually enter an address. The street field is visible, but the city fields stays hidden.

After changing the postcode (for example from lowercase to uppercase) a second check is done, which does return a street and city. The street field is being field with the data returned from the API, but the city field stays hidden.

When going to the payment step, the city is empty as well, rendering an error for the user.

Workaround
None

Screenshots
Screenshot_20220922-111757_Samsung Internet

Please complete the following information

  • Magento version: 2.4.3-p1
  • PHP version: 7.4.28
  • Extension version: 1.5.1

Additional information

In some cases the module returns a PHP error. However, these error do seem related to the problem, since they don't happen at the same moment the end user is in the checkout. I'm still including the error here, because maybe this is still related.

TypeError: Argument 5 passed to TIG\Postcode\Plugin\Checkout\Model\GuestPaymentInformationManagement::beforeSavePaymentInformation() must be an instance of Magento\Quote\Api\Data\AddressInterface, nul
l given, called in /data/web/magento2/vendor/magento/framework/Interception/Interceptor.php on line 121 and defined in /data/web/magento2/vendor/tig/postcode-magento2/Plugin/Checkout/Model/GuestPaymentInformationManagement.php:62
Stack trace:
#0 /data/web/magento2/vendor/magento/framework/Interception/Interceptor.php(121): TIG\Postcode\Plugin\Checkout\Model\GuestPaymentInformationManagement->beforeSavePaymentInformation()
#1 /data/web/magento2/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Checkout\Model\GuestPaymentInformationManagement\Interceptor->Magento\Framework\Interception\{closure}()
#2 /data/web/magento2/generated/code/Magento/Checkout/Model/GuestPaymentInformationManagement/Interceptor.php(32): Magento\Checkout\Model\GuestPaymentInformationManagement\Interceptor->___callPlugins()
#3 [internal function]: Magento\Checkout\Model\GuestPaymentInformationManagement\Interceptor->savePaymentInformation()
#4 /data/web/magento2/vendor/magento/module-webapi/Controller/Rest/SynchronousRequestProcessor.php(95): call_user_func_array()
#5 /data/web/magento2/vendor/magento/module-webapi/Controller/Rest.php(188): Magento\Webapi\Controller\Rest\SynchronousRequestProcessor->process()
#6 /data/web/magento2/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Webapi\Controller\Rest->dispatch()
#7 /data/web/magento2/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Webapi\Controller\Rest\Interceptor->___callParent()
#8 /data/web/magento2/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Webapi\Controller\Rest\Interceptor->Magento\Framework\Interception\{closure}()
#9 /data/web/magento2/generated/code/Magento/Webapi/Controller/Rest/Interceptor.php(23): Magento\Webapi\Controller\Rest\Interceptor->___callPlugins()
#10 /data/web/magento2/vendor/magento/framework/App/Http.php(116): Magento\Webapi\Controller\Rest\Interceptor->dispatch()
#11 /data/web/magento2/generated/code/Magento/Framework/App/Http/Interceptor.php(23): Magento\Framework\App\Http->launch()
#12 /data/web/magento2/vendor/magento/framework/App/Bootstrap.php(264): Magento\Framework\App\Http\Interceptor->launch()
#13 /data/web/magento2/pub/index.php(29): Magento\Framework\App\Bootstrap->run()
#14 {main} [] []
@tig-jeffreybranderhorst
Copy link
Contributor

Hi @jeroen-dhm ,

I have set up a new Magento with the same versions you are using and tried it multiple times, in my browser but also on mobile because the screenshot was mobile. But I cannot reproduce this, and we haven't heard this before that is happens with existing postcodes + house numbers. If it is steady reproducible on your environment we would like to investigate this further in your environment, could you mail us at support@tig.nl, so we can investigate the issue further.

Have a great day,
Jeffrey

@jeroen-dhm
Copy link
Author

Hi @tig-jeffreybranderhorst,

I have sent an e-mail, but I haven't heard back yet.

For now I have found out that it has got something to do with autocomplete on Android phones. The autocomplete feature adds a trailing space to the postcode, which isn't being trimmed out when validating.

Any updates on fixing this validation bug?

@tig-jeffreybranderhorst
Copy link
Contributor

Hey @jeroen-dhm ,

Did you receive an issue number from the support system? Thank you for the update, I will talk about the android bug with the team and come back with an answer.

Have a great day,
Jeffrey

@tig-jeffreybranderhorst
Copy link
Contributor

Hi @jeroen-dhm ,

I have created a backlog issue for the autocomplete bug to see if we can fix this.
Thank you again for submitting.

Have a great day,
Jeffrey

@tig-jeffreybranderhorst
Copy link
Contributor

Hi @jeroen-dhm ,

We just released a new version, and we fixed this issue in that version.
If you still got question after updating the extension, don't hesitate to contact us at support@tig.nl

Have a great day,
Jeffrey

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants