Skip to main content

Trigger when filtering is done

7 years 1 month ago #311553 by FilipHradil
-- HikaShop version -- : 4.2.3

Hello!

I would like to ask you for help. I need to trigger javascript after filtering is done. Please, could you advise me in what file on what line can I add my code?

I need to scroll up after filtering is done – I can manage this, I only need to know, where I can execute this code.


Thank you in advance many times!
Filip

Please Log in or Create an account to join the conversation.

7 years 1 month ago #311555 by kyratn
Hi,

There is a trigger filters.updated which you can use.
Code:
window.Oby.registerAjax("filters.updated",function(params){ ....Your function here.... });

You can find more about this in this topic: www.hikashop.com/forum/filters-search/89...iltering.html#308760

Hope that helps.

Thans
The following user(s) said Thank You: nicolas, FilipHradil

Please Log in or Create an account to join the conversation.

7 years 1 month ago #311561 by FilipHradil
Thank you so much for advice! It works perfectly. I resolved my issue thanks to your solution.

If somebody needs to scroll up to 1st product after filtering (for example: if you have filters in sidebar as me), here is my code:

Code:
window.Oby.registerAjax("filters.updated",function(params){ jQuery('html, body').animate({ scrollTop: jQuery('.hikashop_products').offset().top }, 1000, 'easeOutExpo' ); });


Thank you, once again!
F.
The following user(s) said Thank You: kyratn

Please Log in or Create an account to join the conversation.

7 years 1 month ago #311560 by nicolas
Hi,

We actually have added an option to the filter module to do that for the next version of HikaShop which is to be released soon.
So I would recommend to wait for a few more days and just activate that.

Please Log in or Create an account to join the conversation.

7 years 1 month ago #311682 by FilipHradil
Thank you for information.

Have a nice day,
Filip

Please Log in or Create an account to join the conversation.

Time to create page: 0.056 seconds
Powered by Kunena Forum