Display product tabs on product category pages in WooCommerce

I want to display product tabs on category page in WooCommerce. I have tried the following code but didn’t get any proper solution.

add_action( 'woocommerce_single_product_summary', 'woocommerce_output_product_data_tabs', 60 );

Related posts

3 comments

  1. You can use action hook “woocommerce_after_shop_loop_item” for this purpose.

    add_action('woocommerce_after_shop_loop_item', 'woocommerce_output_product_data_tabs', 20);
    

    This outputs the product tabs but formatting is a mess. You will need to add custom css to make those tabs function as desired.

    Hope this helps.

  2.     just create or overwrite your category page.php file with
    
    
        <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
    
                <?php
                    /**
                     * woocommerce_after_shop_loop_item_title hook
                     *
                     * @hooked woocommerce_template_loop_price - 10
                     */
                    do_action( 'woocommerce_after_shop_loop_item_title' );
                ?>
        <?php echo apply_filters( 'woocommerce_short_description', $post->post_excerpt ) ?>
            <a class="more" href="<?php the_permalink(); ?>">Read More >></a>
    
            <?php do_action( 'woocommerce_after_shop_loop_item' ); ?>
    
        after this 
    
    
        global $post;
    
        if ( ! $post->post_excerpt ) return;
        ?>
        <div itemprop="description">
            <?php the_content(); ?>
        </div>
    
     try this hope it's helpfull to you..
    
    and the second method to add description on your category page simple copy code and past in your function.php file 
    
    add_action( 'woocommerce_after_subcategory_title', 'my_add_cat_description', 12);
    
    function my_add_cat_description ($category) {
    $cat_id=$category->term_id;
    $prod_term=get_term($cat_id,'product_cat');
    $description=$prod_term->description;
    echo '<div class="shop_cat_desc">'.$description.'</div>';
    }
    
  3. corrected solutions

     .woocommerce-tabs ul.tabs{
    list-style:none;
    overflow:hidden;
    position:relative;
    margin:0 ;/*0 1.618em*/
    padding:0;
    }
    
     .woocommerce-tabs ul.tabs li {
    background: #EFEFEF;
    display:inline-block;
    position:relative;
    z-index:0;
    margin:0;
    }
    
     .woocommerce-tabs ul.tabs li.active{
        border-color:#78c8ce;
    }
    .woocommerce-tabs ul.tabs li a {
    display:inline-block;
    font-weight:600;
    color:#606060;
    text-decoration:none;
    font-size:12px;
    padding:10px 20px;
    text-transform: uppercase;
    }
    
    .woocommerce-tabs ul.tabs li a:hover{
    text-decoration:none;
    color:#7a7a7a;
    }
    .noreviews a{color:#78c8ce;}
     .woocommerce-tabs ul.tabs li.active {
    background-color:#78c8ce;
    z-index:2;color:#FFF;
    border-bottom-color:#78c8ce;
    border-top-left-radius: 2px;
    border-top-right-radius: 2px;
    
    }
    
    .woocommerce-tabs ul.tabs li.active a{
    color:inherit;
    text-shadow:inherit;
    }
    
    #rating_chzn{display: none;}
     .woocommerce-tabs ul.tabs:before{
    position:absolute;
    content:" ";
    width:100%;
    bottom:0;
    left:0;
    border-bottom:1px solid #EFEFEF;
    z-index:1;
    }
    
     .woocommerce-tabs .panel {
    margin:0 0 2em;
    padding:15px 0;
    }
    
     .woocommerce-tabs .accordion-group.panel{
        padding:0;
        margin:0;
        display: block !important;
    }
    add_action('woocommerce_after_shop_loop_item', 'woocommerce_output_product_data_tabs', 20);

Comments are closed.