You are here

function uc_stock_menu_links_discovered_alter in Ubercart 8.4

Implements hook_menu_links_discovered_alter().

File

uc_stock/uc_stock.module, line 39
Allow ubercart products to have stock levels associated with their SKU.

Code

function uc_stock_menu_links_discovered_alter(&$links) {

  // Remove uc_stock.reports link if the uc_report module is not enabled.
  // See https://www.drupal.org/node/2315801.
  // @todo Remove this hook when the above core issue is fixed.
  if (!\Drupal::moduleHandler()
    ->moduleExists('uc_report')) {
    unset($links['uc_stock.reports']);
  }
}