ĐĂNG TIN
logo
Online:
Visits: 1,685,749,294
Stories: 8,383,743
Profile image
0
0
Tác giả: fcwordpress
Trang tin cá nhân | Bài đã đăng
Lượt xem

Hiện tại:
1h trước: 1
24h trước: 1
Tổng số: 53
Hướng dẫn custom woocommerce – phần 8
Friday, February 5, 2016 8:42
% of readers think this story is Fact. Add your two cents.


Mời anh chị xem video :

Một số code liên quan đến video:

  • Remove tab reviews
function custom_remove_product_tabs( $tabs ) { unset( $tabs['reviews'] ); return $tabs; } add_filter( 'woocommerce_product_tabs', 'custom_remove_product_tabs',98 );
  • Rename tab description
add_filter( 'woocommerce_product_tabs', 'custom_rename_tabs', 98 ); function custom_rename_tabs( $tabs ) { $tabs['description']['title'] = __( 'Thông tin thêm' ); return $tabs; }
  • Thêm tab hướng dẫn thanh toán và chính sách điều khoản
add_filter( 'woocommerce_product_tabs', 'add_new_product_tab' ); function add_new_product_tab( $tabs ) { $tabs['huong_dan_thanh_toan'] = array( 'title' => __( 'Hướng dẫn thanh toán', 'custom_theme' ), 'priority' => 50, 'callback' => 'tab_huong_dan_thanh_toan' ); $tabs['chinh_sach_dieu_khoan'] = array( 'title' => __( 'Chính sách điều khoản', 'custom_theme' ), 'priority' => 50, 'callback' => 'tab_chinh_sach_dieu_khoan' ); return $tabs; } function tab_huong_dan_thanh_toan() { $page=get_post(32); echo $page->post_content; } function tab_chinh_sach_dieu_khoan(){ $page=get_post(34); echo $page->post_content; }
  • Sắp xếp lại các tab
add_filter( 'woocommerce_product_tabs', 'custom_reorder_tabs', 98 ); function custom_reorder_tabs( $tabs ) { $tabs['description']['priority'] = 10; $tabs['huong_dan_thanh_toan']['priority'] = 11; $tabs['chinh_sach_dieu_khoan']['priority'] = 12; return $tabs; }

Tin nổi bật trong ngày
Tin mới nhất

Register

Newsletter

Email this story
If you really want to disable all recommended stories, click on OK button. After that, you will be redirect to your options page.