Add this function to your template or to a custom plugin to force delete subcategories tree of parent category:

 

add_action( 'pre_delete_term', 'prefix_pre_delete_term', 10, 2 );

function prefix_pre_delete_term( $term, $taxonomy ) {

    if ( $taxonomy === 'product_cat' ) {

        $term_children = get_term_children( $term, $taxonomy );

        if ( !empty( $term_children ) ) {

            foreach ( $term_children as $term_child ) {

                wp_delete_term( $term_child, $taxonomy );

            }

        }
    }
    }

 

Keep it real ,
Best Regards ,Alin Razvan
I'm a small fish in a big ocean , trying to make a difference and some waves while swimming my way through .