Zen Cart Logo
Forums / General Questions / Pagination problem in my search results

Pagination problem in my search results

Views: 1,297

Results 1 to 12 of 12
14 Oct 2012, 7:24 AM
#1
willy12 avatar

willy12

New Zenner

Join Date:
Nov 2010
Posts:
64
Plugin Contributions:
0

Pagination problem in my search results

Hello,
I'm not sure if I'm posting this in the right thread but I have an issue with the search feature as well. The site is https://www.aquafinatic.com and as an example to cause the error I use the word "feed" in the search box. You will see that it will show about 4-5 pages with results but when clicking on the next page all the previous found pages disappear.
I'm fairly sure I didn't change any main files for the search function but a professional opinion would be appreciated.
I use version 1.3.9h.

Thank you

15 Oct 2012, 3:10 PM
#2
willy12 avatar

willy12

New Zenner

Join Date:
Nov 2010
Posts:
64
Plugin Contributions:
0

Re: Pagination problem in my search results

Thank you for putting the post into the right place!......Now if anyone has a solution, that would be wonderful.:smile:

17 Oct 2012, 3:55 PM
#3
willy12 avatar

willy12

New Zenner

Join Date:
Nov 2010
Posts:
64
Plugin Contributions:
0

Re: Pagination problem in my search results

No one?.....:huh:

17 Oct 2012, 6:29 PM
#4
david_allen avatar

david_allen

Zen Follower

Join Date:
Feb 2008
Location:
Amersham, Buckinghamshire, United Kingdom
Posts:
141
Plugin Contributions:
1

Re: Pagination problem in my search results

Looks like all the page links 1 2 3 4 5 [Next>>] have lost the 'search_in_description' parameter.
Thus on initial search (when it does search in the description) it finds 5 pages worth. Subsequent pages (when search_in_description isn't set) only search in the product name, so only find 2 pages.
Hope this points you in the right direction.

18 Oct 2012, 3:38 AM
#5
willy12 avatar

willy12

New Zenner

Join Date:
Nov 2010
Posts:
64
Plugin Contributions:
0

Re: Pagination problem in my search results

David Allen:

Looks like all the page links 1 2 3 4 5 [Next>>] have lost the 'search_in_description' parameter.
Thus on initial search (when it does search in the description) it finds 5 pages worth. Subsequent pages (when search_in_description isn't set) only search in the product name, so only find 2 pages.
Hope this points you in the right direction.

Thanks for the reply David.
Yes, you did point me into the right direction. I also want to point out that this is a bug in ZenCart, cause I checked the file in the original fileset and it also has the wrong setting.

I will explain:
the file I changed to make the search issue work again:
/includes/modules/pages/advanced_search_result/header_php.php

on line 258 look for: $_GET['search_in_description'] = '0';

change to: $_GET['search_in_description'] = '1';

This was causing the additional pages not to look for the word in the descriptions entered in the search box.

Hope this helps others.

18 Oct 2012, 2:36 PM
#6
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Pagination problem in my search results

I am so far unable to reproduce this issue on a clean v1.5.1 ...

What version of Zen Cart are you using?

Clean install or an upgrade?

What happens if you switch to Classic Template, with the original code, does it work?

18 Oct 2012, 9:17 PM
#7
willy12 avatar

willy12

New Zenner

Join Date:
Nov 2010
Posts:
64
Plugin Contributions:
0

Re: Pagination problem in my search results

Ajeh:

I am so far unable to reproduce this issue on a clean v1.5.1 ...

What version of Zen Cart are you using?

Clean install or an upgrade?

What happens if you switch to Classic Template, with the original code, does it work?

I'm using version 1.3.9h and it was a clean install. Even with the classic template it still happens.

Thanks for all the help.

18 Oct 2012, 11:56 PM
#8
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Pagination problem in my search results

I have tried v1.3.9h and v1.5.1 in both the search header and sidebox and added a word to all descriptions on 12 products and changed my maxium listing to 3 per page and I am not able to reproduce this problem and I have that setting you are changing from 0 to 1 set at 0 ...

Could you check the setting in the:
/includes/templates/templates_default/sideboxes/tpl_search_header.php

and see what it reads on the line:

  $content .= zen_draw_hidden_field('search_in_description', '1') . zen_hide_session_id();

Could you check the setting in the:
/includes/templates/your_template_dir/sideboxes/tpl_search.php

and see what it reads on the line:

  $content .= zen_draw_hidden_field('search_in_description', '1') . zen_hide_session_id();
19 Oct 2012, 8:28 AM
#9
david_allen avatar

david_allen

Zen Follower

Join Date:
Feb 2008
Location:
Amersham, Buckinghamshire, United Kingdom
Posts:
141
Plugin Contributions:
1

Re: Pagination problem in my search results

Ajeh:

Could you check the setting in the:
/includes/templates/templates_default/sideboxes/tpl_search_header.php

Could you check the setting in the:
/includes/templates/your_template_dir/sideboxes/tpl_search.php

Actually I think the OP's problem isn't there. It appears to do the initial search OK (with the search in description correctly set). It is in trying to go to page 2 that the problem arises. So I suspect that the problem is more in the direction of the advances_search_result page.
/includes/templates/templates_default/templates/tpl_advanced_search_result_default.php.
I think it's the link behind the 1 2 3 4 5 [Next>>] which is missing the search_in_description parameter.

19 Oct 2012, 8:58 PM
#10
willy12 avatar

willy12

New Zenner

Join Date:
Nov 2010
Posts:
64
Plugin Contributions:
0

Re: Pagination problem in my search results

Ajeh:

I have tried v1.3.9h and v1.5.1 in both the search header and sidebox and added a word to all descriptions on 12 products and changed my maxium listing to 3 per page and I am not able to reproduce this problem and I have that setting you are changing from 0 to 1 set at 0 ...

Could you check the setting in the:
/includes/templates/templates_default/sideboxes/tpl_search_header.php

and see what it reads on the line:

$content .= zen_draw_hidden_field('search_in_description', '1') . zen_hide_session_id();

> 
> Could you check the setting in the:
> /includes/templates/your_template_dir/sideboxes/tpl_search.php
> 
> and see what it reads on the line:
> ```
  $content .= zen_draw_hidden_field('search_in_description', '1') . zen_hide_session_id();

It shows exactly the same thing in my files.....
But as David mentioned in his post the problem is probably is part of tpl_advanced_search_result_default.php, nevertheless, by switching that 0 to 1 it is making it work.

If you need other ways to troubleshoot or anything else you would like for me to check, please let me know I would be more than happy to help.

Thank you very much.

19 Oct 2012, 10:40 PM
#11
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Pagination problem in my search results

willy12:

I'm using version 1.3.9h and it was a clean install.But what addons/plugins have you installed?
willy12:

Even with the classic template it still happens.
What template did you install?
Are ANY of your files under the /includes/templates/template_default/ folder changed from the original contents for those files? If so, which ones and why? (use a text-file-compare tool like WinMerge to inspect them easily)

Have you changed any files in the /includes/index_filters/ folder? If so, which ones and why?
Have you changed any files in the /includes/modules/ folder or subfolders? If so, which ones and why?

20 Oct 2012, 1:55 AM
#12
willy12 avatar

willy12

New Zenner

Join Date:
Nov 2010
Posts:
64
Plugin Contributions:
0

Re: Pagination problem in my search results

DrByte:

But what addons/plugins have you installed?

What template did you install?
Are ANY of your files under the /includes/templates/template_default/ folder changed from the original contents for those files? If so, which ones and why? (use a text-file-compare tool like WinMerge to inspect them easily)

Have you changed any files in the /includes/index_filters/ folder? If so, which ones and why?
Have you changed any files in the /includes/modules/ folder or subfolders? If so, which ones and why?

Hi Dr. Byte,

I always use Winmerge a really great tool and over the last 3 years and I have become quite familiar with the files. As far as the files you mentioned, I did make some changes in the default_filter.php file but only regarding the product_status. The change was made because I added a Discontinued feature.
In the /includes/modules/ folder or subfolders there were some changes as well but I have spent numerous days combing through them to make sure the search feature wasn't affected. The files that were changed like attributes.php had additions to accomodate model numbers etc.

If you go to my site, you will see that lots has changed for the good, many inhanced features but not necessarily add-ons from the "Zen Cart add-ons". A lot of the "Zen Cart add-ons" do not accomodate products with multiple attributes and have to be customized further.

Ultimately, it would be hard for you guys to troubleshoot this as there are many changes made but not from what my understanding is where Zen Cart is pulling the functionality for the search, as I had discussed with some other members in the thread previously none of those files were touched.

I only mentioned errors in Zen Cart because the file that was altered in order to make it work correctly was never changed in the past including the files that sort of work with it.

I'm just glad it's working now...I will keep checking, if I find what caused it if anything, I will post it here.

Thank you.