GET FREE VERSION GET THE PRO VERSION

Custom Product Tabs for WooCommerce

Search and display product content created via custom tabs plugin.

In this article

Overview

Key features of integration:
  • Search tabs content. Search for products based on their tabs content.
  • Display tabs content. Display content of the tabs for each product inside search results.

Custom Product Tabs for WooCommerce plugin allows shop owners to create product tabs with any custom content inside.

Advanced Woo Search plugin has built-in integration with these custom tabs content and this allows you to search for any product via this content or event display that content for each product inside search results.

Search for tabs content

Search for products via content inside custom tabs.

You don't need to apply any extra steps here. Just search for any words/phrases that are inside your custom tabs.

Content for product custom tab

Content for product custom tab

Search for product by tabs content

Search for product by tabs content

Another great news here is that tabs content synchronizes with search plugin automatically. This means that when you change content for any tab these changes will immediately reflect on plugin search results output.

Display tabs content

Customize your products search results output and include custom tabs content inside it.

Advanced Woo Search plugin has many built-in hooks that you can use to customize search results.

In this section we will provide code snippet example for displaying some tab content for products.

For example, we have two product tabs: Custom tab 1 and Custom tab 2.

Content of product tabs

Content of product tabs

And inside the search results output we want to show the second tab title and content as product description. In this case we can use following code snippet:

add_filter( 'aws_excerpt_search_result', 'aws_excerpt_search_result', 10, 3 );
function aws_excerpt_search_result( $excerpt, $post_id, $product ) {
    if ( $custom_tabs = get_post_meta( $post_id, 'yikes_woo_products_tabs' ) ) {
        if ( $custom_tabs && ! empty( $custom_tabs ) ) {
            foreach( $custom_tabs as $custom_tab_array ) {
                if ( is_array( $custom_tab_array ) && ! empty( $custom_tab_array ) ) {
                    foreach( $custom_tab_array as $key => $custom_tab ) {
                        if ( $key === 1 ) {
                            $excerpt = $custom_tab['title'] . '<br>' . $custom_tab['content'];
                        }
                    }
                }
            }
        }
    }
    return $excerpt;
}

Now the product description must contain custom tab data inside.

Tab content inside product description

Tab content inside product description