WC_Product_Variation::get_formatted_name()
Get product name with SKU or ID. Used within admin.
Метод класса: WC_Product_Variation{}
Хуков нет.
Возвращает
Строку
. Formatted product name
Использование
$WC_Product_Variation = new WC_Product_Variation(); $WC_Product_Variation->get_formatted_name();
Код WC_Product_Variation::get_formatted_name() WC Product Variation::get formatted name WC 8.7.0
public function get_formatted_name() { if ( $this->get_sku() ) { $identifier = $this->get_sku(); } else { $identifier = '#' . $this->get_id(); } $formatted_variation_list = wc_get_formatted_variation( $this, true, true, true ); return sprintf( '%2$s (%1$s)', $identifier, $this->get_name() ) . '<span class="description">' . $formatted_variation_list . '</span>'; }