Automattic\WooCommerce\Internal\Orders

OrderAttributionController::has_attributionpublicWC 9.8.0

Check if this order already has any attribution data

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

Хуков нет.

Возвращает

true|false.

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

$OrderAttributionController = new OrderAttributionController();
$OrderAttributionController->has_attribution( $order );
$order(WC_Order) (обязательный)
The order object.

Список изменений

С версии 9.8.0 Введена.

Код OrderAttributionController::has_attribution() WC 9.9.4

public function has_attribution( $order ) {
	foreach ( $this->field_names as $field ) {
		if ( $order->meta_exists( $this->get_meta_prefixed_field_name( $field ) ) ) {
			return true;
		}
	}
	return false;
}