Back to PhocacartRoute class

Method isFilterActive

public static
isFilterActive
()

Method isFilterActive - Source code

public static function isFilterActive()
{
    $app = Factory::getApplication();
    $option = $app->input->get('option', '', 'string');
    $view = $app->input->get('view', '', 'string');
    if ($option == 'com_phocacart' && $view == 'items') {
        $id = $app->input->get('id', '', 'int');
        // ID in items view is category id
        if ((int) $id > 0) {
            return true;
            // some filter is active
        }
    }
    $p = PhocacartUtilsSettings::getListFilterParams();
    if (!empty($p)) {
        foreach ($p as $k => $v) {
            $value = $app->input->get($v, '', 'string');
            if ($value != '') {
                return true;
                // some filter is active
            }
        }
    }
    return false;
}