Toolset lets you create a custom search for products. It can include filters for product fields and categories but also custom fields, taxonomies, and more.
Setting up a page with the search View
- Add a new page.
- Insert the Toolset View block.
- In the View-creation wizard, enable the Search option.
- Choose Products as the type of content this View will display.
Creating the product search form
In the upper part of your View’s editing area you add filters.
- Click on the Add Search Field button to add filters.
- Use the Add Search Button to add the submit button which will trigger the searching.
- Insert the Toolset Grid block and drag-and-drop your filters into it to arrange your filters into columns.
Creating search results
In the bottom part of your View’s editing area you design your search results.
- Insert blocks into the WordPress Archive Loop area to design a single item of your View loop.
- Use the Toolset Heading and Single Field blocks with dynamic sources to display your product title, excerpt, custom fields, and taxonomies.
- Use blocks from the Toolset WooCommerce section to insert WooCommerce elements such as the Add to Cart Button, Product Price, and more. You will notice that all Toolset WooCommerce blocks allow you to select a custom or native output type.
What else you can do with your product search
You can enhance your search by:
- styling your filters
- adding pagination
- making results update on-the-fly using AJAX
- setting up the View search and results side by side:
For video instructions and more information visit the lesson about creating a custom search.
Display dynamic sources using WordPress core and popular block plugins
Toolset comes with a big collection of blocks to display dynamic sources (custom fields, WordPress fields, WooCommerce fields, and taxonomies). However, you can also display Dynamic Sources using WordPress core blocks and popular block plugins.
Use the following steps to display a Dynamic Source in any supported block:
- Insert or select a block.
- In the right sidebar, expand the Dynamic Sources section.
- Toggle on the option for any of the supported fields in that block.
- Use the dropdowns that appear to select the dynamic source you want this block to display for that field.
Display Dynamic Sources inside all text blocks
Toolset allows you to display Dynamic Sources, like custom fields, inside any text blocks like headings, buttons, and more. This includes WordPress core blocks, Toolset blocks, and popular block plugins.
To display any Dynamic Source inline, insert or select a block with a text input and look for the Inline Fields button. Dropdown menus will appear, allowing you to select a Dynamic Source.
For more information, check out the lesson about displaying Inline Fields.
Add search fields by Price and On-Sale status
You can use various search fields in your custom searches for products.
Toolset allows you to add filters by WooCommerce Price and On-sale Status fields. The price field displays as a range slider while the on-sale status is a simple checkbox.
To insert any of these two fields, click the Add Search Field in the editor and select them using the dialog for selecting a field.
Style the custom product search
Toolset allows you to easily create your custom product search but it also needs to look good. You can easily do this by following some simple rules and guidelines.
Visit the dedicated lesson to learn all about styling custom searches.
Créez des listes de publication personnalisées
Related topics
- Assigning Templates to Posts Conditionally
- How to Display WooCommerce Orders on the Front-end
- Using the WooCommerce Subscriptions plugin with Toolset
- Using WooCommerce Fields in Product Forms
- Selecting WooCommerce Blocks Output Type
- Adding Toolset Blocks to the WooCommerce My Account Page
- Creating a Custom List of WooCommerce Products for a Taxonomy
- Building a Custom WooCommerce Shop Page
- Creating a Custom List of Related WooCommerce Products
- Creating Custom Templates for WooCommerce Products
- Adding a Custom Taxonomy to WooCommerce Products
- Creating a Custom WooCommerce Product Slider
- Adding Custom Fields to WooCommerce products
- Creating Front-end Forms for Adding WooCommerce Products
- Charge users for registering premium accounts
- Charge users for submitting content
- Custom WooCommerce Roles and Admin Capabilities