You are here

function uc_quote_get_shipping_types in Ubercart 8.4

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

Returns an array of shipping types.

3 calls to uc_quote_get_shipping_types()
NewShipmentForm::buildForm in shipping/uc_fulfillment/src/Form/NewShipmentForm.php
Form constructor.
uc_quote_assemble_quotes in shipping/uc_quote/uc_quote.pages.inc
Pulls the get_quote_from_* triggers and assembles their returned data.
uc_quote_shipping_type_options in shipping/uc_quote/uc_quote.module
Returns an options array of shipping types.

File

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

Code

function uc_quote_get_shipping_types() {
  $args = [];
  $hook = 'uc_shipping_type';
  $return = [];
  $module_handler = \Drupal::moduleHandler();
  foreach ($module_handler
    ->getImplementations($hook) as $module) {
    $function = $module . '_' . $hook;
    $result = call_user_func_array($function, $args);
    if (isset($result) && is_array($result)) {
      $return = array_merge($return, $result);
    }
    elseif (isset($result)) {
      $return[] = $result;
    }
  }
  return $return;
}