Home Forums WoodMart support forum Only product page empty stars

Only product page empty stars

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #553467

    Hi,

    1. I would like to display empty stars on the single product pages that I’ve created using Elementor.

    2. I’ve attempted numerous PHP codes, but none seem to work because I’m utilizing an Elementor widget provided by your theme, as depicted in the attached image.

    3. Additionally, next to the stars, it currently displays “(1 customer review)”. I would prefer it to show just “(1)” and remove “customer review”.

    4. If possible, I would like to customize the text for products with no reviews. Instead of showing stars, it should display the text “Write a review”. Clicking on this should scroll the page to the review section.

    Currently, only the “(1 customer review)” text is clickable and scrolls to the rating section. I would like the stars (including the number of reviews) to be clickable and perform the same action.

    Attachments:
    You must be logged in to view attached files.
    #553542

    Hello,

    01 & 02. You need to add some reviews for the products to display star ratings. If you want to show an empty rating of a single product you need to use some php code. Try to add the following code in the function.php of the child theme.

    add_action('woocommerce_single_product_summary', 'change_single_product_ratings', 2 ); function change_single_product_ratings(){ remove_action('woocommerce_single_product_summary','woocommerce_template_single_rating', 10 ); add_action('woocommerce_single_product_summary','wc_single_product_ratings', 10 ); } function wc_single_product_ratings(){ global $product; $rating_count = $product->get_rating_count(); if ( $rating_count >= 0 ) { $review_count = $product->get_review_count(); $average = $product->get_average_rating(); $count_html = '<div class="count-rating">' . array_sum($product->get_rating_counts()) . '</div>'; ?> <div class="woocommerce-product-rating"> <div class="container-rating"><div class="star-rating"> <?php echo wc_get_rating_html( $average, $rating_count ); ?> </div><?php echo $count_html ; ?> <?php if ( comments_open() ) : ?><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><?php endif ?> </div></div> <?php } }

    03. Please add below Custom CSS code to Theme Settings > Custom CSS > Global custom CSS for remove “customer review”.

    .woocommerce-review-link {
        display: none;
    }

    04. Could you please elaborate on your concern more with some useful Screenshots so that we can better understand and assist you accordingly

    Best Regards.

    #553548

    Hi,

    Thank you so much for your reply.

    1 & 2: I have added the codes, but I still see nothing. You can also try it yourself by going to Dashboard > Snippets > All Snippets and adding a new one.

    3: I have added the code, but I’m unsure what this CSS is for. I can still see “1 customer review.”

    4: My query (1&2) relates to the issue of empty stars. In today’s world, nobody likes to see empty stars, it erodes customer trust. Seeing five empty stars can be off-putting, but if there’s a text saying “write a review” (only for products with 0 reviews), it can be helpful for verified customers. They can easily open the product page and see the “write a review” text. By clicking on it, they will be scrolled down to the review section.

    If a product has any number of reviews, it should display stars and indicate how many people have reviewed the product, like this:

    ***** (1)

    Attachments:
    You must be logged in to view attached files.
    #553563

    Hello,

    You need to find a third party plugin to achieve more functionality that best suits you. We have not tested such kinds of plugins, so we don’t have any detailed suggestions

    https://www.cloudways.com/blog/review-plugins-for-woocommerce/

    Best Regards.

    #553564

    Hi,

    I don’t want more, 4th query is optional.

    I just want to show empty stars, I added your codes, and not working, please test by yourself. and thank you for your suggestion. But I’m worried about compatibility with your theme, We can talk later about this, right now I want to show empty stars

    #553750

    Hello,

    Sorry to say it requires customization and beyond our support policy. Additional code customizations are out of our theme support scope.

    Hope you can understand!

    Best Regards.

    #554353

    Hi, I found something very interesting.

    I’ve been searching for custom codes to display empty stars on the product page. Recently, I was exploring all the settings within the theme. I navigated to Theme Settings > Product Archive > Product Settings, where I found an option labeled “Show empty star rating”. Now, I can see empty stars on the product archives. However, I want them to appear on the product page, but no codes seem to work.

    Note: I’m not using woocommerce element to show empty stars on my product page. It’s an elementor element by your theme. That’s why no custom codes working.

    Attachments:
    You must be logged in to view attached files.
    #554498

    Hello,

    Try to add a rating widget in the layout with the help of elementor. It will show the empty star rating on your site.
    https://ibb.co/5TW6X2W

    Best Regards.

    #554547

    Hi, If I enable that, I will have to enable Theme Settings > Performance > Plugin > Elementor frontend right?

    #554606

    Hello,

    You can use this widget without enabling this option. You can use this option “Elementor frontend” in Woodmart to optimize performance by turning off Elementor’s JavaScript files if you’re not using many of their widgets. This helps your site load faster.

    Best Regards.

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