No ajax filtering

  • Posts: 1119
  • Thank you received: 114
4 years 8 months ago #308590

-- HikaShop version -- : 1907121821

Hi,

Just installed Hikashop 4.2.0 on localhost and seems cant find ajax filters. Filters are working as it was, reloading the whole page. Looking html i see it has changed... Trying with blank protostar template. Maybe i miss something?

Here are some screenshots:




Thanks

Attachments:

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

  • Posts: 410
  • Thank you received: 15
4 years 8 months ago #308608

Same problem with category filtering.

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

  • Posts: 1119
  • Thank you received: 114
4 years 8 months ago #308627

Hi,

Would like give some update here. Updated again with Hikashop 4.2.0 and it got a bit better.

1. It seems that ajax filtering works only with hikashop filter module. If filters are set to show on top of the product listing without module, it doesn't work. Just nothing happens.... You may want to take a look into this.

2. I would suggest to scroll page to the top after filtering is done. If you have a lot of filters on the left or right sidebar it is a pain for the user to scroll each time up. So we get better user experience if we do this...

3. Setting any filtering to submit on click to "YES" and then fast double tap filter (checkbox as example) or button "FILTER", console throws error "ReferenceError: clearTimout is not defined"



4. I also would like to say thank you for great improvements you have done. Like saving cart in cookies and ajax filtering. Thanks for listening to your users.

However, not sure how wishlist works now? I still need to loging in order to use wishlist when trying to add product to wishlist. So change log is a bit confusing...

Regards

Attachments:

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

  • Posts: 25994
  • Thank you received: 4004
  • MODERATOR
4 years 8 months ago #308630

Hello,

Please re-download HikaShop package to get the fix regarding the JavaScript issue.

For the other points, please provide details regarding your configuration so the support team will be able to easily reproduce the context and perform some analysis.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 1119
  • Thank you received: 114
4 years 8 months ago #308700

Hi,

Thanks for JS fix.

1. It is easy to reproduce the issue:

1. Create some filter, as example sort or something with checkbox
2. Create menu item of product listing or category listing
3. Via that menu item product options settings set Filters display to "YES"
4. Try to filter and see behaviour

Seems i am not the only one who have some issue like this: www.hikashop.com/forum/install-update/89...the-menu.html#308637

2. Sometime when filtering we get blank page with url params in it.

Here is the example which was done like this.

1. Installed Fresh Joomla 3.9.10 and Hikashop 4.2.0 with demo content. Created sort filter with radio. Filtering seems working but after pressing delete button i get this page:





All test are done on protostar template with no modifcations.

Thanks

Attachments:
Last edit: 4 years 8 months ago by kyratn.
The following user(s) said Thank You: neo191987

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

  • Posts: 81378
  • Thank you received: 13037
  • MODERATOR
4 years 8 months ago #308719

Hi,

Thank you for the details. I was able to reproduce the issues and added some patchs for them. Please download again the install package on our website and install it on yours and it should work much better now.

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

  • Posts: 1119
  • Thank you received: 114
4 years 8 months ago #308732

Hi,

It looks a bit better but there are still some issues.

Now filtering for sort does work and if filter type of checkbox is set to submit on click to "YES" this filter does work. However if i set submit on click to "NO" and try to filter with button "FILTER" it doesn't work. Same for reset button. It just nothing happens, no any action...

Here are some screenshots which i hope will help.





Thanks

Attachments:

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

  • Posts: 81378
  • Thank you received: 13037
  • MODERATOR
4 years 8 months ago #308751

Hi,

I'm not able to reproduce the issue on my end.
Make sure you have the latest build and no override of the view files product/listing.php product/listing_div.php and product/filter.php
If you do, try renaming them in templates/YOUR_TEMPLATE/html/com_hikashop/product/ and try again.

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

  • Posts: 1119
  • Thank you received: 114
4 years 8 months ago #308755

Hi,

Nope, no view overrides but i found the issue.

Via Hikashop configuration-> Filter button position, setting it to "Right" or "Left" is fixing the issue.

So checked html and it seems if button position is set to "Inside". "Filter" and "Reset" buttons are missing some html "data-container-div"

Someone forgot to add:

<?php echo $attributes; ?>

For these buttons :)

Please take a look into it.

Thank you

The following user(s) said Thank You: nicolas

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

  • Posts: 1119
  • Thank you received: 114
4 years 8 months ago #308757

Also I would suggest to scroll page to the top after filtering is done. If you have a lot of filters on the left or right sidebar it is a pain for the user to scroll each time up. So we get better user experience if we do this...

Or is there a trigger, after filtering is done, which i could use?

Thanks again

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

  • Posts: 81378
  • Thank you received: 13037
  • MODERATOR
4 years 8 months ago #308760

Hi,

Thanks for the feedback. Indeed the attributes were missing for that button position and my buttons were in another position so I didn't see the issue.
I've added the patch and updated the install packages on our end.

Regarding the scrolling, I would like to wait a bit to get more feedbacks. The issue is I think you don't necessarily want to auto scroll.
For example, if you're using the filters at the top of the products listing, you don't want to move the scroll.
If the filters are on a side module it might make sense in some cases but not necessarily all the time.
Maybe adding an option to scroll to the top upon filtering in the module might make sense.

Regarding the triggers, we've added some but the javascript code might change in the future.
You have the trigger filters.updated that you can use with the params:
{el: el, refreshAreas : refreshAreas, resp: resp}
el is the element being clicked on, refreshAreas are the areas refreshed and resp is the response from the server for the submit of the filters data.

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

  • Posts: 1119
  • Thank you received: 114
4 years 8 months ago #308766

Hi,

Happy to help as much i can.

1. About scrolling. Yes, you right. It depends on a lot of cases. However, even having filters on the top could make seens to scroll page up. As example: Having 2 or 1 product on mobile, i might add filter sticky to the top or bottom of page so after filtering is done, i definitely want page scroll up. Especially while 80% of traffic is mobile, i want user to have best experience i can give here...

Again this is more related to my needs but if you ask me, i would suggest to add extra option to scroll to the top on module and menu item itself. This definitely will be useful for someone else too.

2. Please in the future, if possible, consider adding this new triggers to your development docs, this would make life easier :)

Thank you

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

  • Posts: 81378
  • Thank you received: 13037
  • MODERATOR
4 years 8 months ago #308768

Hi,

1. For the module, I definitely see the point. For the menu item, it only makes sense if you have the filters area stick to the top. So adding the option without the filters being sticky really makes no sense I think.

2. Yes. We'll have to do some work on the developer documentation to add all the new triggers that we've kept adding since the 3.0.0
There are many missing (mainly because we wanted to wait and make sure that they were stable enough).

The following user(s) said Thank You: kyratn

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

  • Posts: 2143
  • Thank you received: 747
4 years 8 months ago #308797

nicolas wrote: Maybe adding an option to scroll to the top upon filtering in the module might make sense.


+1


Need help with customisations of layouts, style or other site development? PM me!
(Don't forget to turn on "E-mail notification of new messages" )

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

  • Posts: 103
  • Thank you received: 5
4 years 8 months ago #308801

nicolas wrote: Maybe adding an option to scroll to the top upon filtering in the module might make sense.


+1 for extra "scroll to top" option in modules

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

  • Posts: 81378
  • Thank you received: 13037
  • MODERATOR
4 years 8 months ago #308808

Thanks for the feedback. It's noted on our end.

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

  • Posts: 1119
  • Thank you received: 114
4 years 8 months ago #308922

nicolas wrote: Hi,

Regarding the triggers, we've added some but the javascript code might change in the future.
You have the trigger filters.updated that you can use with the params:
{el: el, refreshAreas : refreshAreas, resp: resp}
el is the element being clicked on, refreshAreas are the areas refreshed and resp is the response from the server for the submit of the filters data.


Hi,

I've been trying to retain some click class "open" ( which is added on click to show dropdown ) after filter refresh but not sure how properly this should be done with new ajax filters.

Basically the idea is to wrap each filter in dropdown and on click filter, the dropdown will be shown with checkboxes. I do have "submit on click" set so after checkbox is clicked, filters are refreshed and dropdown hidden due missing "open" class. So i am trying to add it back after filter is refreshed. As example i do have this:
window.Oby.registerAjax("filters.updated",function(params){ 
jQuery('.dropdown_size').addClass('open');
});

However this runs in same time filter is getting refreshed. How to check that filter refresh is done and only then do what i need?

Any help from any one would be really appreciated.

Thanks

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

  • Posts: 200
  • Thank you received: 75
4 years 8 months ago #308925

Hi,

I haven't had an opportunity yet to look at the new Ajax filters, but for your issue wouldn't it be sufficient to simply add a small delay? Like so:

window.Oby.registerAjax("filters.updated",function(params){ 
setTimeout(function(){
    jQuery('.dropdown_size').addClass('open');
},500);
});

Due to the asynchronicity of Ajax requests, a small delay ensures all elements are (re)loaded on the page before executing your javascript.
Hope that helps.

The following user(s) said Thank You: kyratn

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

  • Posts: 1119
  • Thank you received: 114
4 years 8 months ago #308926

Hi,

Thanks GW for replay. I was thinking about it but it doesn't work. If request takes more time than set in setTimeout function then it fails to add class. As example if use 1000ms, so it mostly works but not always, that's why i am looking for the proper solution.

I am also thinking to use localStorage, save and retain it for later after ajax refresh as there are other things i will have to store too. It is easy to do with jQuery ajax request but with Hikashop, without even code example, can't find solution as for now....seems there is no such trigger :(

Thanks

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

  • Posts: 1119
  • Thank you received: 114
4 years 8 months ago #308929

So i created dynamic click based on filter clicked and moved class away from refresh content. Now it works. Issue solved.

And sorry for off topic.

Thanks again

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

Time to create page: 0.167 seconds
Powered by Kunena Forum