I have this code that works for simple product type but not for variable products in WooCommerce:
add_shortcode( \'product_sku_div\', \'wc_product_sku_div\'
You need the Variation ID to get the SKU of Variable Product.
If you pass the Variation ID in the below Function, then you can get its SKU.
$product = new WC_Product_Variation($variation_id);
$product->get_sku();
The below code can be used to get the variations of a product. Then lopp the result to get the variation ID and then use that variation ID in the above code to get the result.
$variations = $product->get_available_variations();