• Priority: 0
  • Status: Closed
  • Theme: Alysum
  • Assigned To: Fred
  • Private: No
  • Open Date: 26.04.22, 09:05
  • Opened by: Martina Farela
  • Closed by: Fred
  • Closed on: 02.05.22, 10:27
  • Reason: Closed
  • Comment: Glad to help!

Ticket #23297 - Filter not working on search page

Hello, In the amp version, the product filter on the search page does not work. However, on the category page it does work. Attached link for you to see

https://solocolagenos.ddns.net/es/module/pkamp/search?searchstr=soria%20natural

Comments

Fred 26 Apr 2022, 10:36

Product filter works on Category page only, the same as in Classic prestashop theme

Martina Farela 26 Apr 2022, 10:43

And what should I do to hide it on the search page?

Fred 26 Apr 2022, 10:48

Sorry, now I see that’s not a filter but just a form to change the order and it must work. We are working to find out what’s wrong.

Martina Farela 26 Apr 2022, 10:53

Okey, I am looking forward to your response
Thanks

Fred 27 Apr 2022, 11:18

The issue has been fixed. Please test to confirm the change

Martina Farela 27 Apr 2022, 11:30

Sorry, but it still doesn’t work for me.
I’ve cleared the cache and tried again and it doesn’t work.
You can check it with any search. I tried with https://terminando.ddns.net/es/module/pkamp/search?searchstr=herbora

Martina Farela 28 Apr 2022, 15:34

Could you see where this error is coming from? Thanks for your time

Fred 28 Apr 2022, 15:36

not yet…

Martina Farela 29 Apr 2022, 07:58

Okey, I am looking forward to your response
Thanks

Fred 29 Apr 2022, 11:14

Ok, the fix is following
1. Open the file /modules/pkamp/classes/ampProductHelper.php
2. Find the line

$query->setSortOrder(new SortOrder('product', 'position', 'desc'));

3. Replace it with

$query->setSortOrder(new SortOrder('product', $params['sortOrder']['field'], $params['sortOrder']['direction']));
Martina Farela 02 May 2022, 08:22

Yes, it’s working, thank you very much, Great job