Описание слияния и вкладка отзывов на Woocommerce - PullRequest
0 голосов
/ 21 октября 2019

Я пытаюсь объединить вкладки «Описание» и «Обзор» в Woocommerce. Отзывы должны быть ниже Описание

add_filter( 'woocommerce_product_tabs', 'exetera_custom_product_tabs', 98 );
function exetera_custom_product_tabs( $tabs ) {
    // Custom description callback.
    $tabs['description']['callback'] = function() {
        global $post, $product;


        // Display the content of the Description tab.
        the_content();


        // Display the heading and content of the Additional Information tab.

        echo '<h2>Opinie</h2>';

        do_action( 'woocommerce_product_review_list_args', $product );
    };

    // Remove the additional information tab.
    unset( $tabs['reviews'] );

    return $tabs;
}

Что я делаю не так?

1 Ответ

0 голосов
/ 21 октября 2019

Мое предложение таково:

add_filter( 'woocommerce_product_tabs', 'exetera_custom_product_tabs', 98 );
function exetera_custom_product_tabs( $tabs ) {

    // Custom description callback.
    $tabs['description']['callback'] = function() {
        global $post, $product;


        // Display the content of the Description tab.
        the_content();


        // Display the heading and content of the Additional Information tab.
        echo '<h2>Opinie</h2>';

        wc_get_template( 'single-product-reviews.php' );

    };

    // Remove the additional information tab.
    unset( $tabs['reviews'] );

    return $tabs;
}
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...