Zen Cart Logo
Forums / General Questions / User-friendly Search results page

User-friendly Search results page

Locked

Views: 1,249

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
30 Sep 2007, 6:29 PM
#1
x_o avatar

x_o

New Zenner

Join Date:
May 2007
Posts:
21
Plugin Contributions:
0

User-friendly Search results page

I would like to modify the search results page when it says 'There is no product that matches the search criteria.' and include the Advanced Search fields. In other words, when search result is empty Advanced Search is offered on the same page.
I suppose I should edit \includes\modules\product_listing.php file but I am not familiar with PHP.
Please advise how to achieve this so the Search Engine will be more user-friendly.
Thanks.

1 Oct 2007, 9:14 AM
#2
drbyte avatar

drbyte

Sensei

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

Re: User-friendly Search results page

/includes/modules/pages/advanced_search_result/header_php.php
near the bottom of the file, you have a section of code like the following.
Add the highlighted lines to get the effect you mentioned:```
$breadcrumb->add(NAVBAR_TITLE_1, zen_href_link(FILENAME_ADVANCED_SEARCH));
$breadcrumb->add(NAVBAR_TITLE_2);

[B]$result = new splitPageResults($listing_sql, MAX_DISPLAY_PRODUCTS_LISTING, 'p.products_id', 'page');
if ($result->number_of_rows == 0) {
$messageStack->add_session('search', TEXT_NO_PRODUCTS, 'caution');
zen_redirect(zen_href_link(FILENAME_ADVANCED_SEARCH, zen_get_all_get_params('action')));
}
[/B]

// This should be last line of the script:
$zco_notifier->notify('NOTIFY_HEADER_END_ADVANCED_SEARCH_RESULTS', $keywords);

1 Oct 2007, 10:54 AM
#3
x_o avatar

x_o

New Zenner

Join Date:
May 2007
Posts:
21
Plugin Contributions:
0

Re: User-friendly Search results page

Perfect! Thanks Dr.Byte!