-
AuthorPosts
-
February 3, 2014 at 3:57 pm #194427
I downloaded JA K2 Filter and Search component for my site (which is not online yet, and I don’t know how to put it online to show you the problem) and one of my filters (extra fiends) is set to multi-select and then again set to multi-select inside the module, so I get the type of filter I want. But there is a problem. I have products that have some features. I want the user to select products with both those features he chooses. I will give you an example. The TV’s in my website have these features; HD, LED, HDMI and 3D. When the user selects 2 of the filter’s choices (HD and HDMI) he gets ALL the TV’s that have HD and ALL the TV’s that have HDMI in the results page. I want the user to get only the products that have BOTH features in the description. I didn’t find anything like that in the configuration options so I guess I have to change something inside the code to change it from executing a logical OR between the filter’s choices to logical AND. I don’t want to use separate filters for that, because the different features are 39. So how can I do it?
HeR0 FriendHeR0
- Join date:
- August 2011
- Posts:
- 3626
- Downloads:
- 0
- Uploads:
- 61
- Thanks:
- 33
- Thanked:
- 588 times in 549 posts
February 4, 2014 at 10:10 am #521090Hi Thmelissourgos,
<blockquote> The TV’s in my website have these features; HD, LED, HDMI and 3D. When the user selects 2 of the filter’s choices (HD and HDMI) he gets ALL the TV’s that have HD and ALL the TV’s that have HDMI in the results page. I want the user to get only the products that have BOTH features in the description. </blockquote>
I think that you must create 3 extra fields with field type is boolean ( Yes or No options ) for HD, LED, HDMIFebruary 4, 2014 at 3:43 pm #521133Thank you for your reply, but the problem is the features are 39. I can’t put 39 different filters with yes or no options. It destroys the way my website looks. Do you know how I can change the code to do what I want in a single filter?
HeR0 FriendHeR0
- Join date:
- August 2011
- Posts:
- 3626
- Downloads:
- 0
- Uploads:
- 61
- Thanks:
- 33
- Thanked:
- 588 times in 549 posts
February 5, 2014 at 3:32 am #521205<em>@thmelissourgos 409371 wrote:</em><blockquote>Thank you for your reply, but the problem is the features are 39. I can’t put 39 different filters with yes or no options. It destroys the way my website looks. Do you know how I can change the code to do what I want in a single filter?</blockquote>
I am afraid it is beyond scope of our support. Please consider to find a developer to help you on this.February 5, 2014 at 2:21 pm #521333I thought I was talking with one of the developers of the joomla plugin. Can you give me an e-mail of the people who created this?
Thanh Nguyen Viet FriendThanh Nguyen Viet
- Join date:
- September 2014
- Posts:
- 1461
- Downloads:
- 0
- Uploads:
- 44
- Thanked:
- 258 times in 217 posts
February 10, 2014 at 8:47 am #522005<em>@thmelissourgos 409371 wrote:</em><blockquote>Thank you for your reply, but the problem is the features are 39. I can’t put 39 different filters with yes or no options. It destroys the way my website looks. Do you know how I can change the code to do what I want in a single filter?</blockquote>
@thmelissourgos,For this issue, you should group the features. For instance:
– Technology: LED, 3D, Plasma, …
– Screen size: 32′, 40′,…
– Frequently: 100Hz, 75Hz,…
– Ports: HDMI, usb,…It is easier for user to select and get an expected result. This is same approach we did for our demo site at http://demo.joomlart.com/joomla-extensions/ja-k2-filter/ajax-auto-filter
Regarding a suggestion to search with many conditions for one field (E.g: search for TVs that supports many connect ports), it seems to be a nice feature, I have reported this to our bug tracker system for our development to consider further. You can check status of this issue at http://pm.joomlart.com/browse/JAK2FILTER-142
1 user says Thank You to Thanh Nguyen Viet for this useful post
February 12, 2014 at 1:00 pm #522392Unfortunately it’s impossible to group the features. Actually what I must apply filters to is not TV’s (that was just an example so you would understand what I need to change in the code). I have to filter some magic cards that have certain abilities. There are about 40 abilities (ungroupable, because there are no categories) and a card can have from 0 to 4 of those abilities. So when the visitor of my website wants a card that has 2 or 3 of them I don’t want to show them all the cards that have at least one of them. I’m sure you have realized what I want to do though so I won’t repeat it anymore. Are you one of the people who wrote the code for this extension? I’m sure it’s just 1 line of code I need to change, I just can’t find it. For the person who developed it, it would be less than 5 mins of their time.
ThanksThanh Nguyen Viet FriendThanh Nguyen Viet
- Join date:
- September 2014
- Posts:
- 1461
- Downloads:
- 0
- Uploads:
- 44
- Thanked:
- 258 times in 217 posts
February 13, 2014 at 2:15 am #522462To quick update for your site’s use purpose, you can apply the below solution by following below steps.
1. Open the file
components/com_jak2filter/models/itemlist.php2. Find the below code snippet:
[PHP]$searchPattern = $prefix.'(“‘.implode(‘”|”‘, $value).'”)’; // ~ IN (string1, string2, …)[/PHP]3. Then replace it with this one:
[PHP]//$searchPattern = $prefix.'(“‘.implode(‘”|”‘, $value).'”)’; // ~ IN (string1, string2, …)
$options = array();
foreach($value as $val) {
$options[] = $prefix.'(“‘.$val.'”)’;
}
$searchPattern = implode(“‘ AND i.extra_fields REGEXP ‘”, $options);//match all value[/PHP]February 15, 2014 at 6:39 am #522786Thank you very much Dead Code for your help. This is exactly what I was looking for. It seems to be working just fine for now and I think it will keep working cause it seems like the right line of code to change.
I hope my request to help other people who will purchase this extension. If you had an option weather or not to apply filters with logical AND or logical OR to every filter, this JA K2 Filter and Search component would be one of the best out there.
Thanks again mate.Thanh Nguyen Viet FriendThanh Nguyen Viet
- Join date:
- September 2014
- Posts:
- 1461
- Downloads:
- 0
- Uploads:
- 44
- Thanked:
- 258 times in 217 posts
February 17, 2014 at 1:57 am #522913Glad that you find it helpful 🙂
I will forward your feature request to our development team to give more thoughts on that. For all upcoming updates that might have, we will commit to JED at:
http://extensions.joomla.org/extensions/extension-specific/k2-extensions/14479 -
AuthorPosts
This topic contains 10 replies, has 3 voices, and was last updated by Thanh Nguyen Viet 10 years, 10 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum