Learn how to customize the look of plugin search results items.
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:
You can control the display of all these data throw plugins settings page inside Search Results tab.
Here is the default 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:
If you have product variation you can also display them in the search results block.
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.
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; }
More examples of custom styles for search results you can find here: Customize Search Results Styles.
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.
More about this feature you can read here: Search Results Layouts.
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; }
Even more examples of such customizations can be found here: How to add custom data inside search results.