You are here

function uc_catalog_preprocess_link in Ubercart 7.3

Implements hook_preprocess_link().

Rewrites taxonomy term links to point to the catalog.

File

uc_catalog/uc_catalog.module, line 222
Ubercart Catalog module.

Code

function uc_catalog_preprocess_link(&$vars) {

  // Link back to the catalog and not the taxonomy term page.
  if (isset($vars['options']['entity_type']) && $vars['options']['entity_type'] == 'taxonomy_term') {
    $term = $vars['options']['entity'];
    if ($term->vid == variable_get('uc_catalog_vid', 0)) {
      $vars['path'] = uc_catalog_path($term);
    }
  }
}