Automattic\WooCommerce\Internal\Orders

PointOfSaleOrderUtil{}WC 1.0

Helper class for POS order related functionality.

No Hooks.

Usage

$PointOfSaleOrderUtil = new PointOfSaleOrderUtil();
// use class methods

Methods

  1. public static is_pos_order( WC_Abstract_Order $order )

PointOfSaleOrderUtil{} code WC 10.3.3

class PointOfSaleOrderUtil {
	/**
	 * 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.
	 *
	 * @param WC_Abstract_Order $order Order instance.
	 * @return bool True if the order is a POS order, false otherwise.
	 */
	public static function is_pos_order( WC_Abstract_Order $order ): bool {
		return 'pos-rest-api' === $order->get_created_via();
	}
}