Introduction: For this test, I’m using the Carrier Service API, which randomly generates shipping methods. Ultimately, our application returns shipping methods based on the customer’s address (pickup points).
The randomly generated shipping methods are structured as follows:
[
'rates' => [
[
'service_name' => 'Shipping name: '.rand(1, 100),
'service_code' => 'shipping-name:'.rand(1, 100),
'total_price' => 1000,
'currency' => 'PLN',
],
// repeated 5 times with different random values
],
]
Issue Description: The bug occurs when selecting a shipping method during checkout:
- Upon entering checkout with empty address fields, the shipping method selection initially shows no options:
- After entering address details, the API returns random shipping methods:
By default, the first option (Shipping name: 24
) is selected.
3. I manually choose a different shipping method (Shipping name: 8
).
4. I realize I made a typo in the postal code and another address field, so I correct these details.
5. The system recalculates, and the Carrier Service API returns a new set of shipping methods:
A new shipping method (Shipping name: 50
) is now selected by default, although it wasn’t previously listed.
6. I do not notice this change and proceed to complete the order.
Expected Behavior: When the Carrier Service API returns different shipping methods than previously selected, the customer should be required to explicitly select the shipping option again. The system must not automatically change the previously chosen shipping method, as our customers report that end-users frequently do not notice this automatic switch and complete orders mistakenly believing their initial choice remains.
Suggested Solution: After recalculating and receiving a new list of shipping methods, the previously selected option should be cleared, requiring explicit user selection again.
Thank you!
Video: https://youtu.be/Y9NU2gbqrsY