Provide way to allow module to render the order fields their own way, such as in a table

Created on 10 June 2021, about 3 years ago
Updated 23 October 2023, 8 months ago

Problem/Motivation

By default with this module, you get a fieldset container with the order fields rendered basically inline, like so:

field1_name
field1_value

field2_name
field2_value

I've tried removing the fieldset, which I didn't want by adjusting the setting on the Order fields pane to "container", instead of "fieldset", but it did not affect it. I actually solved this by using a preprocess hook to change it to the container element.

That aside though, this output is not very pretty. It would be nice if this module allowed other modules to render the order fields in whatever way they wish.

Steps to reproduce

Install and configure this module, form and display settings, and checkout panes to make this module impact the checkout flow.
Notice during the Order Fields checkout pane step, that the fields are rendered in a very bare and bland fashion

Proposed resolution

Provide an alter hook during the building phase of ::buildPaneSummary() that would allow another module to take in those order fields and provide their own rendering mechanism, such as passing those items into a table to render the field name as left column and field value as right column.

Another possible solution that did not work for me, not sure why, is to use the Field Group Table module. Upon creating the field group, and placing the order fields into the field group with the table setting, the fields should render as a table, but they did not.

✨ Feature request
Status

Needs work

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States joshua.boltz

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.

  • Needs documentation

    A documentation change is requested elsewhere. For Drupal core (and possibly other projects), once the change has been committed, this status should be recorded in a change record node.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    Thanks @joshua.boltz this please needs an .api.php file for documentation and examples and a test. Happy to merge it then to allow further modifications, if there's no other way!

Production build 0.69.0 2024