Allow customizing the wrapper element and the display label for checkout panes

Created on 29 August 2024, 18 days ago
Updated 12 September 2024, 4 days ago

Describe your bug or feature request.

Currently, it is not possible to customize the "wrapper_element" specified in the plugin definition.
Changing the display label isn't possible either.

It would be nice to allow customizing those 2 settings from the UI, via checkout pane settings...
I believe we should allow the following wrapper elements (configurable from a select list):

  • Container
  • Fieldset
  • Details
  • Details (closed)
Feature request
Status

Fixed

Version

3.0

Component

User experience

Created by

🇮🇱Israel jsacksick

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @jsacksick
  • 🇮🇱Israel jsacksick

    So... the way we handle the Details (closed) option is kinda hackish, but not sure how to make this cleaner...
    Additionally, I'm wondering whether the display label we expose should only "Override" if filled? Basically, whether we should default to the plugin definition display label, or just output an empty text field?

  • 🇮🇱Israel jsacksick

    The opened MR is really just a first pass and seems to work :). Making this a "Release blocker" just to keep this issue visible, but this is more like a nice to have IMHO.

  • Status changed to Needs review 18 days ago
  • 🇮🇱Israel jsacksick

    Checkout settings UI:

    The billing information pane with an updated wrapper element (details):

  • Pipeline finished with Success
    18 days ago
    Total: 663s
    #268206
  • Pipeline finished with Success
    18 days ago
    Total: 544s
    #268235
  • Pipeline finished with Canceled
    18 days ago
    Total: 576s
    #268266
  • 🇮🇱Israel jsacksick

    Put the display label override behind a checkbox "Override the display label".
    Also, created a custom form element thus removing the need of mapping the wrapper element... called it "commerce_details_open", since the default details element is not opened by default.

  • 🇩🇪Germany Anybody Porta Westfalica

    Whaooo thank you, this is really nice! :)

    I'll review this one. And or course I'm absolutely fine with superseding Add option to make coupon code checkout pane collapsible (details) Needs review then! Impressive work and nice to also have the label overridable now!

  • Pipeline finished with Success
    18 days ago
    Total: 628s
    #268276
  • 🇩🇪Germany Anybody Porta Westfalica

    Yeah really nice one, just found one thing so far. BTW super nice "empty checkbox form states api"-combination pattern! Like it!

  • 🇮🇱Israel jsacksick

    Main thing I'm wondering right now is whether I should skip the non standard/default element (Details), which is basically the core "details" element, but with the #open attribute defaulting to TRUE, using a custom element defined by Commerce "commerce_details_open".

    Perhaps it is better to stick to the default elements and not introduce the custom one... thoughts?

  • Pipeline finished with Success
    18 days ago
    Total: 800s
    #268290
  • 🇩🇪Germany Anybody Porta Westfalica

    Well on the one hand, I think we need it, otherwise we'd need a further property for the #open => TRUE flag?
    On the other hand you'd need to use container if it should be open. But maybe that's enough (at least for now), I can't imagine a case where you really need a closable details element that's open by default...

    I'm fine with both decisions and think it's an edge-case at least.

    So YAGNI?

  • 🇮🇱Israel jsacksick

    So let's ditch the custom form element then... We have fieldset or container for that...
    I haven't really tested translability either, don't know if we need additional work on that front...

  • Pipeline finished with Canceled
    18 days ago
    Total: 331s
    #268345
  • Pipeline finished with Canceled
    18 days ago
    Total: 351s
    #268351
  • Pipeline finished with Canceled
    18 days ago
    Total: 127s
    #268354
  • Pipeline finished with Success
    18 days ago
    Total: 713s
    #268355
  • Pipeline finished with Skipped
    18 days ago
    #268383
  • Pipeline finished with Canceled
    18 days ago
    Total: 77s
    #268380
    • jsacksick committed a7825549 on 3.0.x
      Issue #3470982: Allow customizing the wrapper element and the display...
  • Pipeline finished with Canceled
    18 days ago
    Total: 77s
    #268382
  • Status changed to Fixed 18 days ago
  • 🇮🇱Israel jsacksick

    Decided to merge the MR, so it can be part of the Commerce 3.0.0-alpha1 release and we can get feedback before a full Commerce 3.0.0 release.

  • 🇩🇪Germany Anybody Porta Westfalica

    WHAO! Thank you SO much! You're genius :)
    I closed the other issue.

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

Production build 0.71.5 2024