Problem/Motivation

Currently, if there are no valid shipping rates (no shipping method conditions apply). A simple markup text is returned:

There are no shipping rates available for this address.

This is displayed as simple markup, and there is currently no way to easily apply custom styling to it. Also there is no default styling, while this should typically look at least like a warning, as it's important information (and the reason why you may not proceed!).

Furthermore the Drupal error message, if you try to proceed is not self-explaining:

1 error has been found: Shipping method

Steps to reproduce

Proposed resolution

Use a proper render element and give it some easily identifiable class.

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#5 commerce error shipping method.png5.05 KBanybody
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

grevil created an issue. See original summary.

grevil’s picture

Status: Active » Needs review

Done, please review!

anybody’s picture

Thanks @Grevil, I agree that this is currently a bit confusing. Would be even better to also adjust the Drupal form message (empty required field) if no shipping method matches.

Maybe we should even allow defining a configurable fallback message for that case as a setting, so that shop owners can explain the potential reasons in this case instead of a hard-coded message?

Let's wait for Centarro feedback on that.

Regarding the class: I think it would make sense to add a context class like you did, and also add a Drupal error or warning message class to show the message appropriately by default.

I'm unsure if such a class exists, or if that means we'd have to use something like the message's markup?

@jsacksick what are your thoughts here?

anybody’s picture

Issue summary: View changes
StatusFileSize
new5.05 KB
anybody’s picture

grevil’s picture

Status: Needs review » Closed (duplicate)
grevil’s picture

Status: Closed (duplicate) » Active
grevil’s picture

Status: Active » Closed (duplicate)