This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Implements hook_form_FORM_ID_alter() for 'field_config_edit_form'. | |
*/ | |
function datalayer_form_field_config_form_alter(&$form, FormStateInterface $form_state, $form_id) { | |
$field = $form_state->getFormObject()->getEntity(); | |
$form['third_party_settings']['datalayer']['label'] = [ | |
'#type' => 'textfield', | |
'#title' => t('DataLayer label'), | |
'#default_value' => $field->getThirdPartySetting('datalayer', 'label', $field->get('field_name')), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Implements hook_form_alter(). | |
*/ | |
function HOOK_form_alter(&$form, FormStateInterface $form_state, $form_id) { | |
if (in_array($form_id, ['commerce_tax_type_edit_form', 'commerce_tax_type_add_form'])) { | |
$form['commerce_conditions'] = [ | |
'#type' => 'commerce_conditions', | |
'#title' => t('Conditions'), | |
'#default_value' => [], |