Hiển Thị Giá Trị Custom Field – ACF

Bắt buộc cài plugin ACF nhé

/* ####################  Hiển thị giá trị Custom Field vị trí sau Add To Cart - Bắt buộc cài ACF */function hgn_display_custom_field() {global $post;// Check for the custom field value$product = wc_get_product( $post->ID );$title = $product->get_meta( 'zz_author_text' );if( $title ) {echo get_post_meta($post->ID, 'zz_author_text', true);}}add_action( 'woocommerce_before_add_to_cart_form', 'hgn_display_custom_field' );/* ################### End */

Để lại một bình luận

Lên đầu trang