You are here

function commerce_purchase_order_theme_suggestions_commerce_order_receipt_alter in Commerce Purchase Order 8

Implements hook_theme_suggestions_HOOK_alter().

File

./commerce_purchase_order.module, line 81
Contains commerce_purchase_order.module..

Code

function commerce_purchase_order_theme_suggestions_commerce_order_receipt_alter(array &$suggestions, array $variables) {

  /** @var Drupal\commerce_order\Entity\OrderInterface $order */
  $order = $variables['order_entity'];
  $original = 'commerce_order_receipt';
  $suggestions[] = $original . '__' . 'purchase_order_gateway';
  if ($order instanceof OrderInterface) {
    $suggestions[] = $original . '__' . $order
      ->bundle() . '__' . 'purchase_order_gateway';
  }
}