Search Results not working if Search field is disabled

General ShopSite user discussion

Search Results not working if Search field is disabled

Postby bobthebuilder » Fri Oct 10, 2008 10:42 am

I'm using ShopSite 9.0. If I disable the "Search Field" in the Search Page Layout then the "Sort By" pop-up menu produces unexpected results. Namely, if I choose "Price: High to Low" then a more info page will load in or another page will load in. However, if I enable the "Search Field" then the Sort By menu options work as expected. I've unaltered the code in the classy template I'm using:

[-- IF SEARCHTOP --]
<!-- START Top Search Result Form -->
<tr>
<td class="se_search_form"><table class="se_search_form">
<tbody>

<tr class="se_form_search_row">
<td colspan="4" class="se_form_term">[-- SEARCHRESULT_FORM FORM_ONLY --]</td>
</tr>
<tr class="se_form__sort_row">
<td class="se_form_sort">[-- SearchSortBy --]</td>
<td class="se_form_numresult">[-- SearchResultCount --]</td>
<td class="se_form_prevnext">[-- SearchPrevNext --]</td>
<td class="se_form_perpage">[-- SearchResultsPerPage --]</form></td>
</tr>
</tbody>
</table></td>
</tr>
<!-- END Top Search Result Form -->
[-- END_IF --]

1. Is this a bug in ShopSite?

2. Is there a template tag I can use that will start the search <form> without outputting the html code for a search field?

Thanks in advance.
bobthebuilder
 
Posts: 35
Joined: Mon Sep 29, 2008 9:36 am

Postby Jim » Fri Oct 10, 2008 1:06 pm

Without the Search field there would be nothing to search for and therefore nothing to sort. So unless I am misunderstanding the issue the search field would be required for the sort option to work.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Postby bobthebuilder » Tue Oct 14, 2008 1:57 pm

This is how we would like it to work and you can tell me if it's possible:

1. A customer does a search for "Product A".
2. The Search Results page appears with found products.
3. At the top of the Search results page we ONLY want there to be the "Sort By" pop-up menu, pagination links, and the text for the number of results found.
4. In the middle of the Search Results page is where the found products will be listed.
5. At the bottom of the Search Results page we would like a new search field displayed along with the "Sort By" pop-up menu, pagination links, and the text for the number of results found.

Is this possible to do? My experience has shown me that when I choose to remove the "Search field" in the Search Page Layout settings then the "Sort by" pop-up menu no longer functions correctly. When you go to choose ANY option from the "Sort by" pop-up menu then it links to some product page instead of re-sorting the found results. However, if I choose to enable the Search field then the Sort by pop-up menu then works correctly. I'm assuming this is a bug in the software.
bobthebuilder
 
Posts: 35
Joined: Mon Sep 29, 2008 9:36 am

Postby Jim » Tue Oct 14, 2008 8:17 pm

Here is the result of the tag [-- SearchSortBy --]

Code: Select all
Sort by:<select class="search_sort_dropdown" name="sort_by" onchange="this.form.submit();">
<option value="1" selected="selected">Relevance</option>
<option value="2">Price: Low to High</option>
<option value="4">Price: High to Low</option>
<option value="8">Alphabetical: A to Z</option>
<option value="16">Alphabetical: Z to A</option>
</select>

Note that it has to be in a form to be submitted (onchange="this.form.submit()). So somehow you have to create the form and then it should work where ever you put it. The other fields you mention would also probably require a form so you need to put the appropriate form information in each section where you want the fields displayed. Note that when the form is submitted to resort the products it needs to know what the search terms were. So without having the search field there to maintain the search terms it would be difficult but not impossible to reproduce the search. (i.e. you might be able to use javascript to put the search term in some hidden field)
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Postby bobthebuilder » Tue Oct 14, 2008 9:12 pm

Jim wrote:Here is the result of the tag [-- SearchSortBy --]

Code: Select all
Sort by:<select class="search_sort_dropdown" name="sort_by" onchange="this.form.submit();">
<option value="1" selected="selected">Relevance</option>
<option value="2">Price: Low to High</option>
<option value="4">Price: High to Low</option>
<option value="8">Alphabetical: A to Z</option>
<option value="16">Alphabetical: Z to A</option>
</select>

Note that it has to be in a form to be submitted (onchange="this.form.submit()). So somehow you have to create the form and then it should work where ever you put it. The other fields you mention would also probably require a form so you need to put the appropriate form information in each section where you want the fields displayed. Note that when the form is submitted to resort the products it needs to know what the search terms were. So without having the search field there to maintain the search terms it would be difficult but not impossible to reproduce the search. (i.e. you might be able to use javascript to put the search term in some hidden field)


The SearchSortBy tag IS within a form definition on the web page. I've PM'd you the html code of the page to show you what the output looks like. I'll also PM you a link to the web page.
bobthebuilder
 
Posts: 35
Joined: Mon Sep 29, 2008 9:36 am


Return to User Forum

Who is online

Users browsing this forum: Google [Bot] and 57 guests