Automattic\WooCommerce\Internal\Orders

OrderAttributionController::output_origin_columnprivateWC 1.0

Output the translated origin label for the Origin column in the orders table.

Default to "Unknown" if no origin is set.

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

Хуков нет.

Возвращает

null. Ничего (null).

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

// private - только в коде основоного (родительского) класса
$result = $this->output_origin_column( $order );
$order(WC_Order) (обязательный)
The order object.

Код OrderAttributionController::output_origin_column() WC 10.4.3

private function output_origin_column( WC_Order $order ) {
	$source_type = $order->get_meta( $this->get_meta_prefixed_field_name( 'source_type' ) );
	$source      = $order->get_meta( $this->get_meta_prefixed_field_name( 'utm_source' ) );
	$origin      = $this->get_origin_label( $source_type, $source );
	echo esc_html( $origin );
}