I'm using this to display a WooCommerce product title:
<?php print $_product->get_title(); ?>
But it only displays the title of the parent product. How do I display the title of the variant?
To display the title of the variant use get_name()
function instead get_title()
.
<?php print $_product->get_name(); ?>