GET FREE VERSION GET THE PRO VERSION

Customize Results

Learn how to customize the look of plugin search results items.

In this article

Customize search results views

One of the main plugin features - ability to customize search results view.

You can hide or display the following product data inside the search results list:

  • Title
  • Description
  • Image
  • Price
  • Taxonomies ( categories and tags )
  • SKU number
  • Stock status
  • Reviews count and rating
  • Attributes
  • 'Add to cart' button

You can control the display of all these data throw plugins settings page inside Search Results tab.

Here is the default search results view:

Search results view

Search results view

You can see product image, title, excerpt, price, rating, reviews and categories.

If you like minimalism or you just have many products and want to display them in search results in a compact way you can set the search results view to something like that:

Search results with title and price

Search results with title and price

If you have product variation you can also display them in the search results block.

Product variations

Product variations

You can also add term search results in the top of the search results list. To enable such terms archive pages search just go to the plugin settings page and find Archive pages option. Inside it just enable all needed fields.

Taxonomies archive pages search

Taxonomies archive pages search

Custom styles

Perhaps you want to change the size or color of the font for the product title. Or you want to change the color of the background. All this and more is possible with the custom css styles for plugin search results.

For example, to make the title of product results bigger and set its color to red we can use the following styles:

.aws-search-result .aws_result_title {
    color: red;
    font-size: 16px;
}
Search results with custom styles

Search results with custom styles

More examples of custom styles for search results you can find here: Customize Search Results Styles.

Search results layouts

With the PRO plugin version it is possible to choose from several search results layouts.

For example, you can display your products results in grid view.

Search results with grid layout

Search results with grid layout

More about this feature you can read here: Search Results Layouts.

PHP hooks

Perhaps default customizing options are not enough for you and you want something more. For example, you want to display some custom data for product results. Data like custom fields, custom taxonomies, shipping values, etc.

In this case you can use built-in plugin hooks.

For example - we have product_brand custom taxonomy and want to display its values for products that have such. Here we can use built-in aws_excerpt_search_result plugin filter to achieve our goal. Code snippet can looks like that:

add_filter( 'aws_excerpt_search_result', 'my_aws_excerpt_search_result', 10, 2 );
function my_aws_excerpt_search_result( $excerpt, $post_id ) {
    $brands = get_the_terms( $post_id, 'product_brand' );
    $all_brands = array();
    if ( ! is_wp_error( $brands ) && ! empty( $brands ) ) {
        foreach ( $brands as $brand ) {
            $all_brands[] = $brand->name;
        }
        $excerpt = $excerpt . '<br>' . '<span style="margin-top: 3px;display: block;color: #330ced;">Brands: ' . implode( ',', $all_brands ) . '</span>';
    }
    return $excerpt;
}
Custom taxonomy display inside the plugin search results

Custom taxonomy display inside the plugin search results

Even more examples of such customizations can be found here: How to add custom data inside search results.