• Hello,

    I have a woocommerce website and I want to add review and rating on my products.
    But I can’t find how can I add the rating product on the archive page. Is it possible to add it easily with OceanWP ?

    Thanks

Viewing 11 replies - 1 through 11 (of 11 total)
  • Hello,

    Can you link to your site? If you have a rating on your product, then the rating star will appear on the archive page on mouseover. If you want to display it constantly, then you need to add some css. Let me know if I misunderstood your query.

    Thread Starter busterland

    (@busterland)

    Hi,
    That’s correct this is my query.
    I would like to show the stars constantly between “price” and “add to cart” or before the product title but I didn’t success.
    I founded this code and the stars are printed before the product image :

    add_action('woocommerce_after_shop_loop_item_title','change_loop_ratings_location', 2 );
    function change_loop_ratings_location(){
        remove_action('woocommerce_after_shop_loop_item_title','woocommerce_template_loop_rating', 5 );
        add_action('woocommerce_after_shop_loop_item_title','woocommerce_template_loop_rating', 15 );
    }

    Thanks

    Try removing the code you have added and add the below css code to the Appearance > Customize > Custom CSS section to display the star rating –

    .woocommerce ul.products li.product.has-rating li.inner .star-rating, .woocommerce ul.products li.product.has-rating .product-inner:hover .inner .price {
        -moz-opacity: 1;
        -webkit-opacity: 1;
        opacity: 1;
        visibility: visible;
    }
    .woocommerce ul.products li.product.has-rating li.inner .star-rating {
        position: relative;
        top: auto;
        margin-top: 6px;
        width: 80px;
    }
    Thread Starter busterland

    (@busterland)

    Thanks a lot it’s working like this ??

    But a question, when I add this code in Appearance > Customize > Custom CSS section it works
    But when I add this code in my style.css file in my child theme it doens’t work

    Do you know why?

    Is the child theme activated? It should work.

    Thread Starter busterland

    (@busterland)

    Yes the child theme is activated.
    My other custom css that I have added in style.css is working correctly

    Thread Starter busterland

    (@busterland)

    When I check with F12 this is what I get :
    style

    That’s odd. Try to use !important in the css code and check it works or not. I’ll check it on my end to confirm it.

    Thread Starter busterland

    (@busterland)

    Thanks, it’s working when I add !important
    I didn’t known this !

    Glad to hear that it worked!

    it works! And how to display the number of reviews next to the rating?

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Adding review on product’ is closed to new replies.