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)

Issue fork commerce-3470982

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

jsacksick created an issue. See original summary.

jsacksick’s picture

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?

jsacksick’s picture

Issue tags: +Release blocker, +Needs tests

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.

jsacksick’s picture

Status: Active » Needs review
StatusFileSize
new187.21 KB
new87.22 KB

Checkout settings UI:

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

jsacksick’s picture

StatusFileSize
new29.63 KB

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.

anybody’s picture

Whaooo thank you, this is really nice! :)

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

anybody’s picture

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

jsacksick’s picture

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?

anybody’s picture

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 could just 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?

jsacksick’s picture

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...

  • jsacksick committed a7825549 on 3.0.x
    Issue #3470982: Allow customizing the wrapper element and the display...

jsacksick’s picture

Status: Needs review » Fixed

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.

anybody’s picture

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

Status: Fixed » Closed (fixed)

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