Back to PhocacartRoute class

Method getCategoryRoute

public static
getCategoryRoute
(mixed $catid, mixed $catidAlias = '', mixed $lang = array())

Method getCategoryRoute - Source code

public static function getCategoryRoute($catid, $catidAlias = '', $lang = array())
{
    $pC = PhocacartUtils::getComponentParameters();
    $skip_category_view = $pC->get('skip_category_view', 0);
    if ($skip_category_view == 1) {
        return self::getItemsRoute('', '', 'c', (int) $catid . '-' . $catidAlias);
    }
    $app = Factory::getApplication();
    $menu = $app->getMenu();
    $active = $menu->getActive();
    $option = $app->input->get('option', '', 'string');
    $view = $app->input->get('view', '', 'string');
    $activeId = 0;
    if (isset($active->id)) {
        $activeId = $active->id;
    }
    if ((int) $activeId > 0 && $option == 'com_phocacart' && $view == 'category') {
        $needles = array('category' => (int) $catid, 'categories' => (int) $activeId);
    } else {
        $needles = array('category' => (int) $catid, 'categories' => '');
    }
    if ($catidAlias != '') {
        $catid = $catid . ':' . $catidAlias;
    }
    $link = 'index.php?option=com_phocacart&view=category&id=' . $catid;
    return self::_buildLink($link, $needles, $lang);
}