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
| Comment | File | Size | Author |
|---|
Issue fork commerce_shipping-3473333
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
Comment #3
grevil commentedDone, please review!
Comment #4
anybodyThanks @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?
Comment #5
anybodyComment #6
anybodyComment #7
grevil commentedClosed in favor of #3465474: Use a theme function for rendering "there is no shipping rate".
Comment #8
grevil commentedComment #9
grevil commented