Page 1 of 1

[SOLVED] Create a link to Product search result?

Posted: Wed Jul 04, 2012 11:27 pm
by micahgodbolt
Is there any way that I can create a link like {module_action_link module='Products' action='search'} that instead of linking to a search page, instead links to search results?

I want to do {module_action_link module='Products' action='search' searchterm="term"} - which will create a link to a products search with that term.

Re: Create a link to Product search result?

Posted: Fri Jul 06, 2012 4:04 pm
by micahgodbolt
Big thanks to Calguy for helping me out with this one. The key is to use the "do_search" action, rather than the "search" action.

The other key is knowing how to pass search parameters. The names of the params to send are listed at the top of the stock Products search template cd_prodname, cd_proddesc, cd_prodprice.

So the final Module Action Link looks like this


{module_action_link module='Products' action='do_search' text=$tagword cd_prodname=$tagword resultpage='search-results'}