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

Created on 29 August 2024, 3 months ago
Updated 12 September 2024, 2 months 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 3 months ago
  • 🇮🇱Israel jsacksick

    Checkout settings UI:

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

  • Pipeline finished with Success
    3 months ago
    Total: 663s
    #268206
  • Pipeline finished with Success
    3 months ago
    Total: 544s
    #268235
  • Pipeline finished with Canceled
    3 months 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
    3 months 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
    3 months 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
    3 months ago
    Total: 331s
    #268345
  • Pipeline finished with Canceled
    3 months ago
    Total: 351s
    #268351
  • Pipeline finished with Canceled
    3 months ago
    Total: 127s
    #268354
  • Pipeline finished with Success
    3 months ago
    Total: 713s
    #268355
  • Pipeline finished with Skipped
    3 months ago
    #268383
  • Pipeline finished with Canceled
    3 months 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
    3 months ago
    Total: 77s
    #268382
  • Status changed to Fixed 3 months 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.

  • Pipeline finished with Canceled
    2 months ago
    #288424
  • Pipeline finished with Failed
    2 months ago
    Total: 438s
    #290518
  • Pipeline finished with Failed
    2 months ago
    Total: 424s
    #291712
  • Pipeline finished with Failed
    about 2 months ago
    Total: 501s
    #293671
  • Pipeline finished with Failed
    about 2 months ago
    Total: 450s
    #293674
  • Pipeline finished with Failed
    about 2 months ago
    Total: 430s
    #294956
  • Pipeline finished with Failed
    about 2 months ago
    Total: 593s
    #298178
  • Pipeline finished with Failed
    about 2 months ago
    Total: 907s
    #299414
  • Pipeline finished with Failed
    about 2 months ago
    Total: 443s
    #301090
  • Pipeline finished with Failed
    about 2 months ago
    #303510
  • Pipeline finished with Failed
    about 2 months ago
    Total: 409s
    #304412
  • Pipeline finished with Failed
    about 2 months ago
    Total: 432s
    #304431
  • Pipeline finished with Failed
    about 2 months ago
    Total: 497s
    #306613
  • Pipeline finished with Failed
    about 2 months ago
    Total: 609s
    #306705
  • Merge request !358Applied MR!324 on 2.x → (Open) created by Anybody
  • Pipeline finished with Failed
    26 days ago
    Total: 48s
    #325132
  • Pipeline finished with Failed
    26 days ago
    Total: 48s
    #325143
Production build 0.71.5 2024