Try like
function add_this_to_new_products( $new_status, $old_status, $post ) {
global $post;
if ( $post->post_type !== \'product\' ) return;
if ( \'publish\' !== $new_status or \'publish\' === $old_status ) return;
add_post_meta( $post->ID, \'total_amount\', \'0\', true ); // This is the action to take
}
add_action( \'transition_post_status\', \'add_this_to_new_products\', 10, 3 );