You are here

function uc_quote_uc_cart_pane in Ubercart 8.4

Same name and namespace in other branches
  1. 7.3 shipping/uc_quote/uc_quote.module \uc_quote_uc_cart_pane()

Implements hook_uc_cart_pane().

@todo Replace with block implementation.

File

shipping/uc_quote/uc_quote.module, line 202
The controller module for fulfillment modules that process physical goods.

Code

function uc_quote_uc_cart_pane($items) {
  if (\Drupal::routeMatch()
    ->getRouteName() == 'uc_cart.cart') {
    $quote_config = \Drupal::config('uc_quote.settings');
    if (!$quote_config
      ->get('quotes_enabled') || $quote_config
      ->get('panes.delivery.settings.delivery_not_shippable') && !uc_cart_is_shippable()) {
      return [];
    }
    $body = \Drupal::formBuilder()
      ->getForm('uc_cart_pane_quotes', $items);
  }
  else {
    $body = '';
  }
  $panes['quotes'] = [
    'title' => t('Shipping quotes'),
    'enabled' => FALSE,
    'weight' => 5,
    'body' => $body,
  ];
  return $panes;
}