test
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • lancert Friend
    #202499

    Hi,

    Is it possible to set it so that if there are no options clicked by the user, JA K2 Filter will display a specific page rather than search results?

    For example: If a user clicks a few boxes and then unclicks everything, have it go back to my main products page rather than the search results page?

    Thanks!

    Lance

    Thanh Nguyen Viet Friend
    #554508

    Hello,

    JA K2 Filter does not have this option but you can update small code as follow to achieve that:

    – Open the file:
    components/com_jak2filter/models/itemlist.php

    – Find the code snippet below:
    [PHP]case ‘search’ :
    $badchars = array(‘#’, ‘>’, ‘<‘, ‘\’);
    $search = trim(str_replace($badchars, ”, JRequest::getString(‘searchword’, null)));
    $sql = $this->prepareSearch($search);
    if (!empty($sql))
    {
    $query .= $sql;
    }
    /*else
    {
    $result = 0;
    return $result;
    }*/
    break;[/PHP]

    And replace it with:
    [PHP]case ‘search’ :
    $badchars = array(‘#’, ‘>’, ‘<‘, ‘\’);
    $search = trim(str_replace($badchars, ”, JRequest::getString(‘searchword’, null)));
    $sql = $this->prepareSearch($search);
    if (!empty($sql))
    {
    $query .= $sql;
    }
    else
    {
    $app = JFactory::getApplication();
    $app->redirect(‘{your_url_here}’);
    }
    break;[/PHP]

    Where {your_url_here} is the page that you want to redirect user to

Viewing 2 posts - 1 through 2 (of 2 total)

This topic contains 2 replies, has 2 voices, and was last updated by  Thanh Nguyen Viet 10 years ago.

We moved to new unified forum. Please post all new support queries in our New Forum