Automattic\WooCommerce\Internal\Orders
OrderAttributionController::has_attribution
Check if this order already has any attribution data
Method of the class: OrderAttributionController{}
No Hooks.
Returns
true|false
.
Usage
$OrderAttributionController = new OrderAttributionController(); $OrderAttributionController->has_attribution( $order );
- $order(WC_Order) (required)
- The order object.
Changelog
Since 9.8.0 | Introduced. |
OrderAttributionController::has_attribution() OrderAttributionController::has attribution code 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; }