You are here

function commerce_invoice_entity_type_alter in Commerce Invoice 8.2

Implements hook_entity_type_alter().

File

./commerce_invoice.module, line 23
Defines the Invoice entity and associated features.

Code

function commerce_invoice_entity_type_alter(array &$entity_types) {

  /** @var \Drupal\Core\Entity\EntityTypeInterface[] $entity_types */
  if (isset($entity_types['commerce_order'])) {
    $entity_types['commerce_order']
      ->setLinkTemplate('invoices', '/admin/commerce/orders/{commerce_order}/invoices');
    $entity_types['commerce_order']
      ->setLinkTemplate('credit-memos', '/admin/commerce/orders/{commerce_order}/credit-memos');
    $entity_types['commerce_order']
      ->setLinkTemplate('invoice-add-form', '/admin/commerce/orders/{commerce_order}/invoice/add/{commerce_invoice_type}');
  }
}