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.
[SOLVED] Create a link to Product search result?
- micahgodbolt
- Forum Members
- Posts: 149
- Joined: Thu Jul 29, 2010 11:09 pm
- Location: Portland, OR
[SOLVED] Create a link to Product search result?
Last edited by micahgodbolt on Fri Jul 06, 2012 4:05 pm, edited 1 time in total.
- micahgodbolt
- Forum Members
- Posts: 149
- Joined: Thu Jul 29, 2010 11:09 pm
- Location: Portland, OR
Re: Create a link to Product search result?
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'}
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'}