- Issue created by @Renrhaf
- Merge request !46Issue #3465474 : Use a theme function to render the empty shipping rates text โ (Open) created by Renrhaf
- Issue was unassigned.
- Status changed to Needs review
4 months ago 2:28pm 2 August 2024 - ๐ฉ๐ชGermany Anybody Porta Westfalica
Great! We should combine this with ๐ Improve "no shipping rates" message. Needs review in one of both issues, I think.
I think instead of the
<p>
we should use a<div>
with a dedicated and a general (warning / error) class.Furthermore, we should decide for one of both issues to also discuss the other points mentioned over there in ๐ Improve "no shipping rates" message. Needs review .
This is the older issue, but due to the discussion and other points over there, I'd suggest to move the solution from here over and close this issue!
Please don't forget crediting @renrhaf!
- Status changed to Needs work
2 months ago 2:06pm 19 September 2024 - ๐ฉ๐ชGermany Grevil
From the other issue:
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?
- Merge request !49Issue #3465474: Use a theme function for rendering "there is no shipping rate" โ (Merged) created by Grevil
- ๐ฉ๐ชGermany Grevil
grevil โ changed the visibility of the branch 8.x-2.x to hidden.
- Status changed to Needs review
2 months ago 2:20pm 19 September 2024 - ๐ฉ๐ชGermany Grevil
Thanks, @Anybody! I used a bad example to implement the attributes. LGTM now!
<div class="commerce-shipping-no-shipping-rates" data-drupal-selector="edit-shipping-information-shipments-0-shipping-method-0"> Es sind keine Versandkosten fรผr diese Adresse verfรผgbar. </div>
- Status changed to RTBC
2 months ago 8:07am 20 September 2024 - ๐ฉ๐ชGermany Anybody Porta Westfalica
@grevil thanks! Could you provide a before / after screenshot perhaps?
Code-wise I think this is helpful and a lot more flexible than before! RTBC from my side. For further discussion:
It would be great to add a warning class, but I think also Olivero has no
warning
-styles outside of messages and I don't think it would be correct to add message markup here?Another thing I thought about is, if it might be helpful for any case to pass the
$shipment
variable to the twig file?Let's wait for maintainer feedback on this in general and these points.
- ๐ฉ๐ชGermany Grevil
Added the shipment entity to the theme, might make sense to get the title of the shipment or something along those lines.
- ๐ฉ๐ชGermany Anybody Porta Westfalica
Nice and thank you for the before / after screenshots! RTBC
- ๐ฎ๐ฑIsrael jsacksick
hm... I don't really see any difference between the before / after? Are we supposed to see any?
- ๐ฉ๐ชGermany Grevil
hm... I don't really see any difference between the before / after? Are we supposed to see any?
No not really! But it's easily overridable now. :)
- ๐ฎ๐ฑIsrael jsacksick
Not really RTBC, there are phpcs failures, tests are failing too with D11, but I don't think the failures are related.
- ๐ฉ๐ชGermany Grevil
Current changes don't contain anything that would violate the Drupal coding standards, the phpunit test seems very unrelated as well. I bet, if we rerun the pipeline on the current dev build, we get the same errors.
- ๐ฎ๐ฑIsrael jsacksick
Shouldn't we have a class name consistent with the theme function? (i.e. commerce-shipping-rates-empty?)
-
jsacksick โ
committed 53d1da3a on 8.x-2.x authored by
grevil โ
Issue #3465474: Use a theme function for rendering the no shipping rates...
-
jsacksick โ
committed 53d1da3a on 8.x-2.x authored by
grevil โ
Automatically closed - issue fixed for 2 weeks with no activity.