Profile image
Tác giả: fcwordpress
Trang tin cá nhân | Bài đã đăng
Lượt xem

Hiện tại:
1h trước:
24h trước:
Tổng số:
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.
0

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; }

BÌNH LUẬN

Lời bình của bạn
Question   Razz  Sad   Evil  Exclaim  Smile  Redface  Biggrin  Surprised  Eek   Confused   Cool  LOL   Mad   Twisted  Rolleyes   Wink  Idea  Arrow  Neutral  Cry   Mr. Green

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

Register

Newsletter

Email this story
Share This Story:
Print this story
Email this story
Digg
Reddit
StumbleUpon
Share on Tumblr
GET ALERTS:

If you really want to ban this commenter, please write down the reason:

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