Skip Navigation

[Resolved] Remove parenthesis leaving only the number of reviews and the star icon

This support ticket is created 3 years, 11 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 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 6 replies, has 2 voices.

Last updated by ericF-5 3 years, 11 months ago.

Assisted by: Waqar.

Author
Posts
#2095073
Untitled.png

Tell us what you are trying to do?
I'm trying to remove parenthesis leaving only the number of reviews and the star icon
Is there any documentation that you are following?

Is there a similar example that we can see?

What is the link to your site?

#2095341

Hi,

Thank you for contacting us and I'd be happy to assist.

To suggest the best way to achieve this, I'll need to see how this review block is set up.

Can you please share temporary admin login details, along with the link to a page where this can be seen?

Note: Your next reply will be private and please make a complete backup copy, before sharing the access details.

regards,
Waqar

#2095581

hidden link
Here is the link where it can be seen.

#2096801

Thank you for sharing the access details.

As you're using the "Rating" block for this, you can follow these steps:

1. In the "Rating" block's settings, select the option "WooCommerce Native Output" for the block output setting.

2. Next, copy the file "rating.php" from the folder "/wp-content/plugins/woocommerce/templates/single-product/" and paste the copy inside your active child theme folder at the path "/wp-content/themes/generatepress-child/woocommerce/single-product/".

3. In the newly copied file, you can replace the code:


<a href="#reviews" class="woocommerce-review-link" rel="nofollow">(<?php printf( _n( '%s customer review', '%s customer reviews', $review_count, 'woocommerce' ), '<span class="count">' . esc_html( $review_count ) . '</span>' ); ?>)</a>

With:


<a href="#reviews" class="woocommerce-review-link" rel="nofollow"><?php echo '<span class="count">' . esc_html( $review_count ) . '</span>'; ?></a>

After that, the rating line will only show the star icons and the number of reviews.

#2097753

I can't find that file "rating.php" and folder "/wp-content/plugins/woocommerce/templates/single-product/" where is that?

#2099053

You'll find the folder named 'wp-content' in your website's root folder on the server.

To edit the files on the server, you can either use your web host's file manager tool or the FTP access:
hidden link

In most cases, the web host's support team can also assist in making changes like these.

#2101147

My issue is resolved now. Thank you!