Automattic\WooCommerce\Internal\Orders

PointOfSaleOrderUtil::is_pos_orderpublic staticWC 1.0

Check if the order is a POS (Point of Sale) order.

This method determines if an order was created via the POS REST API by checking the 'created_via' property of the order.

Method of the class: PointOfSaleOrderUtil{}

No Hooks.

Returns

true|false. True if the order is a POS order, false otherwise.

Usage

$result = PointOfSaleOrderUtil::is_pos_order( $order ): bool;
$order(WC_Abstract_Order) (required)
Order instance.

PointOfSaleOrderUtil::is_pos_order() code WC 10.7.0

public static function is_pos_order( WC_Abstract_Order $order ): bool {
	return 'pos-rest-api' === $order->get_created_via();
}