Home Forums WoodMart support forum Review count in archive

Review count in archive

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #474013

    computermobil
    Participant

    Hi friends.
    Us there a chance to show the number of reviews next to the stars rating in product archive view?
    Thank you in advance!

    #474104

    Hello,

    I am afraid there is no option to show the count in the Product Archive.

    If you have any questions please feel free to contact us.

    Best Regards

    #474126

    computermobil
    Participant

    Hi Elise.
    No problem.
    I found a code for the functions.php file that is working

    /**Rating in archive pages**/
    add_filter('woocommerce_product_get_rating_html', function( $html, $rating, $count ){
    	global $product;
    	$review_count = $product->get_review_count();
    	if ( $review_count && !is_product() ) {
    		$html = '<div class="rating-wrapper">' . $rating . $html . $review_count . '</div>';
    	}
        return $html;
    },10,3);

    Also with this css, then its on one line:

    ul.products li.product .star-rating{
    float:left;
    	margin: 0 auto 0 70px;
    }
    .gkartikey-product-rating-count{
        height: 1em;
        line-height: 1em;
       margin-left: 0px;
        display: inline-block;
    }
    .price-wrapper .price {
        clear: both;
    }

    Thank youanyway for your time!

    • This reply was modified 2 years, 3 months ago by computermobil.
    #474166

    Hello,

    We are glad you have fond the solution.

    If you have any questions please feel free to contact us.

    Best Regards

    #474767

    computermobil
    Participant

    Yes, thank you for your time Elise!

    #475009

    If you have any questions please feel free to contact us.

    Best Regards

Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘Review count in archive’ is closed to new replies.