Skip Navigation

[Resolved] How to show all the woocommerce product reviews of a particular category?

This support ticket is created 5 years, 4 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Tagged: 

This topic contains 10 replies, has 2 voices.

Last updated by puneetS-3 5 years, 4 months ago.

Assisted by: Shane.

Author
Posts
#1333401

I have a post type which aggregates all the wocommerce products having same category, all the blogs having same category.

Now I would like to show few ( Maybe 10) wocommerce reviews on that page from all the product that comes under the category that the page serves.

One sample page is : hidden link

This has the category : noida AND it accumulates all the products with category 'noida' and all the blogs with category 'noida'.

How can I accumulates all the reviews and order them by stars, which in turn shows on this page.

#1333871

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Screenshot 2019-09-06 at 1.44.51 PM.png

Hi Puneet,

Thank you for contacting our support forum.

I'm assuming that you're referring to something similar to my setup in the screenshot.

If so then you need to first go to Toolset -> Settings -> Frontend and click on Hidden Fields and enabled the _wc_average_rating custom field.

Next on your view on the sorting option you can then sort your product view by this field.

Finally to display the rating of the product you will need to use the shortcode [wpv-woo-products-rating-listing]

Please let me know if this helps.

Thanks,
Shane

#1333899

Hey Shane,

What I want is to randomly show some(10) of the TOP reviews from all the products in the category, not the average rating of the product.

Is it possible?

#1333903

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Puneet,

Unfortunately no that is not possible.

What is possible is that you can display the top 10 products based on their average reviews but you're not able to display the top 10 reviews across a category.

Thanks,
Shane

#1333917

We, thats sad. Thanks for your help though.

#1334083

Hey, I was wondering if I use the method that you have mentioned, how can I show that there are no products with review in that particular category, if it is the case. I think I will be able to skip those products which doesn't has, reviews by using condition. But if none of the product has condition, how can I show the feedback message that there are no products with reviews .

#1334107

Also I tried this:

[wpv-woo-products-rating-listing]'
[wpv-conditional if="( '[wpv-woo-products-rating-listing]' eq '' )" evaluate="false"]
          <div class="rated-product">
            <div class="product-image">
            [types field='logo' title='%%TITLE%%' alt='%%ALT%%' size='full'][/types]
            </div>
            <h3>[wpv-post-title]</h3>
	      [wpv-woo-products-rating-listing]
          <a href="[wpv-post-url]" class="button">Apply Now</a>  
          </div>
          [/wpv-conditional]

But it seems to be false everytime. Though , I know one product has ratings and I have printed it also outside the condition logic!

#1334203

Hey, I would be really thankful If I get solution for my above query a bit quickly. I am hitting a deadline. Thanks for understanding.

#1335189

Hey, whats the update on this ?

#1335273

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Puneet,

Unfortunately our forums is generally closed on the weekends so I only just got to see your response.

"I was wondering if I use the method that you have mentioned, how can I show that there are no products with review in that particular category, if it is the case."

Firstly I was thinking that you will need to have a query filter to filter the view listing out the posts by a particular category.

To show the products with no review you will perhaps need to use the custom field "_wc_average_rating" since this will return a numeric value.

[wpv-conditional if="( '[wpv-post-field name='_wc_average_rating']' eq '0' )" evaluate="false"]
          <div class="rated-product">
            <div class="product-image">
            [types field='logo' title='%%TITLE%%' alt='%%ALT%%' size='full'][/types]
            </div>
            <h3>[wpv-post-title]</h3>
          [wpv-woo-products-rating-listing]
          <a href="[wpv-post-url]" class="button">Apply Now</a>  
          </div>
          [/wpv-conditional]


The [wpv-post-field name='_wc_average_rating'] should return 0 if there are no reviews.

Please let me know if this helps.

Thanks,
Shane

#1337335

Hey Shane, thanks this solved my problem