netresearch / dhl-module-ui

Module for providing the presentation layer within the Magento application for custom functionality
Open Software License 3.0
3 stars 0 forks source link

Problem with initial state of parcel finder #6

Closed template-provider closed 3 years ago

template-provider commented 4 years ago

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 commented 4 years ago

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:

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.

template-provider commented 4 years ago

Hi, we are using Magento 2.4.1 with PHP 7.4.

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

Internal ref: DHLGW-1002

mam08ixo commented 3 years ago

Caused by #5