get product variation ids code example
Example 1: get variation id from by product id
$product = wc_get_product($product_id);
$variations = $product->get_available_variations();
$variations_id = wp_list_pluck( $variations, 'variation_id' );
Example 2: get variation id from by product id
$product = wc_get_product($product_id);
$current_products = $product->get_children();