Display 'default_step' property of @CommerceCheckoutPane plugins in administration

Created on 28 August 2024, 3 months ago
Updated 19 September 2024, about 2 months ago

Problem/Motivation

@CommerceCheckoutPane plugins have a 'default_step' property, see https://docs.drupalcommerce.org/v2/developer-guide/checkout/checkout/

/**
 * Provides a custom message pane.
 *
 * @CommerceCheckoutPane(
 *   id = "my_checkout_pane_custom_message",
 *   label = @Translation("Custom message"),
 *   display_label = @Translation("Another display label"),
 *   default_step = "_sidebar",
 *   wrapper_element = "fieldset",
 * )
 */

In many cases this default step has technical implications and should not be changed or may result in weird behavior. Restoring is not easy then and you don't know where the pane originally belonged without looking into code or sth. like that.

Steps to reproduce

Move a checkout pane into a region where it makes no sense, but it's not obvious.

Proposed resolution

For that reason I'd suggest do print the default_step beside the label, for example <small>Default step: order_information</small> or something like that.

Future considerations:

  • Maybe a future step could then be to add an "allowed_steps" property which takes an array of all steps where the pane makes sense, validated on safe. But this is already an important first step for improving the UX / SX with just a little change.
  • Another future step might be to add a "Reset" button, if it was moved out of the default step
  • Allow admin_description for @CommerceCheckoutPane plugins RTBC is also related as it could provide more details.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Feature request
Status

Needs work

Version

3.0

Component

Checkout

Created by

🇩🇪Germany Anybody Porta Westfalica

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024