- Posts: 69
- Thank you received: 1
Filtering of exact text string
- dkmetz@taylorbruce.com
-
Topic Author
- Offline
Less
More
12 years 1 month ago #168862
by dkmetz@taylorbruce.com
______________
Dennis Kmetz
Filtering of exact text string was created by dkmetz@taylorbruce.com
-- HikaShop version -- : 2.3.2
-- Joomla version -- : 3.3.3
-- PHP version -- : 5.4
-- Error-message(debug-mod must be tuned on) -- : Question pertaining to filters
Hi,
I am trying to search for an exact text string... and need some advice. I have read several of the posts regarding this subject...
I have a custom field called MATERIAL
MATERIAL contains
Cotton
Cotton Fleece
Cotton Terrycloth
Cotton/Polyester blend
I need to be able to search for each distinct set of products and I would like to keep these values in the database of products so that I can see them on back end display, and also make them available when comparing products
I know that I can have values for the custom field like 001, 002, 003, etc. and map these to filter module, but is there an easy way to make them distinct without changing their values in the database?
Dennis
-- Joomla version -- : 3.3.3
-- PHP version -- : 5.4
-- Error-message(debug-mod must be tuned on) -- : Question pertaining to filters
Hi,
I am trying to search for an exact text string... and need some advice. I have read several of the posts regarding this subject...
I have a custom field called MATERIAL
MATERIAL contains
Cotton
Cotton Fleece
Cotton Terrycloth
Cotton/Polyester blend
I need to be able to search for each distinct set of products and I would like to keep these values in the database of products so that I can see them on back end display, and also make them available when comparing products
I know that I can have values for the custom field like 001, 002, 003, etc. and map these to filter module, but is there an easy way to make them distinct without changing their values in the database?
Dennis
______________
Dennis Kmetz
Please Log in or Create an account to join the conversation.
Less
More
- Posts: 12953
- Thank you received: 1778
12 years 1 month ago #168939
by Mohamed Thelji
Replied by Mohamed Thelji on topic Filtering of exact text string
Hello Dennis,
Can you give us more information about want you want to do and where do you want to use it through some screenshots for example ?
Thanks
.
Can you give us more information about want you want to do and where do you want to use it through some screenshots for example ?
Thanks
Please Log in or Create an account to join the conversation.
- dkmetz@taylorbruce.com
-
Topic Author
- Offline
Less
More
- Posts: 69
- Thank you received: 1
12 years 1 month ago #169025
by dkmetz@taylorbruce.com
______________
Dennis Kmetz
Replied by dkmetz@taylorbruce.com on topic Filtering of exact text string
Hi Mohamed,
I think I figured it out... I placed the values of the custom field in quotes... AND made Cotton two words... so this works and allows me to filter on the individual items:
"All Cotton"
"Cotton Fleece"
"Cotton Terrycloth"
"Cotton/Polyester blend"
Dennis
I think I figured it out... I placed the values of the custom field in quotes... AND made Cotton two words... so this works and allows me to filter on the individual items:
"All Cotton"
"Cotton Fleece"
"Cotton Terrycloth"
"Cotton/Polyester blend"
Dennis
______________
Dennis Kmetz
Please Log in or Create an account to join the conversation.
12 years 1 month ago #169041
by nicolas
Replied by nicolas on topic Filtering of exact text string
Yes, you need to not have a value inside other values of your custom field otherwise the values with that value inside them will also match when the user select that value in a filter.
Please Log in or Create an account to join the conversation.
- dkmetz@taylorbruce.com
-
Topic Author
- Offline
Less
More
- Posts: 69
- Thank you received: 1
11 years 10 months ago #178736
by dkmetz@taylorbruce.com
______________
Dennis Kmetz
Replied by dkmetz@taylorbruce.com on topic Filtering of exact text string
Nicolas,
I thought this was working for me but it is not... here is my situation. I have a radio button custom field with values and titles. My custom field values are a, b, c and I have so many different values that I go into double characters... so I am into values of x, y, z, aa, ab, ac etc.
What I just discovered is that when I select the filter value for "a", I get a product with a custom field value of "a" which is good, but I also get a product with a value of "ag"... which is incorrect. Both products are being returned when I filter on what should return just the a product with the value of "a". I confirmed that the additional product (the one that should not be returned) is correctly set with a value of "ag". I also exported the product, and confirmed it that way.
So, it appears that the filter does not distinguish between products with values of "a" and "ag". If I filter on values of "ag", then the filter works properly and returns only products with "ag" values. Do I need to change all my values to be the same length? For example, if should I change my custom field values from a, b, c, to a1, b1, c1, etc. and update my inventory accordingly?
Please advise me on how to proceed.
Dennis
I thought this was working for me but it is not... here is my situation. I have a radio button custom field with values and titles. My custom field values are a, b, c and I have so many different values that I go into double characters... so I am into values of x, y, z, aa, ab, ac etc.
What I just discovered is that when I select the filter value for "a", I get a product with a custom field value of "a" which is good, but I also get a product with a value of "ag"... which is incorrect. Both products are being returned when I filter on what should return just the a product with the value of "a". I confirmed that the additional product (the one that should not be returned) is correctly set with a value of "ag". I also exported the product, and confirmed it that way.
So, it appears that the filter does not distinguish between products with values of "a" and "ag". If I filter on values of "ag", then the filter works properly and returns only products with "ag" values. Do I need to change all my values to be the same length? For example, if should I change my custom field values from a, b, c, to a1, b1, c1, etc. and update my inventory accordingly?
Please advise me on how to proceed.
Dennis
______________
Dennis Kmetz
Please Log in or Create an account to join the conversation.
11 years 10 months ago #178740
by nicolas
Replied by nicolas on topic Filtering of exact text string
Hi,
Yes, you should update the values with less letters to have the same amount of letters so that they aren't found inside other values.
Note that we added a patch in the filtering system with the 2.3.4 version of HikaShop which should normally avoid the problem.
Yes, you should update the values with less letters to have the same amount of letters so that they aren't found inside other values.
Note that we added a patch in the filtering system with the 2.3.4 version of HikaShop which should normally avoid the problem.
Please Log in or Create an account to join the conversation.
- dkmetz@taylorbruce.com
-
Topic Author
- Offline
Less
More
- Posts: 69
- Thank you received: 1
11 years 9 months ago #182818
by dkmetz@taylorbruce.com
______________
Dennis Kmetz
Replied by dkmetz@taylorbruce.com on topic Filtering of exact text string
This solved my problem... thanks!
______________
Dennis Kmetz
Please Log in or Create an account to join the conversation.
- dkmetz@taylorbruce.com
-
Topic Author
- Offline
Less
More
- Posts: 69
- Thank you received: 1
11 years 7 months ago - 11 years 7 months ago #189465
by dkmetz@taylorbruce.com
______________
Dennis Kmetz
Replied by dkmetz@taylorbruce.com on topic Filtering of exact text string
Hi,
My problem is back... sort of. I have different data and I am now on 2.3.5.
I have a custom field being used as a filter. The filter value is SUPER PREMIUM with no quotes or anything else in the value field within this custom field. The inventory item (when exported) has the value SUPER PREMIUM in the custom field... so far so good.
I think the issue may be the submit value (I am using the filter module) in the form of the product/filter.php file.
The submit value is SUPER and not SUPER PREMIUM. Thus I select no inventory items. Here is the code that is generated:
Thanks,
Dennis
My problem is back... sort of. I have different data and I am now on 2.3.5.
I have a custom field being used as a filter. The filter value is SUPER PREMIUM with no quotes or anything else in the value field within this custom field. The inventory item (when exported) has the value SUPER PREMIUM in the custom field... so far so good.
I think the issue may be the submit value (I am using the filter module) in the form of the product/filter.php file.
The submit value is SUPER and not SUPER PREMIUM. Thus I select no inventory items. Here is the code that is generated:
Code:
<input onchange="document.forms['hikashop_filter_form_module_148'].submit();" type="checkbox" name="filter_Quality__Glove_Price_Range_[]" value="Super" premium="" id="field_8_0_module_148">
Dennis
______________
Dennis Kmetz
Last edit: 11 years 7 months ago by dkmetz@taylorbruce.com. Reason: spelling
Please Log in or Create an account to join the conversation.
11 years 7 months ago #189574
by nicolas
Replied by nicolas on topic Filtering of exact text string
Hi,
Could you provide a link to the page with the filter so that we could look at the issue ?
Could you also provide a screenshot of the options of the filter ?
Could you provide a link to the page with the filter so that we could look at the issue ?
Could you also provide a screenshot of the options of the filter ?
Please Log in or Create an account to join the conversation.
- dkmetz@taylorbruce.com
-
Topic Author
- Offline
Less
More
- Posts: 69
- Thank you received: 1
11 years 7 months ago #189583
by dkmetz@taylorbruce.com
______________
Dennis Kmetz
Replied by dkmetz@taylorbruce.com on topic Filtering of exact text string
Nicolas,
Here you go...
page with the issue
181.224.147.219/~steineri/index.php?opti...t=listing&Itemid=367
Screenshot of options of the custom field used as the filter
prntscr.com/6108ik
The filter screen
prntscr.com/6109h8
Thanks,
Dennis
Here you go...
page with the issue
181.224.147.219/~steineri/index.php?opti...t=listing&Itemid=367
Screenshot of options of the custom field used as the filter
prntscr.com/6108ik
The filter screen
prntscr.com/6109h8
Thanks,
Dennis
______________
Dennis Kmetz
Please Log in or Create an account to join the conversation.
11 years 7 months ago #189715
by nicolas
Replied by nicolas on topic Filtering of exact text string
Hi,
Thank you. We found the issue.
Change the line:
to:
in the file administrator/components/com_hikashop/classes/filter.php and that will fix the problem.
Thank you. We found the issue.
Change the line:
Code:
if($type!='hidden') $input = '<INPUT '.$onClick.' '.$checked.' type="'.$type.'" name="filter_'.$filter->filter_namekey.$tab.'" value='.$val[0].' id="field_'.$filter->filter_id.'_'.$key.'_'.$divName.'">';
Code:
if($type!='hidden') $input = '<INPUT '.$onClick.' '.$checked.' type="'.$type.'" name="filter_'.$filter->filter_namekey.$tab.'" value="'.htmlentities($val[0]).'" id="field_'.$filter->filter_id.'_'.$key.'_'.$divName.'">';
The following user(s) said Thank You: dkmetz@taylorbruce.com
Please Log in or Create an account to join the conversation.
- dkmetz@taylorbruce.com
-
Topic Author
- Offline
Less
More
- Posts: 69
- Thank you received: 1
11 years 7 months ago #189757
by dkmetz@taylorbruce.com
______________
Dennis Kmetz
Replied by dkmetz@taylorbruce.com on topic Filtering of exact text string
Nicolas,
This worked... thanks for the prompt reply!
Dennis
This worked... thanks for the prompt reply!
Dennis
______________
Dennis Kmetz
Please Log in or Create an account to join the conversation.
Time to create page: 0.266 seconds