Hướng dẫn thêm product tab mới

Đầu tiên bạn cần tạo một field để nhập dữ liệu của tab mới. Sau đó bạn copy đoạn code phía dưới vào file function

/** * Add a custom product data tab */ add_filter( 'woocommerce_product_tabs', 'woo_new_product_tab' ); function woo_new_product_tab( $tabs ) { // Adds the new tab $tabs['dev description'] = array( 'title' => __( 'Thông số kỹ thuật', 'woocommerce' ), 'priority' => 10, 'callback' => 'woo_new_product_tab_content' ); return $tabs; } function woo_new_product_tab_content() { // The new tab content echo '<h2>Thông số kỹ thuật</h2>'; if( get_field('fieldcuaban') ){ echo the_field('fieldcuaban'); } }

Thay đổi thông tin tiêu đề của tab ở dòng số 10, ở code demo mình để là thông số kỹ thuật
Chỉnh sửa tiêu đề ở nội dung tab ở dòng 22

THIẾT KẾ WEB 68 – WEB68

EMAIL: info.thietkeweb68@gmail.com

SĐT: 0359373636 – 0902229139

WEBSITE: thietkeweb68.net

Trả lời

Email của bạn sẽ không được hiển thị công khai.