It’s ok now, I figured it out myself by editing the code.
Had some help from here to see the hook for advanced tab:
http://woocommerce.wp-a2z.org/oik_letters/w/page/13/?post_type=oik_hook
I think it’s better to move it to advanced tab because now your admin notes is present in all product modes.
i need this to work for variable products as well. any possibility of an update?
@shaunrico any chance you could help me out with the code changes you made to get this to work with variable products?
just extract the plugin zip file and edit products-admin-notes-simple.php
And replace with this code:
<?php
// Display Fields
add_action( 'woocommerce_product_options_advanced', 'pans_woo_add_custom_advanced_fields' );
// Save Fields
add_action( 'woocommerce_process_product_meta', 'pans_woo_add_custom_advanced_fields_save' );
function pans_woo_add_custom_advanced_fields() {
global $woocommerce, $post;
echo '<div class="pans_ta_options_group">';
// Textarea
woocommerce_wp_textarea_input(
array(
'id' => '_pans_ta',
'label' => __( 'Admin notes', 'woocommerce' ),
'placeholder' => 'These notes are visible to admins only.',
)
);
echo '</div>';
}
function pans_woo_add_custom_advanced_fields_save( $post_id ){
// Textarea
$woocommerce_textarea = $_POST['_pans_ta'];
if( !empty( $woocommerce_textarea ) )
update_post_meta( $post_id, '_pans_ta', sanitize_textarea_field( $woocommerce_textarea ) );
}
?>
Hi Shaun,
Thanks for the help I’ll add this in the next update and also add you as a contributor.
Thanks