Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter zac1987

    (@zac1987)

    i notice u wrote function within class. So should add class in my code :

    I tried :

    $som_var = new YITH_WooCommerce_Question_Answer;
    $som_var->show_question_answer_tab();

    But still not working.

    Plugin Author YITHEMES

    (@yithemes)

    Hello there,

    in order to add this info on the shop page you could add this code to your functions.php of your theme:

    if ( function_exists('yith_ywqa_init') ) {
    
        if (!function_exists('woocommerce_after_shop_loop_item_yith_ywqa_call_back')) {
    
            function woocommerce_after_shop_loop_item_yith_ywqa_call_back()
            {
    
                global $product;
    
                $ywqa = YITH_WooCommerce_Question_Answer::get_instance();
    
                $count = $ywqa->get_questions_count(yit_get_prop($product, 'id'));
                echo "Question & Answers (" . $count .")";
    
            }
        }
    
        add_action('woocommerce_after_shop_loop_item', 'woocommerce_after_shop_loop_item_yith_ywqa_call_back');
    
    }

    then you could modify the part ‘echo “Question & Answers (” . $count .”)”;’ and giving the style you would like.

    Thank you so much for your interest.
    Have a good day.

    YIThemes

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘show Q&A tab on woocommerce shop page.’ is closed to new replies.