0

My site was working fine, suddenly the ajax on category pages is not working on second time. On first time it works fine, whether it is pagination or layered navigation but on second time it doesn't work. I found out that the url's are generating in-correct the second time. On first click it is "headsets?p=2", while after the page ajax loads, it is "headsets&p=2?p=3" and same case is for layered navigation, doesn't work on second time.

Also the code and database are working on local machine and stage site, I run deployment with git/Jenkins, so code and database are same on all platforms, and the issue is only on live site.

page-ul: https://www.thetelecomshop.com/au/headsets

3
  • I face same issue in my site, have u get any solution for this ? Commented Jun 28, 2019 at 14:12
  • Yes it was resolved! It was some extension issue, that was removing ?ajax=1 from URLs'. I changed: app/code/Sm/ShopBy/Plugin/Category/View.php commented out this line: $requestUri = preg_replace('/(\?|&)ajax=1/', '', $requestUri); Commented Jul 2, 2019 at 8:09
  • Thanks for replying @Arsalan Ul Haq :) Commented Jul 2, 2019 at 9:45

1 Answer 1

1

It was resolved!

It was some extension issue, that was removing ?ajax=1 from URLs'.

I changed: app/code/Sm/ShopBy/Plugin/Category/View.php

commented out this line:

$requestUri = preg_replace('/(\?|&)ajax=1/', '', $requestUri)
5
  • For me it doesn't work after a day or two. magento.stackexchange.com/questions/302349/…
    – Zoya
    Commented Jan 28, 2020 at 8:06
  • Did you checked removing the "&shopbyAjax=1" from the url and try hitting the url then? Can't comment on your post because of low reputation profile. Also try changing this line "window.location = (this.url.indexOf('shopbyAjax') == -1) ? this.url : url;" to "window.location = (this.url.indexOf('shopbyAjax') == -1) ? url : url;" Commented Jan 30, 2020 at 7:29
  • dude, saved the day.
    – Flak
    Commented May 21, 2020 at 21:03
  • @Flakerim Did it worked fine? Commented May 22, 2020 at 6:31
  • Just Disable whole SM_SHOPBY.
    – Flak
    Commented May 26, 2020 at 22:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.