I've created a custom checkout pane according to documentation. When I submit my Order and go to admin page, where all my orders are listed, I can't see this custom pane field there. I've already tried to add $this->order->save();
at the end of submitPaneForm function but that seems to make no difference. I've already created field with machine name "field_test_me" in my Order type and also have added this field to enabled fields on "Manage display" tab, but the field seems to be empty.
Is there anything I'm missing to get my custom pane fields to be displayed on the "Order detail" page, please?
This is how my buildPaneForm function looks like:
public function buildPaneForm(array $pane_form, FormStateInterface $form_state, array &$complete_form)
{
$pane_form['billing_info'] = [
'#type' => 'fieldset',
'#title' => $this->t('@title', ['@title' => $this->configuration['title']]),
];
$pane_form['billing_info']['field_test_me'] = [
'#type' => 'textfield',
'#title' => 'Test me',
'#wrapper_attributes' => [
'class' => ['col-md-6']
],
'#default_value' => 'MY CUSTOM STRING'
];
return $pane_form;
}
And this is how my submitPaneForm function looks like:
public function submitPaneForm(array &$pane_form, FormStateInterface $form_state, array &$complete_form)
{
$values = $form_state->getValue($pane_form['#parents']);
$this->order->setData('field_test_me', $values['billing_info']['field_test_me']);
}
I'm using other functions for displaying value on "Review" page, but those are not part of my issue.