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
normal validation - works ok

Step 2: Valid address
Now change to an address that does have a shipping option available
normal validation - works ok

Step 3: Address with no shipping
Now change the address to one that does not have any shipping options.
normal validation - works ok

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

guy_schneerson created an issue. See original summary.

guy_schneerson’s picture

Issue summary: View changes
jsacksick’s picture

Good 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.

  • jsacksick committed bc01343 on 8.x-2.x
    Issue #3260362 by jsacksick, guy_schneerson: User can checkout with...
jsacksick’s picture

Status: Needs review » Fixed

Committed the patch from #3.

guy_schneerson’s picture

Status: Fixed » Needs review

Thanks @jsacksick that was quick :)

jsacksick’s picture

Though it seems that the tests are failing, so I need to figure out why :).

jsacksick’s picture

@guy_schneerson: Did you confirm the fix on your side?

guy_schneerson’s picture

just finished testing and works perfectly on my site.

  • jsacksick committed 86f9ebf on 8.x-2.x
    Issue #3260362 followup by jsacksick: Fix the failing tests.
    
jsacksick’s picture

Status: Needs review » Fixed

Marking this as fixed then!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.