How to Add WooCommerce Custom Fields to Products

WooCommerce Custom Fields on Product Page As apparent from the above screenshot, we will add custom fields to the WooCommerce product edit screen under the General tab. We will be working on the file functions.php (default location to add custom function) of your theme folder. Required WooCommerce Hook The first step is to using the right hook. There… Continue reading How to Add WooCommerce Custom Fields to Products

[WP] Custom Field Woocommerce Short description

Chèn mã này trong function.php của theme đang dùng hoặc tạo 1 plugin mới: [php] // Add the custom field add_action( ‘woocommerce_product_options_general_product_data’, ‘add_custom_field_to_general_product_metabox’ ); function add_custom_field_to_general_product_metabox() { global $post; // Get the selected value $value = get_post_meta( $post->ID, ‘_new_meta’, true ); if( empty( $value ) ) $value = ‘Xem trang mẫu’; // Default value woocommerce_wp_text_input(… Continue reading [WP] Custom Field Woocommerce Short description