Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter kshackelfordcaa

    (@kshackelfordcaa)

    Nevermind, found the problem, was another plugin interfering and fixed ??

    Thread Starter kshackelfordcaa

    (@kshackelfordcaa)

    Was able to finally figure it out and fix it.. I had a snippet to count show counted reviews on the store that was interfering.

    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 );
    }
    
    add_filter( 'woocommerce_product_get_rating_html', 'loop_product_get_rating_html', 20, 3 );
    function loop_product_get_rating_html( $html, $rating, $count ){
        if ( 0 < $rating && ! is_product() ) {
            global $product;
            $rating_cnt = array_sum($product->get_rating_counts());
            $count_html = ' <div class="count-rating"> (' . $rating_cnt .')</div>';
    
            $html       = '<div class="container-rating"><div class="star-rating">';
            $html      .= wc_get_star_rating_html( $rating, $count );
            $html      .= '</div>' . $count_html . '</div>';
        }
        return $html;
    }

    Changed snippet to “only run on site front-end” and now show more works.

    Thread Starter kshackelfordcaa

    (@kshackelfordcaa)

    I disabled every plugin except woocommerce, and snippets and same result…

    I think has to do with this snippet:

    add_filter( 'woocommerce_product_tabs', 'wpb_remove_product_tabs', 98 );
    function wpb_remove_product_tabs( $tabs ) {
        unset( $tabs['reviews'] );                 // Remove the reviews tab
        return $tabs;
    };
    
    add_filter('woocommerce_after_main_content', function() {
    echo do_shortcode('[cusrev_reviews]');
    });


    The reason I changed this was
    1) The anchor link #reviews would not work if the review tab was not open (if you click on customer reviews next to the stars on the single product page)
    2) I wanted the reviews to always be shown on the bottom of every product page regardless of what tab they were in.

    Before I made this change I was able to use the see more button, but the link to see reviews did not work.

    Is there something that’s wrong in the snippet above?

Viewing 3 replies - 1 through 3 (of 3 total)