-
AuthorPosts
-
October 25, 2016 at 2:41 pm #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 ModeratorMo0nlight
- Join date:
- September 2014
- Posts:
- 707
- Downloads:
- 38
- Uploads:
- 107
- Thanked:
- 99 times in 97 posts
October 26, 2016 at 2:31 am #980415Hi.
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.
October 26, 2016 at 10:06 am #980543Thank 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 ModeratorMo0nlight
- Join date:
- September 2014
- Posts:
- 707
- Downloads:
- 38
- Uploads:
- 107
- Thanked:
- 99 times in 97 posts
October 28, 2016 at 2:46 am #981227Hi,
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
October 31, 2016 at 8:50 am #982000Hello,
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 ModeratorMo0nlight
- Join date:
- September 2014
- Posts:
- 707
- Downloads:
- 38
- Uploads:
- 107
- Thanked:
- 99 times in 97 posts
November 3, 2016 at 9:57 am #983130November 10, 2016 at 2:46 pm #985227Hello,
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 ModeratorMo0nlight
- Join date:
- September 2014
- Posts:
- 707
- Downloads:
- 38
- Uploads:
- 107
- Thanked:
- 99 times in 97 posts
November 11, 2016 at 10:30 am #985532Hi.
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.
November 16, 2016 at 9:57 am #986909Hello,
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-polynesieThanks
Mo0nlight ModeratorMo0nlight
- Join date:
- September 2014
- Posts:
- 707
- Downloads:
- 38
- Uploads:
- 107
- Thanked:
- 99 times in 97 posts
November 22, 2016 at 8:10 am #988473Hi,
The query is running normally. On the second page, you have some extra items with "ahe" value on them.
Just remove the value.
Regards
AuthorPostsViewing 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
Jump to forum