Automattic\WooCommerce\Internal\StockNotifications\Frontend

MyAccountEndpoint::get_display_product_name │ public static │ WC 1.0

Product name to show as the row label.

Notification::get_product_name() returns the variation name, which already carries the attributes ("Hoodie - Blue, Large"). The row renders those attributes separately underneath, so use the parent title here and let the variation list own them.

Метод класса: MyAccountEndpoint{}

Хуков нет.

Возвращает

string. Product name, or an empty string when the product is gone.

Использование

$result = MyAccountEndpoint::get_display_product_name( $notification ): string;
$notification(Notification) (обязательный)
The notification to label.

Код MyAccountEndpoint::get_display_product_name() WC 11.2.2

public static function get_display_product_name( Notification $notification ): string {
	$product = $notification->get_product();
	if ( ! $product ) {
		return '';
	}

	return (string) $product->get_title();
}