The Product Filter – Attributes block is part of the WooCommerce Product Search extension and provides a live product attribute filter for your shop. While your customers choose the desired terms, it finds matching products and shows them on the shop page.
This live filter displays the terms of a product attribute. The customer can click a term and the shop page will show products that are related to it.
A typical example for this would be a Color attribute — the live filter would show the different choices of color. In the following examples, two blocks allow to refine the results by choosing a color and a size.
The following settings allow to configure the Product Filter – Attributes block.
Settings↑ Back to top
The settings described below determine the appearance and behavior of the filter block.
Attribute↑ Back to top
You must select an attribute used by the block.
- Attribute – Choose the product attribute for this block here.
While you have not chosen an attribute yet, the block while ask you to select one:
Choose an attribute from those available in the Attribute dropdown. Only global product attributes can be used, please refer to the explanatory Notes at the bottom of this documentation page if you are not sure about what these are.
Display↑ Back to top
- Show on shop pages only – Use this option to display the block on relevant shop pages only. This includes the shop page, product tag and product category pages etc. We recommend to leave this option disabled if you place the block directly on a page which is not a shop page, enable it if you place it in a sidebar that should show the block for shop pages.
User Interface↑ Back to top
Depending on the Style chosen, some options may or may not be available. The options offered will be shown as applicable to the particular Style.
- Style – Offers options on how to display the terms: List, Inline, Select or Dropdown.
- Show thumbnails – Enable this option to show thumbnails for the terms.
- Show thumbnails for selected – Available when Dropdown is chosen as Style. If enabled, displays thumbnails also for the selected terms.
- Show names – Enable this option to show the names of the terms.
- Show product counts – If enabled, the number of related products per term will be shown.
- Hide terms without products – This will automatically hide terms that have no related products.
- Text for no selection – This option is available when Dropdown is selected as Style and determines the text that is shown in the Dropdown field when no item is selected.
- Number of terms – If a number is given, this limits the number of terms shown.
- Size – Available when Select is chosen as Style. Determines the display size of the select box.
- Height – Available when Dropdown is chosen as Style. If left empty, the choices of the dropdown are shown below when the field gains focus. If a plain number is input, e.g. 5, the Dropdown will adopt a fixed height to show the indicated number of entries. If a number with a CSS unit* is used, e.g. 120px, the Dropdown will adopt a fixed height as per the indicated unit. *Allowed CSS units: px, mm, cm, in, pt, pc, em , ex, ch, rem, vw and vh.
- Toggle the component – Hide the filter component when it has no options, is enabled by default or can be disabled.
Order↑ Back to top
- Order by … – Use this option to determine the order in which the terms are shown.
Terms↑ Back to top
- Filter – This option should be enabled for live filtering.
- Multiple – If you want to let visitors select more than one term, enable this option.
- Show – This will determine whether a) All terms are shown, or b) with Set, only those that are within the context of the selected term are shown.
- Terms to include – You can indicate the terms that should be included here. If left empty, all terms are displayed. Indicate terms by ID, slug or name and separated by comma.
- Terms to exclude – Indicate the terms that should be excluded here by ID, slug or name and separated by comma. If Terms to include are given, they override this field completely – use either of them but not both.
Heading↑ Back to top
- Show heading – This option will display the heading for this filter.
- Heading – You can input a customized heading here or leave it empty to use the default. The heading will be displayed when there are terms to show, it will be hidden when there are none.
- Heading for no results – You can input the text of an alternative heading to be displayed when there are no results.
- Heading ID – This sets the ID of the heading element.
- Heading Class – This sets the class of the heading element.
- Heading Element – Here you can choose which HTML tag is used as the heading element.
Container↑ Back to top
- Container ID – This sets the ID of the filter’s main div container element.
- Container Class – This adds to the class of the filter’s main div container element.
Notes↑ Back to top
The Product Filter – Attributes block supports global product attributes. Instances cannot be used to filter custom product attributes. We strongly recommend to only use global product attributes as the proper method to relate any product to its attributes, including those that are used on a single instance of a product. To learn more about how to create and use global product attributes, please refer to this section on Product Attributes.