Advanced Search Function

For general questions and discussions specific to the AbleCommerce GOLD ASP.Net shopping cart software.
Post Reply
webbspot
Ensign (ENS)
Ensign (ENS)
Posts: 14
Joined: Sat Nov 09, 2013 7:42 am

Advanced Search Function

Post by webbspot » Tue Nov 12, 2013 10:20 am

I have searched the forum a bit and have not been able to find an answer to this. Please help me out.

How would we go about making a picture or menu going to a custom searched option?

For example, in advanced search you can select price ranges, etc.... What I am wanting to do is have a link on the front page that says (gifts under 50.00) or something similar. I would think that somehow a url is generated from the advanced search, but it is not visible. Any ideas on how to link custom search functions to pics and or text?

Thanks,

David

jguengerich
Commodore (COMO)
Commodore (COMO)
Posts: 436
Joined: Tue May 07, 2013 1:59 pm

Re: Advanced Search Function

Post by jguengerich » Wed Nov 13, 2013 11:03 am

The AdvancedSearch.aspx page uses its own control values on postbacks to set the search parameters. You'd probably have to modify that page (.cs file) to also look for parameters in the query string (url). Then your "gifts under 50.00" link could be something like "~/AdvancedSearch.aspx?HighPrice=50".
Jay

webbspot
Ensign (ENS)
Ensign (ENS)
Posts: 14
Joined: Sat Nov 09, 2013 7:42 am

Re: Advanced Search Function

Post by webbspot » Wed Nov 13, 2013 1:25 pm

Ok, I see what you are saying. It also pretty easy to just "input the fields in to the .aspx page itself and get the form filled out. That leads to a few other questions. As you can tell, I am no pro at the actual DB side of this.

Can you manually select a manufacturer ( or anything that has a dropdown as opposed to a "text field"?
Can you force the page to load the searched products immediately rather than having to click or hit the search button?

This seems like a pretty common thing that would need to be done for a lot of people. I am not sure why this seems to be such a hard thing for me to figure out.

This is especially valuable this time of year for "holiday gift ideas" basically looking up and outputting popular search requests...ie, mens shirts under 50.00. Kitchen supplies under 100.00 etc....

Any more help on this would be greatly appreciated.

Thanks again,
David

jguengerich
Commodore (COMO)
Commodore (COMO)
Posts: 436
Joined: Tue May 07, 2013 1:59 pm

Re: Advanced Search Function

Post by jguengerich » Wed Nov 13, 2013 2:00 pm

For selecting an item from a dropdown, use the SelectedIndex or SelectedValue property of the dropdown.
If you want to run the code that normally runs when the button is clicked as soon as the page loads, just call the button's OnClick method (SearchButton_Click in this case) at the end of Page_Load. You can put it inside an if statement with appropriate logic if you don't want to always do the search when the page loads. For example, remember that Page_Load will run on postbacks; use the "if (!Page.IsPostBack)... " pattern already used other places in the code to avoid running the _Click code twice when the user actually clicks the button.
Jay

Post Reply