Knowledgebase: Smart Search
How do I prevent the Advanced Search from flashing before the initial search results are displayed?
Posted by - NA - on 04 May 2011 03:46 PM
When the first search is executed by a visitor the advanced search box is displayed for a second or two while the page calculates the size of the display.

To prevent this from occurring you can hard code these values in your file. However, these values will be different for all stores, so you may need a bit of trial an error.

There are four values. These are the sizes of the advanced search input, and the basic (main) search input.

- $mainSearchHeight
- $mainSearchWidth
- $advancedsearchHeight
- $advancedSearchWidth

Make this edit to the _search.php file:

Find this code near line 29:

// Ajax update page sizes for this session //
if ($update_sizes){

$search_page_sizes['mainSearchHeight'] = $mainSearchHeight;
$search_page_sizes['mainSearchWidth'] = $mainSearchWidth;
$search_page_sizes['advancedSearchHeight'] = $advancedSearchHeight;
$search_page_sizes['advancedSearchWidth'] = $advancedSearchWidth;

x_session_save();
exit;

}


Replace it with a set number for your store: IMPORTANT: the values are just for a jump off point, these may need to be changed depending on your store layout.:

$search_page_sizes['mainSearchHeight'] = 50;
$search_page_sizes['mainSearchWidth'] = 600;
$search_page_sizes['advancedSearchHeight'] = 360;
$search_page_sizes['advancedSearchWidth'] = 540;

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments: