Akasa Code WP

Custom Tab trong Woocommerce

6 Tháng 11, 2018 admin 1 min read

[php]
add_filter( ‘woocommerce_product_tabs’, ‘flwoo_new_product_tab’ );
function flwoo_new_product_tab( $tabs ) {
$tabs[‘description’][‘title’] = ‘Thông tin’;
$tabs[‘tt_tab’] = array(
‘title’ => __( ‘Hướng dẫn thanh toán’, ‘woocommerce’ ),
‘priority’ => 20,
‘callback’ => ‘thanhtoan_tab_content’
);
$tabs[‘ctdt_tab’] = array(
‘title’ => __( ‘Chính sách điều kiện’, ‘woocommerce’ ),
‘priority’ => 21,
‘callback’ => ‘ctdt_tab_content’
);
return $tabs;
}

function thanhtoan_tab_content() {
echo ‘Bạn có thể chọn một số cách thanh toán sau:’;
}

function ctdt_tab_content() {
echo ‘Chính sách điều kiện’;
}
[/php]

0 0 đánh giá
Đánh giá bài viết
Please wait...
Theo dõi
Thông báo của
0 Góp ý
Cũ nhất
Mới nhất Được bỏ phiếu nhiều nhất