Filter Not working In some areas

  • Posts: 363
  • Thank you received: 7
  • Hikashop Business
4 years 6 months ago #319043

-- url of the page with the problem -- : www.totalfootballdirect.com/teamwear-kits
-- HikaShop version -- : 4.2.3
-- Joomla version -- : 3.9
-- PHP version -- : 7.2

Hi,

This might part be reated to: www.hikashop.com/forum/filters-search/89...sh404sef.html#318927

When browsing to the page that I copied in "Url of the page with the problem" it seems you can select 1 tem on the filter and after that it stops working. Chrome reports this error:

Uncaught TypeError: Cannot read property 'newURL' of null
at hikashop.js?v=423:922
at XMLHttpRequest.xhr.onreadystatechange (hikashop.js?v=423:206)

Any ideas please?

Other areas of the site work ok - others dont

Many thanks.

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

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
4 years 6 months ago #319120

Hi,

I would first recommend updating to HikaShop 4.3.0.
We've made a few patchs on the filter system since the 4.2.3 and you don't have all of them, including one on the pagination system and your issue is linked to the pagination system as the javascript error you get actually comes from the URL requested which is missing a ? before the limitstart parameter used for the pagination.
If you check the network tab of the developer tools of your browser when using filters, you can see these requests:
monosnap.com/file/J8l6NLiPq75NPlqVicANnaZWiJcmov
And you can see that the ? is missing before the text limitstart.
Because of that, the URL is not found by the SEF system, it returns an error page instead of calling HikaShop's filter system to return the correct data and then the js of the filter system gets an answer it doesn't understand and you get that javascript error.

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

  • Posts: 363
  • Thank you received: 7
  • Hikashop Business
4 years 6 months ago #319329

Hi - I updated to the latest version of hikashop and the issues are still the same. thanks.

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

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
4 years 6 months ago #319337

Hi,

Then could you provide a FTP access so that we could do some debugging as we're not able to reproduce the problem on our own test website ?
You can use our contact form for that:
www.hikashop.com/support/contact-us.html
Make sure you include a link to this thread for reference in your message.

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

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
4 years 6 months ago #319484

Hi,

I found the issue. It's a bug created by the setting "301 redirect from non-sef to sef URL" of sh404SEF. Turning off that setting fixes the problem.
That's because sh404SEF tries to SEF the AJAX refresh URL

https://www.totalfootballdirect.com/index.php?option=com_hikashop&ctrl=product&task=filter&tmpl=raw&filter=1&module_id=&cid=0&from_option=com_hikashop&from_ctrl=product&from_task=listing&from_itemid=109&limitstart=0&filter_Category_3=13&filter_Brands_1=+&filter_Colour_2=+&filter_gender_4=+&return_url=https%3A%2F%2Fwww.totalfootballdirect.com%2Fteamwear-kits%3Flimitstart%3D0%26filter_Category_3%3D13%26filter_Brands_1%3D%2B%26filter_Colour_2%3D%2B%26filter_gender_4%3D%2B
which contains itself a return_url parameter and doesn't do it properly resulting in a wrong URL which then breaks further AJAX refreshes.

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

  • Posts: 363
  • Thank you received: 7
  • Hikashop Business
4 years 6 months ago #319526

HI Nicolas,

Thank you for looking at this and providing the fix.

Many thanks :)

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

  • Posts: 12
  • Thank you received: 2
3 years 1 month ago #336234

The same problem occurred on my website
but this solution is not work for my site
After confirming this once
how to setting "301 redirect from non-sef to sef URL" of sh404SEF. Turning off that setting
thank you
i is disabale Search Engine Friendly URLs in my site
my site info
-- HikaShop version -- : 4.4.3
-- Joomla version -- : 3.8
-- PHP version -- : 7.4

Last edit: 3 years 1 month ago by clkuo.

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

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
3 years 1 month ago #336246

Hi,

I've replied to you on the other thread:
www.hikashop.com/forum/filters-search/90...-my-site.html#336245

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

  • Posts: 231
  • Thank you received: 28
  • Hikashop Business
2 years 8 months ago #340026

Hi
I have the same problem, on google chrome mobile and edge browswer on browser, and some times in google chrom desktop.
Use Edge browser to recreate the problem.

This message contains confidential information

Attachments:
Last edit: 2 years 8 months ago by oxido. Reason: I've removed sensitive data

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

  • Posts: 231
  • Thank you received: 28
  • Hikashop Business
2 years 8 months ago #340038

And I see that when I select 1 filters, all of them are added to the url. I remember filters are added to the url one by one, when that specific filter is it used first time.
In this example, I'ved selected only "Tematica", but all the others were added to the url, with no value set
?limitstart=0&filter_Tematic_12=povestiri&filter_Pre_14=+&filter_Varst_16=+&filter_Autori_2=+&filter_Limba_4=+&filter_Colecie_9=+&filter_Tipcopert_11=+&filter_Productor_13=+

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

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
2 years 8 months ago #340027

Hi,

Note first that I wasn't able to reproduce the issue on my end on your website with either Edge or Chrome.
While your issue looks similar for the user, the error is totally different.
As you can see in your video, you have the error :

Access to XMLHttpRequest at xxx from yyy has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

From what I can read online it's something that can be fixed at the server level. It's probably because the URL for yyy has www. while the URL for xxx doesn't have the www.
It might be an issue with the live parameter of the configuration.php file of your Joomla, but it might also be solved by redirecting non www URLs to www URLs in your htaccess. That's a common thing:
www.joomlashack.com/blog/joomla/www/
I don't think there is anything we can do in HikaShop to fix that.

The following user(s) said Thank You: oxido

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

Time to create page: 0.094 seconds
Powered by Kunena Forum