[SOLVED] Create a link to Product search result?

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
User avatar
micahgodbolt
Forum Members
Forum Members
Posts: 149
Joined: Thu Jul 29, 2010 11:09 pm
Location: Portland, OR

[SOLVED] Create a link to Product search result?

Post 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.
Last edited by micahgodbolt on Fri Jul 06, 2012 4:05 pm, edited 1 time in total.
User avatar
micahgodbolt
Forum Members
Forum Members
Posts: 149
Joined: Thu Jul 29, 2010 11:09 pm
Location: Portland, OR

Re: Create a link to Product search result?

Post 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'}
Post Reply

Return to “Modules/Add-Ons”