You are here

function uc_fulfillment_menu_local_tasks_alter in Ubercart 8.4

Implements hook_menu_local_tasks_alter().

File

shipping/uc_fulfillment/uc_fulfillment.module, line 32
Organizes ordered products into packages and sets them up for shipment.

Code

function uc_fulfillment_menu_local_tasks_alter(&$data, $router_item, $root_path) {
  if ($root_path == 'admin/store/orders/%/shipments') {
    $order = $router_item['page_arguments'][0];
    $item = menu_get_item('admin/store/orders/' . $order
      ->id() . '/packages/new');
    if ($item['access']) {
      $data['actions']['output'][] = [
        '#theme' => 'menu_local_action',
        '#link' => $item,
      ];
    }
  }
}