It comes back for me.
What plugin is adding those fields to your general tab? Might be related.
add_action( 'woocommerce_product_options_general_product_data', 'woo_add_custom_general_fields' );
add_action( 'woocommerce_process_product_meta', 'woo_add_custom_general_fields_save' );
function woo_add_custom_general_fields() {
global $woocommerce, $post;
// Text Field
woocommerce_wp_textarea_input(
array(
'id' => 'salescompany',
'label' => __( 'Sales Company', 'woocommerce' ),
'placeholder' => 'Adress here',
'desc_tip' => 'true',
'description' => __( 'Sales Company Adress here', 'woocommerce' )
)
);
woocommerce_wp_textarea_input(
array(
'id' => 'nddshortdescription',
'label' => __( 'Short-Description', 'woocommerce' ),
'placeholder' => 'Enter some short info',
'desc_tip' => 'true',
'description' => __( 'Short description for the small view in cart and email', 'woocommerce' )
)
);
}
function woo_add_custom_general_fields_save( $post_id ){
$nddselleradress = $_POST['salescompany'];
if( isset( $nddselleradress ) )
update_post_meta( $post_id, 'salescompany', esc_attr( $nddselleradress ) );
$nddshortdesc = $_POST['nddshortdescription'];
if( isset( $nddshortdesc ) )
update_post_meta( $post_id, 'nddshortdescription', esc_attr( $nddshortdesc ) );
}
i guess i did something wrong. i seeped some unused terms, maybe this is the problem?
Unused Terms
Note that some unused terms might belong to draft posts that have not been published yet. Only sweep this when you do not have any draft posts.
grouped
variable
external
if so, is there any way to add them again.
The code doesn’t seem to affect it. Are there any other customisations here?
hmm, nothing which was changed since i updated.
i just build two new products (1 grouped, 1 variable)
now the switching works again. is it correct, that the SKU field is now based in inventory?
i deleted unused terms with wp-sweep.
Unused Terms
Note that some unused terms might belong to draft posts that have not been published yet. Only sweep this when you do not have any draft posts.
grouped
variable
external
did test it again and can confirm now that if the terms are deleted it leads to the behaviour you can see on my screenshots.
Yes it would. Those terms should be left alone – they need to exist, thats why we create them on install.
yes, i’m fine with this, but people maybe need to clean up sometimes their db and it would be good to know that espeacially those should not be touched. other people could run into the same situation.
cheers
I don’t think there is a way to prevent deletion but I’ll see if we can add a workaround.
thanks for your answer. marked this as resolved 🙂