Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • radisnoir Friend
    #980133

    I downloaded JA K2 Filter and Search component for one of my client website (here is the url to the page where i used the ja k2 filter and search http://voyagedelegende.fr/destinations-voyages-organises-sur-mesure/voyage-sur-mesure-polynesie) as you will notice on this page in the search area there are three groups of checkboxes "Archipel de la Societé","Archipel des Tuamotu" and "Archipel des Marquises" basically these (Archipel de la Societé,Archipel des Tuamotu,Archipel des Marquises) are different extra fields, when i select for example "Bora Bora" and "Tahiti" from the group Archipel de la Societé it will search in the category "bora bora" OR "Tahiti", which is good but when i select for example "Bora Bora" from the group "Archipel de la Societé" and "Ahe" from the "Archipel des Tuamotu" group it will search in the category "bora bora" AND "Ahe" and if one of these categories have 0 items then it will display no results found (in this test case Ahe have 0 item so it will not even show the items of the Bora bora) which is the realy problem (it should search through OR instead of AND incase of different extra fields), i went through the code but i could not solve it, so i finally come here to seek your help,
    so can you help me in this regard? or drive me into right direction please ?

    Thank you

    Mo0nlight Moderator
    #980415

    Hi.

    You can do it by edit the file :
    components/com_jak2filter/models/itemlist.php.

    Find the line 1463

    $matchTypes = $config->get('extra_fields_search_mode', array());

    Add this above:
    $whereextrafield = array();

    Find and replace all:

    $where[] = "(i.extra_fields REGEXP '".$searchPattern."')";

    To:
    $whereextrafield[] = "(i.extra_fields REGEXP ‘".$searchPattern."’)";

    Finally:
    Look for:

    $sql .= empty($where) ? '' : ' AND ' . implode(' AND ', $where);

    Add this above.

    if (!empty($whereextrafield))
                $where[] = implode(' OR ', $whereextrafield);

    Regards.

    radisnoir Friend
    #980543

    Thank you for your response indeed i was doing modification in the same block of the same page, i applied the changes you recommend and it produces search results when i select bora bora and ahe but the problem is now that it is fetching from all the categories where in the module configuration in the back office i set only two categories , so please can you guide me more how i can acheive this?

    Thanks

    Mo0nlight Moderator
    #981227

    Hi,

    I access your link but can not find the filter anywhere.

    And for your information the category settings in module configuration only provides option to show/hide the category filter option. It does not relate to search result if the option does not show in the front end module.

    If the category filter option not show up then it will depend on the category you take in menu configuration.

    Regards

    radisnoir Friend
    #982000

    Hello,

    i am sorry for the link, the link got changed by for the seo purpose, here is the new link
    http://voyagedelegende.fr/vacances-a-la-carte/vacances-en-polynesie,

    then what should be done to get search result from just two categories not all categories?

    Thank you

    Mo0nlight Moderator
    #983130

    Hi.

    You can edit the categories in menu configuration.

    Like in the image.

    Regards.


    1. Screen-Shot-2016-11-03-at-4.27.35-PM
    radisnoir Friend
    #985227

    Hello,
    indeed i add "Polynésie" of only "Croisières" and "Voyage " categories but in the front office when you go to "Nos Destinations / Polynésie" and check "Bora Bora and Ahe" from the chek box, on the second page of the search result it fetches the item from the other two categories that i did not put in the menu configuration "Activity and Hotels"

    we are really stuck in the project just because of this thing, can you have a look at it please?

    Thank you

    Mo0nlight Moderator
    #985532

    Hi.

    I go to the link : http://voyagedelegende.fr/vacances-a-la-carte/vacances-en-polynesie,

    And the filter is missing again.

    Please change it back.

    Regards.

    radisnoir Friend
    #986909

    Hello,

    sorry again for the inconvenience i am sending the link to our development site, its link will never change
    http://vdl.radisnoir.site/destinations-voyages-organises-sur-mesure/voyage-sur-mesure-polynesie

    Thanks

    Mo0nlight Moderator
    #988473

    Hi,

    The query is running normally. On the second page, you have some extra items with "ahe" value on them.

    Just remove the value.

    Regards


    1. Screen-Shot-2016-11-22-at-2.45.46-PM
Viewing 10 posts - 1 through 10 (of 10 total)

This topic contains 9 replies, has 2 voices, and was last updated by  Mo0nlight 8 years ago.

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