- Posts: 98
- Thank you received: 2
Filter's mechanics
So, I hired a web-developer, he applied some features to the website, but when I asked him to make this - You apply a filter in the "Catalogue" menu, then go to another and when you comeback, you have no filter applied. He told me that its impossible because of the info about the applied filters is stored in cookies.
Well. So I ask you as developers, is there ANY way to do something like this? This is incredibly urgent. I mean auto-resetting when you click on the Menu Item where you applied this filter. If there any, could you please descrcibe it more precisely, so as the developer could get it? And plus, the Basket items should not be lost.
Thanks a lot.
Please Log in or Create an account to join the conversation.
You have to edit the file "administrator/components/com_hikashop/classes/filter.php" and in the function "addFilter()" replace the line:
The filters are not stored in cookies but in session.
Please Log in or Create an account to join the conversation.
- Posts: 640
- Thank you received: 16
This is a MUST function which without it makes browsing the catalog an unacceptable experience for most clients.
Please Log in or Create an account to join the conversation.
By this way the filters are not taken from the session but from the "POST".
So when going to another page, the filters values are lost, so reset.
You just have to try
Please Log in or Create an account to join the conversation.
- Posts: 640
- Thank you received: 16
Please Log in or Create an account to join the conversation.
Xavier wrote: Hi,
By this way the filters are not taken from the session but from the "POST".
So when going to another page, the filters values are lost, so reset.
You just have to try
What if i dont have this line in addFilter function in filter.php :
??
Please Log in or Create an account to join the conversation.
- Posts: 640
- Thank you received: 16
Shulha, if you don't find the required string you might be editing a wrong filter.php file. Make sure you are editing the one in the 'classes' folder.
Anyway this is not still the right solution as you may get reseted filter but the Filter controls remain with the X sign to get them cancelled even they are already cancelled.
Suggestions will be welcom on how to refresh the Filters controls to initial status.
Please Log in or Create an account to join the conversation.
- Posts: 640
- Thank you received: 16
Looks like this file and the way to call its functions experienced a large amount of changes since 2.1.0
Please Log in or Create an account to join the conversation.
The way the filters are working don't changed.
The "code tweak" is still valid.
Please Log in or Create an account to join the conversation.
- Posts: 640
- Thank you received: 16
For HikaShop 2.1.3 you have to find this string
$infoGet = $app->getUserStateFromRequest( 'com_hikashop.'.$cid .'_filter_'.$filter->filter_namekey, 'filter_'.$filter->filter_namekey, $infoGet, 'array' );
Please Log in or Create an account to join the conversation.
PeterChain wrote: Anyway this is not still the right solution as you may get reseted filter but the Filter controls remain with the X sign to get them cancelled even they are already cancelled.
Yes. Filter module shows that filter is applied, but all products from category are listed. How to reset selection in module too? It confuses the site visitors.
Please Log in or Create an account to join the conversation.
The last Hikashop version includes the possibility to display a reset button.
You can find this option in System>Configuration>Features>Filters
Please Log in or Create an account to join the conversation.
Eliot wrote: Hi there,
The last Hikashop version includes the possibility to display a reset button.
You can find this option in System>Configuration>Features>Filters
I want clear filter after change category without pressing any buttons. Just open category and there is no any filter applied...
Please Log in or Create an account to join the conversation.
- mariussport
-
- Offline
- Test fase
we had the same question about the filter function.
regards, Marius
Please Log in or Create an account to join the conversation.
Actually this is the current behavior of the filters, it's reseted for each category.
Could you please give me a link to your website so I can test it?
Please Log in or Create an account to join the conversation.
- mariussport
-
- Offline
- Test fase
Thank you. After the update to 2.20 the reset button in the configuration and the filter module is activated.
Seems to work much better now, only one thing, after reset the "Search text" doesn't dissapear in combination of the menu "Article List"
You can test it on the website. [url=http://] www.lebasport.nl [/url]
best regards,
Marius
Please Log in or Create an account to join the conversation.
It's in russian. I think you don't understend anything on this site.Eliot wrote: Hi there,
Actually this is the current behavior of the filters, it's reseted for each category.
Could you please give me a link to your website so I can test it?
When I use filter, it works and show for example 2 products from category
But when I change category and then return here again, there will be listed all products, but filter module shows like filter is still applied. But really no filter is applied.
Please Log in or Create an account to join the conversation.
I reproduced the bug so I'll try to fix it.
@alikon1: Do you have the last Hikashop version? And a link to your website could also help me
Please Log in or Create an account to join the conversation.
I found the source of the issue, it's because you activated the joomla's cache.
That's why the filter is working but not displaying the right informations, the page is cached.
So you ahve to disable the joomla's cache and if you really want to have a cache you must find an extension to specify the pages you want to cache (not the Hikashop ones)
Please Log in or Create an account to join the conversation.
- mariussport
-
- Offline
- Test fase
Thank you for your work and that you have found the issue. Good luck,
Marius
Please Log in or Create an account to join the conversation.