Custom checkout pane for order comments not saving I've created a custom checkout pane for commerce 2.x, Drupal version 8.7.x. I've added a textfield called field_order_notes on the order entity. The pane works, and I can run
$this-&gt;order-&gt;set('field_order_notes', $values) in my pane's submit handler, and I can debug the order object and see the value's set. But when i finish the order,  field_order_notes is empty on the order. Not sure what I'm missing here.

 /**
 * Adds a section for order notes.
 *
 * @CommerceCheckoutPane(
 *   id = "order_notes",
 *   label = @Translation("Order notes"),
 *   default_step = "order_information",
 * )
 */
class OrderNotes extends CheckoutPaneBase implements CheckoutPaneInterface {
  /**
   * The inline form manager.
   *
   * @var \Drupal\commerce\InlineFormManager
   */
  protected $inlineFormManager;
  /**
   * {@inheritdoc}
   */
  public function __construct(array $configuration, $plugin_id, $plugin_definition, CheckoutFlowInterface $checkout_flow, EntityTypeManagerInterface $entity_type_manager) {
    parent::__construct($configuration, $plugin_id, $plugin_definition, $checkout_flow, $entity_type_manager);
  }
  /**
   * {@inheritdoc}
   */
  public function buildPaneForm(array $pane_form, FormStateInterface $form_state, array &amp;$complete_form) {
    $pane_form['order_notes'] = [
      '#type' =&gt; 'textarea',
      '#title' =&gt; $this-&gt;t('Order notes'),
      '#default_value' =&gt; $this-&gt;order-&gt;get('field_order_notes')-&gt;getString(),
      '#required' =&gt; FALSE,
    ];
    return $pane_form;
  }
  /**
   * {@inheritdoc}
   */
  public function submitPaneForm(array &amp;$pane_form, FormStateInterface $form_state, array &amp;$complete_form) {
    $values = $form_state-&gt;getValue($pane_form['#parents']);
    $this-&gt;order-&gt;set('field_order_notes', $values);
  }
}
This was fixed by passing ['order_notes'] into $values.

 /**
   * {@inheritdoc}
   */
  public function submitPaneForm(array &amp;$pane_form, FormStateInterface $form_state, array &amp;$complete_form) {
    $values = $form_state-&gt;getValue($pane_form['#parents']);
    $this-&gt;order-&gt;set('field_order_notes', $values['order_notes']);
  }