I’m trying to get the name of a variation in woocommerce, currently im using this:
$variationDetails = wc_get_product($variation_id);
$variationDetails->get_formatted_name();
But get_formatted_name() returns a long string with too many details, I only need the simple name of the variation. I’ve tried with $variationDetails->get_title() but that returns only the product title instead the variation name.
Is there a simple function to get the variation name?
Hopefully this helps had the same problem recently this is what I wrote to get the variations title for a product