Automattic\WooCommerce\Internal\Orders
PointOfSaleOrderUtil::is_pos_order
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.
Метод класса: PointOfSaleOrderUtil{}
Хуков нет.
Возвращает
bool. True if the order is a POS order, false otherwise.
Использование
$result = PointOfSaleOrderUtil::is_pos_order( $order ): bool;
- $order(WC_Abstract_Order) (обязательный)
- Order instance.
Код PointOfSaleOrderUtil::is_pos_order() PointOfSaleOrderUtil::is pos order WC 11.2.2
public static function is_pos_order( WC_Abstract_Order $order ): bool {
return 'pos-rest-api' === $order->get_created_via();
}