Shortcode Parameters overview
Any of the parameters in the shortcode will be prioritised over the default settings.
|Display the search|
|Select a date range|
|Select a single date|
|Allow customers to select categories|
|Keyword Search – Flexible|
|Keyword Search – Strict|| |
|Limit Search to one category|
|Limit Search to multiple categories (seperate with commas)|
|Sub Categories in the dropdown|
|Put it all together|
Display a category dropdown
You can specify the
category_dropdown parameters to be true. This will enable a dropdown selector that includes all of your product categories.
You can use the category dropdown together with the
Limit Search by categories
This will only include the specific categories. Any product that’s not in the category will not show up in the search results.
You’ll need your category slugs, which you can find under the WooCommerce product categories settings. Comma seperate the categories to include multiple categories.
[availability_search category_include="boat-tour, bus-tour"]
Category dropdown with specific categories
Limit the dropdown options by adding the
category_include parameter with the slugs of your specific categories. You can find the slug under the WooCommerce product category settings.
You can also add multiple categories by using a comma separator.
[availability_search category_dropdown="true" category_include="accessories, bus-tour"]
Custom Category Ordering
Added in v1.6.4
Categories shown in the dropdown are ordered by your default WooCommerce category ordering in the admin menu. You can drag and drop them in the product category settings as needed.
If you’d like to override the default behaviour and sort categories alphabetically by name, then you can place the following into your shortcode
Available ordering methods:
|Default sorting by WooCommerce Category order.||Go to your Product categories to change this.|
|Alphabetically sorted by the category name.|
|Sorted by the order you’ve written your categories inside |
|Ordered by the ID of categories.|
You can also replace
ASC (ascending) with
[availability_search category_dropdown="true" category_order="name, ASC"]
Sub Categories in the dropdown
[availability_search category_dropdown="true" category_include="parent, child" category_subcategory="true"]
You can mix parent categories and subcategories slugs inside the
category_include include tag.
category_subcategory="true" the category dropdown will display all subcategories of any parents categories.
You can add a keyword search along side the category selector by adding
keyword="strict" to the shortcode.
The keyword can either be flexible or strict.
Let’s say we have two products named:
- The Great Fishing Trip
- The Great Charter Trip
Flexible: If you search “Great Fish” then both 1 & 2 will show up because both have the word “great”. Flexible requires at least one partial match.
Strict: If you search “Great Fish” then only number 1 will show up, because strict requires each keyword (“great” & “fish”) to be a full or partial match in the product name.