[Resolved] Number of reviews behind stars on catalog page

Home Forums Support Number of reviews behind stars on catalog page

  • This topic has 6 replies, 3 voices, and was last updated 4 months ago by perlfan.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1513663
    perlfan

    Hi there,

    is there a way to make the number of reviews appear behind the stars on the catalog page (overview of all products)? That would be great. Thanks for help.

    Frank

    #1513740
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    What do you mean by “behind the stars”? Are there any examples you can link us to?

    #1514042
    perlfan

    Hi Tom,

    I managed to display the review count behind the stars on my catalog page with php / css pieces which I found in a post from David (see below).

    The only thing still missing is the link to the reviews (I’d like to link the review count on the catalog page to the reviews of the respective product, like amazon does it e.g.: https://www.amazon.de/s?k=phone&__mk_de_DE=%C3%85M%C3%85%C5%BD%C3%95%C3%91&ref=nb_sb_noss_2)

    Thanks for help, Frank

    add_filter( 'woocommerce_product_get_rating_html', function ( $html, $rating, $count ) {
    	global $product;
    	if ( $html && is_archive() && $product) {
    		$html .= sprintf( '<span class="review-count"> (%s)</span>', $product->get_rating_count() );
    	}
    
    	return $html;
    }, 10, 3 );
    .woocommerce ul.products li.product .star-rating {
        display: inline-block;
    }
    #1514343
    David
    Staff
    Customer Support

    Hi there,

    no easy way to do that, as the Reviews form is part of the Tab Element. So you would need to simulate a click event on that tab when a specific URL # is loaded…. I had a look around stackoverflow and WP plugins to see if anything existed like that. Unfortunately nothing found. To do that would require custom development.

    #1514406
    perlfan

    I thought if Amazon can do it, you can do it… πŸ˜‰ Just kidding – I’m already happy about the review count that now appears next to the stars…
    Thanks, Frank

    #1514776
    David
    Staff
    Customer Support

    Haha – well Amazon made it easy by not having the silly tabs that woo uses πŸ™‚

    #1514795
    perlfan

    Hate the tabs too!!

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.