Calculation fails for Austria (4-digit)

Created on 22 December 2024, about 1 month ago

Problem/Motivation

No applicable shipping rates for the following partial address: (Country code: AT, Postal code: 6200).

Example failing postal codes: 7111, 6200

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇩🇪Germany Anybody Porta Westfalica

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @Anybody
  • First commit to issue fork.
  • 🇩🇪Germany Grevil

    I can't reproduce this issue, but I DO get a validation error, but a different one:

    Postal code field is not in the right format.

    But that issue would be a https://www.drupal.org/project/address issue instead.

    See

  • 🇩🇪Germany Anybody Porta Westfalica

    @grevil this is the wrong area (the zip code input you're looking for is below the cart on /cart!)
    And I can't see you selected a country in the screenshot.

  • 🇩🇪Germany Grevil

    Whoops, my apologies.

    But I can not reproduce this issue at all.

    My suspicion is, that this has something to do with the fake_order / fake_shipments, commerce_cart_estimate creates in their estimate method.

    It basically duplicates the current order and saves it as "fake_order" and packs it through the shipping order manager, resulting in a "fake_shipments" array. Later it goes through the fake shipments and individually calculates their rates and if the resulting "rates" array is empty, the error is thrown:

    No applicable shipping rates for the following partial address: (Country code: %s, Postal code: %s).

    (See Line 114 and following in "src/Estimator.php")

    But at least in our project this error only occurs for Austrian customers, which is quite weird. But since this isn't reproducible, we should postpone this issue, until we gather more information.

  • 🇩🇪Germany Grevil

    Ok. @Anybody and I just took a deeper look at this, but we still couldn't find the reason. The error didn't lead to an order cancellation. The customer still bought the products. We tracked down the order and tried to replicate everything he did and more, but this didn't lead to anything. Everything worked as expected.

    @Anybody agrees, that the error probably has something todo with the "fake_shipments" array. We adjusted the code internally, to also dump the "fake_shipment" and "fake_shipments" amount. This will give us more insights, once it happens again.

  • 🇩🇪Germany Anybody Porta Westfalica

    I can confirm we were not able to reproduce this, despite having ~20-30 entries in the logs showing this error. Interesting... Let's see if the log entry can tell us more in the future.

Production build 0.71.5 2024