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

Problem with initial state of parcel finder #6

Closed
template-provider opened this issue Oct 30, 2020 · 10 comments
Closed

Problem with initial state of parcel finder #6

template-provider opened this issue Oct 30, 2020 · 10 comments
Labels
bug Something isn't working

Comments

@template-provider
Copy link

We have a problem with initial state of the parcel finder.
If we go to checkout, we have selected a "default country "Deutschland".
The block with the shipping options is loaded but WITHOUT the parcel finder.
This problem may be the same regarding the issue before netresearch/dhl-shipping-m2#12

  1. Product in Basket and proceed to checkout
    => Parcel finder is not visible and Country is "Deutschland"
    Bildschirmfoto vom 2020-10-30 14-21-45
  2. Switch to country other than germany
    => Block is reloaded without parcel finder ... correct
    Bildschirmfoto vom 2020-10-30 14-22-44
  3. Switch back to "Deutschland"
    => Block is reloaded wit parcel finder ... correct
    Bildschirmfoto vom 2020-10-30 14-23-28

I think the initial state/event is missing. The event for showing/reloading the block should be triggered after the page is loaded
and not only by changes from the country.
Greetings
Jan

@ngolatka
Copy link

ngolatka commented Nov 3, 2020

Hello @template-provider , I tried to duplicate your issue, but I don't see it. For me, things look ok.

What I did is this:

  • enable only DHL Shipping for checkout, no other shipping methods
  • set default country to Germany
  • put something in the cart and go to checkout
  • scroll down to see the shipping method -> the entire DHL block is not visible yet
  • start entering my name -> the AJAX spinner appears and the DHL block becomes visible
  • whenever I changes something in my address

No switching of the country was necessary for me. As soon as the DHL block was visible, the button "Find Parcel Station" was always in it.

Tested on M2.3.5 with DHL module 1.2.0

I see a call to "estimate-shipping-methods" in the network tab of the browser dev-tools when I change the city or something.

  • Does that not happen in your case?
  • Can anyone else confirm this issue (or confirm that it works)?

@template-provider
Copy link
Author

template-provider commented Nov 8, 2020

Hi,
we are using Magento 2.4.1 with PHP 7.4.

  • enable only DHL Shipping for checkout, no other shipping methods
  • set default country to Germany
  • put something in the cart and go to checkout
    but then
  • scroll down to see the shipping method -> the entire DHL block is visible, but without the parcel finder.

like the first screenshot from my comment before
Bildschirmfoto vom 2020-10-30 14-21-45
I wasnt actually aware, that the dhl block should not be shown at start

@mam08ixo
Copy link
Contributor

mam08ixo commented Nov 9, 2020

I can only guess that the wrong country is used to load service data although "DE" is selected in UI. To validate, please

  1. remove the dhl_shipping_data_storage entry from local storage
  2. refresh the checkout page
  3. monitor the request payload to dhl/checkout-data/get
  4. let us know what you see

01-local_storage
02-network

@template-provider
Copy link
Author

Hi,
the payload is:

{"countryId":"DE","postalCode":"64331"}

but the parcel finder is not active.
You can check it yourself directly on our website: https://shop.icletta.com

@template-provider
Copy link
Author

Another thing is strange. I can change the country to BR (get call is triggered) and change back to DE (no call is triggered ... caching of the response before?), but after changing to DE the parcel finder is active (as mentioned in comments above)

@mam08ixo
Copy link
Contributor

Thank you for the link to the website, that was helpful.

It appears that you have set a default postal code for tax calculation in checkout.

Stores → Configuration → Sales → Tax → Default Tax Destination Calculation → Default Post Code

When you clear that field (and config cache, local storage entry), then everything should work as designed (service box loads after address data was entered). In my understanding, the default postal code is not necessary for tax calculation in Germany.

We may further investigate why the location finder is not displayed with default postal code configured, but the workaround should get you going for now. Please let us know about the result, thanks!

@template-provider
Copy link
Author

Hi,
thx .... this change seems to work, now the dhl service box is loaded after any address data was entered.
Should I close the issue or keep it open?

We may further investigate why the location finder is not displayed with default postal code configured, but the workaround should get you going for now. Please let us know about the result, thanks!

@mam08ixo
Copy link
Contributor

I am about to create a ticket in our internal issue tracker. As the original issue is worked around via store configuration, I close it here.

@ngolatka
Copy link

Internal ref: DHLGW-1002

@mam08ixo mam08ixo transferred this issue from netresearch/dhl-shipping-m2 Feb 1, 2021
@mam08ixo
Copy link
Contributor

mam08ixo commented Feb 1, 2021

Caused by #5

@ngolatka ngolatka added the bug Something isn't working label Feb 2, 2021
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

3 participants