I know this is an old thread, but I encountered the same problem. So in case you have the same issue:
This isn't really a commerce question, rather a general one.
There is a hook, where you can simple add new fields to an existing entity: HOOK_entity_base_field_info
So in this case:
/**
* Implements hook_entity_base_field_info().
*/
function yourmodule_entity_base_field_info(EntityTypeInterface $entity_type) {
if ($entity_type->id() === 'commerce_shipping_method') {
$fields['shipment_description'] = BaseFieldDefinition::create('string_long')
->setLabel(t('Description'))
->setDescription(t('The shipping method description.'))
->setRequired(FALSE)
->setTranslatable(TRUE)
->setSettings([
'default_value' => '',
'max_length' => 255,
])
->setDisplayOptions('form', [
'type' => 'string_textarea',
'weight' => 0,
])
->setDisplayConfigurable('view', TRUE)
->setDisplayConfigurable('form', TRUE);
}
}
This will add a simple textarea field type, but you can add any field type you like.
This will only add the field visually, you must also do an update to your database table. In a .install file, do something like this:
/**
* Implements hook_install().
*/
function hartmann_add_field_install() {
$entity_manager = \Drupal::entityManager();
$desc_definition = $entity_manager->getFieldStorageDefinitions('commerce_shipping_method')['shipment_description'];
$entity_manager->onFieldStorageDefinitionCreate($desc_definition);
}
/**
* Implements hook_uninstall().
*/
function hartmann_add_field_uninstall() {
$entity_manager = \Drupal::entityManager();
$desc_definition = $entity_manager->getLastInstalledFieldStorageDefinitions('commerce_shipping_method')['shipment_description'];
$entity_manager->onFieldStorageDefinitionDelete($desc_definition);
}
Then reinstall your module.
In more recent versions of Drupal 8, entitymanager is deprecated. I don't now the updated code for .install, but some research and you will find it.