With a product search, visitors find the right product on your site themselves. affiliate-toolkit offers two kinds of search:
- Search in your product database: the search form filters the products you have imported, by keyword, manufacturer, price, shop, categories or your own custom fields.
- Live search in the shop interfaces: the keyword is sent directly to the APIs of your shops, and the results are shown without importing anything.
Both consist of two parts: a search form and a results shortcode on the target page. You can put both on the same page or send the form to a separate results page.
Prerequisites: the Frontend Search & Filter extension, installed and activated. It is included in the affiliate-toolkit passes. Without it, the shortcodes, templates and settings described here are not available.
Overview: the setup in four steps
- Create a results page and add a results shortcode:
[atkp_list]for your product database or[atkp_livelist]for the live search. - Add a search form with
[atkp_searchform]and point it to the results page. - Optional: redirect the WordPress search to the results page.
- Optional: show the search form in a sidebar with the filter widget.
The search only works with a results shortcode on the target page. The search form only passes the values in the URL; without the results shortcode no products are shown.
Insert a search form
The search form is inserted with the [atkp_searchform] shortcode. The easiest way is the shortcode generator: choose the output type Search Form, select a template and the target page, and copy the shortcode.
[atkp_searchform template='searchtext' targetpage='123'][/atkp_searchform]The extension ships with these search form templates:
| Template | Fields | Suitable for |
|---|---|---|
searchtext | keyword field and search button | product database and live search |
searchform (default) | manufacturer, price slider, search button in one row | product database |
searchbox | manufacturer, price slider, sort order and search button, stacked | product database, narrow columns and sidebars |
compareproduct | four product selections and a compare button in one row | comparing selected products |
comparebox | four product selections and a compare button, stacked | comparing products in sidebars |

Attributes of [atkp_searchform]
| Attribute | Default | Description |
|---|---|---|
template | searchform | Name of a search form template from the table above or the ID of your own search form template. |
targetpage | current page | ID of the page with the results shortcode. If you leave it out, the form submits to the page it is on (or to the target page stored in your own template). |
filter | empty | Preset filter values in URL format, for example shop=12. |
Where do I find the page ID? Open the results page in the WordPress editor. The ID is the number after post= in the address bar, for example post.php?post=123&action=edit. In the shortcode generator you simply pick the page from a list.
Show results from your product database
On the results page, an [atkp_list] shortcode without list ID shows the products that match the search. In the shortcode generator, choose the output type Dynamic Filter List, set fixed filters if you need them, enable Parse parameters and choose the number of items per page.
[atkp_list filter='productstatus=publish' template='grid_3_columns' parseparams='yes' itemsperpage='25'][/atkp_list]
| Attribute | Default | Description |
|---|---|---|
parseparams | no | With yes the shortcode reads the values of the search form from the URL. Required for every search. |
filter | empty | Fixed filter in URL format. It is combined with the values from the search form, so you can, for example, limit a full-text search to one category. |
itemsperpage | 0 (generator: 25) | Number of products per page. If there are more results, a pagination is added. |
template | wide | Template for the results, e.g. grid_3_columns or the ID of your own template. |
limit | list default | Maximum number of products in total. |
A missing
parseparams='yes'is the most common reason why a search shows all products or none.
Search parameters and filter values
The search form passes these parameters in the URL. You can use the same names in the filter attribute, separated by &:
| Parameter | Effect |
|---|---|
search | Products whose title contains the keyword. |
shop | Products of this shop ID (several IDs separated by commas). |
manufacturer, brand | Products of this manufacturer or brand. |
minprice, maxprice | Price range of the sale price. |
minamountsaved, maxamountsaved | Range of the saved amount. |
orderby | Sort order: price-asc, price-desc, amountsaved-asc, amountsaved-desc, titlerank-asc, titlerank-desc. |
productstatus | publish, draft or all. Without this value only published products are shown if the Frontend Product Pages extension is active, otherwise published and draft products. |
productcategory | Products in these product category term IDs; other taxonomies use their own field name. |
product1 to product5 | Specific product IDs, used by the compare templates. |
customfield_<name>, cf_<name> | Global custom fields and fields of field groups (dropdown, yes/no; numeric ranges with the prefix min/max). |
To show both published products and drafts, use filter='productstatus=all'.
Live search in the shop interfaces
The live search sends the keyword directly to the shop APIs and shows the results on your page. Nothing is imported. Use it with the searchtext form, because the live search only evaluates the keyword. The search runs via AJAX in parallel for every shop.
Results without shop headings
[atkp_livelist template='simple_live' livetemplate='secondwide'][/atkp_livelist]Results with shop headings
Identical, but each shop block starts with a heading such as "Search results at Amazon".
[atkp_livelist template='default_live' livetemplate='secondwide'][/atkp_livelist]
| Attribute | Default | Description |
|---|---|---|
template | default_live | default_live with shop headings or simple_live without. |
livetemplate | wide | Product template for each result. All system templates and your own templates are supported. |
shop_ids | all shops | Limit the search to certain shops, several IDs separated by commas, e.g. 123,456. |
limit | 10 | Maximum number of results per shop. Some APIs have a lower maximum that cannot be raised. |
filter | empty | Preset values in URL format, e.g. category=… for an API category. |
elementcss, containercss | empty | Additional CSS classes for the result elements and the container. |
Every live search sends one request per shop to its API. Keep an eye on the request limits of your partner programs, and limit the search with
shop_idsif you have many shops.
Redirect the WordPress search
You can send the normal WordPress search to your results page, so the search field of your theme finds products too. Open Settings → Search and choose the Redirect mode and the Target page.

- None: the WordPress search works as usual.
- Redirect if no results found: if the WordPress search finds no posts, the visitor is sent to the results page.
- Redirect always: every WordPress search is sent to the results page.
The keyword is passed as ?search=…, so the results page needs either [atkp_list … parseparams='yes'] or [atkp_livelist].
In the same tab you set the Prefix price (default €) and Suffix price (default empty) shown at the price slider of the search forms.
Create your own search form templates
If you want your own design or want to filter by your own custom fields, create your own search form template. You can also duplicate an existing one.
- Go to affiliate-toolkit → Templates and create a new template.
- Choose the type Search form template. This type only exists while Frontend Search & Filter is active.
- Optionally set the Filter target page and Open result page in new tab.
- Build the form with the toolbar above the editor: Containers → Search form inserts the form frame, Form fields the search field, shop, manufacturer, price, order by, product 1 to 4 and the search button, Custom fields your own fields.
- Use the template ID in the shortcode:
[atkp_searchform template='456'][/atkp_searchform].
The template is written in Blade with HTML and CSS. This example combines keyword, shop and price:
<div class="atkp-searchcontainer">
<form action="{{$parameters->filtertarget}}" method="get">
{!! $controlhelper->create_frontendcontrol( null, null, 'search', '', false, $parameters->filterparams ) !!}
{!! $controlhelper->create_frontendcontrol( null, null, 'shop', '', false, $parameters->filterparams ) !!}
{!! $controlhelper->get_pricecontrol( $parameters->filterparams ) !!}
<input type="submit" class="atkp-submitbutton" value="{{$translator->get_search()}}" />
</form>
</div>Troubleshooting
The search shows no products
Check that the target page contains a results shortcode and that [atkp_list] has parseparams='yes'. Also check targetpage: it must be the ID of the page with the results shortcode.
Draft products are not found
With the Frontend Product Pages extension active, the search only shows published products. Add filter='productstatus=all' to include drafts.
The live search stays empty
Check the API access of your shops under affiliate-toolkit → Shops. Without a keyword the live search shows the hint to enter a search term.