7.x had the ability to prevent checkout when no shipping methods were available. This patch is an attempt to bring similar functionality to 8.x. Needs tests, which should be forthcoming.

Comments

bradjones1 created an issue. See original summary.

bojanz’s picture

Good idea! Thank you for working on this.

bradjones1’s picture

Status: Needs work » Needs review
StatusFileSize
new3.23 KB

Updated for the new version of Symfony in Drupal core.

nathaniel’s picture

#3 fixes illegal choice error when I do not have a default shipping method and click recalculate shipping after entering an address.

swickham’s picture

Status: Needs review » Needs work

Tested and it works fine.

One small nit, the doc comment needs to be formatted correctly to avoid a phpcs error, from

@inheritDoc

to

{@inheritdoc}
maticb’s picture

Status: Needs work » Needs review
StatusFileSize
new3.24 KB

I've tested the patch in #3, which is working fine :)

I've also added a new patch with a simple modification as mentioned by @swickham in #5.

andyg5000’s picture

Assigned: bradjones1 » Unassigned
Status: Needs review » Reviewed & tested by the community
andyg5000’s picture

Category: Task » Bug report
andyg5000’s picture

Status: Reviewed & tested by the community » Needs review

Jeeze, I really borked those metadata changes :)

bradjones1’s picture

Issue tags: +Needs tests

Still needs tests. :-/

smccabe’s picture

StatusFileSize
new7.03 KB

Now with tests!

Nils Loewen’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new6.94 KB
new673 bytes

This patch works great. The interdiff removes a pesky 'createScreenshot' in the test.

The less graceful and uninformative error 'An illegal choice...' that previously came up has been replaced by more helpful: 'There are no shipping rates available for this address.'

mglaman’s picture

Issue tags: -Needs tests

👍

rszrama’s picture

Status: Reviewed & tested by the community » Fixed

Thanks everyone, committing!

  • rszrama committed 2c9c4b7 on 8.x-2.x authored by bradjones1
    Issue #2861008 by bradjones1, nlz, smccabe, maticb, mglaman, Nathaniel,...

Status: Fixed » Closed (fixed)

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

3cwebdev’s picture

I'm using commerce_shipping 8.x-2.0-beta7 and have verified that this patch has been committed to it but for some reason it is not working.

In my tests I make a checkout order without any valid shipping methods. I do see the message in the shipping information pane that states:

"There are no shipping rates available for this address."

However, I am still allowed to complete my checkout without any further warnings and prevention.

I see in the patch that it looks like it should be preventing the checkout if no valid methods are found and display the following message:

"A valid shipping method must be selected in order to check out."

But this is not occuring. Any ideas why?

inwebsol’s picture

Priority: Normal » Major

@3CWebDev Did you find a solution to this in the end? I am facing this issue with version 8.x-2.1.

guy_schneerson’s picture

@3CWebDev and @inwebsol
I came across an edge case that may be related to the issue you experienced|: https://www.drupal.org/project/commerce_shipping/issues/3260362