- Posts: 239
- Thank you received: 8
Inherit filter bug
Hello there,
Filters work great, but today the bug came
i have few customs fields - they are filter1, filter2 ... filter10 for different of my products types i store in this field different data
example
filter1 (value, name)
0 - red - for product type 1
1- green - for product type 1
5 - car - for product type 2
6 - bike - for product type 2
10 - minus 50 .. plus 100C - for product type 3
11 - minus 50 .. plus 120C - for product type 3
12 - minus 50 .. plus 200C - for product type 3
etc
After that i use filter for different category it works only if combination of filters returns product
but if combination of filters on product listing will give no data to user then he used filter - the filters (single list in my case) will contains all
data from custom fields witch is associated to this filters (for all filters on page) , but it have to contain only data for a parent category
you know like - sorry no data found please try again
see youself here is an example aketo.kz/datchiki/temperatury/termosopro...=303&filter__56=none
this not corect
but this is corect
aketo.kz/datchiki/temperatury/termosopro..._54=&filter__56=none
Also i want to ask - how to make filter name instead choose value in my filters ?
As you see on this page aketo.kz/datchiki/temperatury/termosoprotivleniya
there are 6 filters - but only one of them the 6th has name
Please Log in or Create an account to join the conversation.
1. Since the filters have the "dynamic display" setting activated (I presume), it means that each filter only display the choices matching what is preselected in the other filters.
If you don't display the clear button, then once you selected a combination of choices which has no results, you'll not be able to unselect any filters. In order to avoid that, once dynamic filters don't have any results they deactivate their "dynamic display" setting until their are results again.
If you don't want that, then you'll have to change the code.
I think changing that code:
2. In the settings of the filters you have the "title position" setting that you can set to "inside" for that.
Please Log in or Create an account to join the conversation.
nicolas wrote:
2. In the settings of the filters you have the "title position" setting that you can set to "inside" for that.
In the settings of the filters the "title position" already enabled to "inside" for that in my case.
I think it is because we need to replace in /administrator/components/com_hikashop/classes/filter.php
on line
in front view now for a single dropdown it looks like ok
but unfortunely not for a multiple dropdown
this option selected must be disabled for a multiple dropdowns
but enabled for a single dropdowns
how to make correctly ?
I mean here is for example htmls select tag of internal hikashop filter by manufacturer
on the fron view then page already loaded Manufacturer select element already selected this option
like default
but it should contain
something like that
Please Log in or Create an account to join the conversation.
nicolas wrote: Hi,
1. Since the filters have the "dynamic display" setting activated (I presume), it means that each filter only display the choices matching what is preselected in the other filters.
If you don't display the clear button, then once you selected a combination of choices which has no results, you'll not be able to unselect any filters. In order to avoid that, once dynamic filters don't have any results they deactivate their "dynamic display" setting until their are results again.
If you don't want that, then you'll have to change the code.
I think changing that code:to:Code:if(!empty($filter->filter_options['custom_field']) && !empty($datas['products'])){in the file administrator/components/com_hikashop/classes/filter.php should do it.Code:if(!empty($filter->filter_options['custom_field'])){
it is pitty but it dont work
let me explain one more time the bug
I have 6 customs fields
in each of custom field i store different values for filtering for a different categories of products because i dont want to make my products table
in db big (this method said to me one of yours comrade on this forum)
here is an example code on loaded page
It works good as it should - it shows only values for a category temp sensors
also for all of my other filters for this category the are contain dynamic data for products
if i will enable filter one by one - it works good dynamic data will show only variants for filter applied
but is I choose two or more filters and the result of such sql query will return null rows in this case i will get follow <SELECT> tag for my 1st filter in the example
as you can see it now html element SELECT contains all data witch i store in custom field associaed to this filter also for all filters on category
also for internal filter by brand it will contain all brands in hikashop
But the normal result for this user's operation have to be something like 'sorry no data to display, please choose another combination of filters'
and show in html SELECT element user's selected values or to flush all filters and fill them only values associated to fields
I hope you understand me
Please Log in or Create an account to join the conversation.
what it using for ?
Please Log in or Create an account to join the conversation.
1.
I think that's where the problem is. I would rather recommend to have the values in different custom fields. Sure, you'll have a bigger hikashop_product table but that shouldn't be too much of a problem unless you have hundred of thousands of products and hundreds of custom fields.in each of custom field i store different values for filtering for a different categories of products because i dont want to make my products table
in db big (this method said to me one of yours comrade on this forum)
Actually, having to activate the "dynamic display" setting adds MySQL queries to the page to know what to display in each dropdown so I'm not sure it helps performance-wise.
Even if the hikashop_product table doubles in size it shouldn't be a problem.
Having it setup like that, you'll have only the relevant values in each dropdown. And that's why I wasn't able to understand the problem you had as I didn't had it on my end the way I set up the custom fields and filters.
2. When you're applying a filter on a custom field, you have the "values" area where you can enter numbers so that the filter will actually contain the ranges between these numbers instead of the values entered in the custom field.
It's useful when you custom field contain values, or prices.
So in the filter, you'll end up with choices like that:
from 10 to 50
from 50 to 200
from 200 to 1000
And if you activate that "defined limits" setting, you'll also get:
below 10
above 1000
in the choices of the filter.
Please Log in or Create an account to join the conversation.
This bug should be fixed in future releases, now i used "by click" function - seems like ok
Also will be nice to use ajax for filtering instead get or post data.
What about my second question - titles of filters ?
Please Log in or Create an account to join the conversation.
1. No, I just mean that you shouldn't group values of things you want to filter in separate filters in the same custom fields. The issue you have is a by-product of doing that. If you setup the values that should be in the same dropdown in the same custom field, and the values that should be in different dropdowns in different custom fields, it should work fine.
2. Regarding the future of HikaShop, redoing completely the filter system is something we want to work on, hopefully in 2019 although I can't promise any date as we didn't start anything yet on that. Of course, when we redo it, having the system fully ajax will be one of the main points of improvements, (like we did previously with the checkout, the add to cart, etc).
3. Regarding the title of the filters, I missed the question in my previous message. Sorry for that.
Replacing :
Please Log in or Create an account to join the conversation.
left as is
thanks a lot
Please Log in or Create an account to join the conversation.
i want to delete br element from this code
Please Log in or Create an account to join the conversation.
There is no such <br/> tag by default.
I suppose that you must have a translation override of the translation:
CURSOR_TITLE_SEPARATOR=": "
with:
CURSOR_TITLE_SEPARATOR="<br/>"
instead, which could explain the resulting HTML in your message.
Please Log in or Create an account to join the conversation.
nicolas wrote: Hi,
There is no such <br/> tag by default.
I suppose that you must have a translation override of the translation:
CURSOR_TITLE_SEPARATOR=": "
with:
CURSOR_TITLE_SEPARATOR="<br/>"
instead, which could explain the resulting HTML in your message.
I cheked translation overide but CURSOR_TITLE_SEPARATOR=": "
no translation also a searched for br element in the translation
there are only 4 places with br element but no one of them associated with filters
what else may be ?
Please Log in or Create an account to join the conversation.
Did you check in your HikaShop Language files, just to be sure :
If yes, and nothing seems wrong, next step can you provide :
- Some frontend/Backend access via our Contact us form and add an Url link to this topic
Regards
Please Log in or Create an account to join the conversation.
Philip wrote: Hello,
Did you check in your HikaShop Language files, just to be sure :
If yes, and nothing seems wrong, next step can you provide :
- Some frontend/Backend access via our Contact us form and add an Url link to this topic
Regards
I did check - there is no overrides about theme
I sent access to your email
Please Log in or Create an account to join the conversation.
Please note these differents points :
- When I go to your website backend, I notice that you haven't default template (like ProtoStar by example), sometimes it's good to
switch to such a default template in order to see if your display issue.
On the same idea, for a reason or another, I wasn't able to switch to another template
- You haven't any override view on the product/filter view, so I checked your template css, I find this :
You have some custom css that set your span (html inline elements) to be a block element, and so the </br> + span in block create 2 back to line.
Note that we understand where come from the </br> it's from a function that have to set html title display and so this leads to provide you 2 solutions :
- Delete from your Css the "display: block;"
- Try to edit your filter.php in YourWebsite\components\com_hikashop\views\product\tmpl folder, and around line 1275, remove the
</br> to see if the result can match your needs.
Hope this will fit your needs
Regards
Please Log in or Create an account to join the conversation.
replaced
to
Please Log in or Create an account to join the conversation.