Problem/Motivation
The main issue with checkout when shipping rates are available with no was solved in #2861008: Do not continue checkout if no shipping rates available and this is an edge case relating to that issue.
The issue occurs if a user selects an address that has a valid shipping option and then changes his address to one that does not.
The first address causes a shipping line item to be created.
The second address does not have a valid shipping option but does not clear the shipping line item resulting in the user being able to continue to the review page with an invalid shipping option.
Steps to reproduce
Step 1: normal operation no issue:
select an address on a new order with an address that has no shipping available
Step 2: Valid address
Now change to an address that does have a shipping option available
Step 3: Address with no shipping
Now change the address to one that does not have any shipping options.
Comment | File | Size | Author |
---|---|---|---|
#3 | 3260362-3.patch | 5.13 KB | jsacksick |
#3 | 3260362-3-tests-only.patch | 1.81 KB | jsacksick |
shipping_3.png | 136.9 KB | guy_schneerson | |
shipping_2.png | 151.16 KB | guy_schneerson | |
shipping_1.png | 197.78 KB | guy_schneerson |
Comments
Comment #2
guy_schneerson CreditAttribution: guy_schneerson commentedComment #3
jsacksick CreditAttribution: jsacksick at Centarro commentedGood catch! Managed to reproduce the bug and updated the test to ensure we cover this usecase.
The JS changes are kind of unrelated, but figured out a regression was introduced as part of #3254957: Remove the JQuery dependency for the JS logic in checkout that I discovered while testing this with an Italian address, updating the province value wouldn't trigger the recalculation.
Comment #5
jsacksick CreditAttribution: jsacksick at Centarro commentedCommitted the patch from #3.
Comment #6
guy_schneerson CreditAttribution: guy_schneerson commentedThanks @jsacksick that was quick :)
Comment #7
jsacksick CreditAttribution: jsacksick at Centarro commentedThough it seems that the tests are failing, so I need to figure out why :).
Comment #8
jsacksick CreditAttribution: jsacksick at Centarro commented@guy_schneerson: Did you confirm the fix on your side?
Comment #9
guy_schneerson CreditAttribution: guy_schneerson commentedjust finished testing and works perfectly on my site.
Comment #11
jsacksick CreditAttribution: jsacksick at Centarro commentedMarking this as fixed then!