nopCommerce v1.9 want to go to advanced search from Homepage SearchBox.ascx

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 anni tempo fa
nopCommerce v1.9
want to go to advanced search from Homepage SearchBox.ascx

right now there is search box but I added advanced link and not sure what I have to modify so can go to search page with advanced search already open.
12 anni tempo fa
In version 1.9 go to this control
NopCommerceStore > Modules > Search.ascx

Go to like 69 and change this line
bool advSearch = cbAdvancedSearch.Checked;


to


bool advSearch = CommonHelper.QueryStringBool("as");

if (advSearch)
    cbAdvancedSearch.Checked = true;

if (!advSearch)
    advSearch = cbAdvancedSearch.Checked;


Now, when you want the advanced search to be selected, append "as=true" to the query string.

http://www.mystore.com/search.aspx?searchterms=hello+world&as=true

If you want to modify the SearchBox control, you can go to the SearchBox.ascx and change line 36 to
Response.Redirect(string.Format("~/search.aspx?searchterms={0}&as=true", HttpUtility.UrlEncode(txtSearchTerms.Text)));


-D
12 anni tempo fa
thank you.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.