WordPress at Your Fingertips
function is not described

WC_Product::get_formatted_name() public WC 1.0

Get product name with SKU or ID. Used within admin.

{} It's a method of the class: WC_Product{}

No Hooks.

Return

String. Formatted product name

Usage

$WC_Product = new WC_Product();
$WC_Product->get_formatted_name();

Code of WC_Product::get_formatted_name() WC 5.5.2

<?php
public function get_formatted_name() {
	if ( $this->get_sku() ) {
		$identifier = $this->get_sku();
	} else {
		$identifier = '#' . $this->get_id();
	}
	return sprintf( '%2$s (%1$s)', $identifier, $this->get_name() );
}