Learn about built-in plugin shortcodes.
In this article, we will cover available built-in plugin shortcodes.
A shortcode is a piece of text that allows you to add any dynamically generated data to your page.
In the case of Advanced Woo Search, you can use shortcodes to add the plugin's search form, search suggestions, and fixed search terms.
Shortcodes can be added in many ways: manually inside the classic editor, via the shortcode block editor, via a text widget, or through any page builder plugin.
Also, it is possible to add it via PHP code:
echo do_shortcode( '[aws_search_form]' );
[aws_search_form]
id
- search form ID ( PRO only )placeholder
- search input placeholder text. Default - inherit from the settings page.notfound_text
- text that will be displayed when there are no search results. Default - inherit from the settings page. ( PRO only )showmore_text
- text for 'Show more' button. Default - inherit from the settings page.min_chars
- minimum characters needed to start AJAX live search. Default - inherit from the settings page.show_loader
- show or hide the search form loader. Default - inherit from the settings page.show_more
- show or hide the 'Show more' button. Default - inherit from the settings page.ajax_search
- enable/disable AJAX live search. Default - inherit from the settings page.show_page
- show or hide results on a separate search page. Default - inherit from the settings page.show_clear
- show/hide clear input text button. Default - inherit from the settings page.mobile_screen
- enable/disable special mobile search results layout. Default - inherit from the settings page.buttons_order
- choose search form layout. Default - inherit from the settings page.target_blank
- open product page in a new browser tab. Default - inherit from the settings page. ( PRO only )use_analytics
- enable/disable Google Analytics tracking. Default - inherit from the settings page.show_addon
- show product title inside the search input on mouse enter. Default - inherit from the settings page. ( PRO only )filters
- list of search form filters. ( PRO only )search_timeout
- timeout value for AJAX search. Default - inherit from the settings page.This shortcode is used to display the plugin's search form. You can use a variety of different additional parameters to customize this search form as you want.
Shortcode is only one of the ways of adding the plugin's search form inside your shop pages. Learn more about all possible ways here: Adding Search Form.
[aws_search_suggestions]
id
- search form IDalways_show
- show suggestions even if they are disabled in the plugin settings page. Default = true
.max_number
- maximum number of possible suggestions. Default - inherit from the settings page.suggestion_words_max
- maximum number of words per suggestion. Default - inherit from the settings page.min_word_length
- minimum number of characters for the search term to use for suggestions generation. Default = 2
.misspell_fix
- disable/enable misspellings fix and use them as suggestions. Default = true
.min_repeats
- minimum number of total word repeats to be added to the suggestions phrase. Default = 1
.include_variations
- use child product titles for suggestions generation. Default = false
.This shortcode allows you to show search suggestions. They will appear as a clickable list of search terms. Clicking on each term will force the page to reload and search for the desired terms.
Shortcode inherits the parameters from the settings page options related to search suggestions, but you can overwrite them with shortcode parameters.
Learn more about search suggestions here: Search Suggestions.
[aws_search_did_you_mean]
always_show
- show terms even if the Misspelling fix
option is set to Off. Totally disable misspelling fix
. Default - false
.This shortcode allows you to show a fixed (similar) search terms list relative to the current user search query. That list will be shown only if the current search query returns no results.
Such an option is available if, inside the plugin settings page, you set Off. Instead show text "Did you mean ...
for the Misspelling fix
option.
Additionally, if the shortcode parameter always_show
is set to true
, then the similar terms list will be shown even when the Misspelling fix
option is set to Off. Totally disable misspelling fix
.
Learn more about misspell fixes: Misspelling fix.
[aws_search_showing_results_for]
always_show
- show terms even if the Misspelling fix
option is set to On. Automatically search for fixed terms
. Default - false
.This shortcode allows you to show fixed (similar) search terms that were used for the current search query instead of user input.
Such an option is available if, inside the plugin settings page, you set On. Additionally show text "Showing results for ..."
for the Misspelling fix
option.
Additionally, if the shortcode parameter always_show
is set to true
, then fixed terms will be shown even when the Misspelling fix
option is set to On. Automatically search for fixed terms
.
Learn more about misspell fixes: Misspelling fix.
[aws_search_terms]
terms
- comma-separated list of search terms. Default = ''id
- search instance ID that must perform that search. Default = current search page instance ID or 1
. (PRO only)filter
- search filter ID that must perform that search. Default = current search page filter ID or 1
. (PRO only)This shortcode allows you to show a list of custom search terms. These can be any search terms. This is very useful if you want to promote some products. In this case, you can just add a list of custom search terms near the search form.
When clicking on any of these terms, the user will be redirected to the search results page for the desired term.