/var/www/html_it/wp-content/plugins/woocommerce/src/Internal/Orders/PointOfSaleOrderUtil.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
/**
 * PointOfSaleOrderUtil class file.
 */

declare( strict_types );

namespace 
Automattic\WooCommerce\Internal\Orders;

use 
WC_Abstract_Order;

/**
 * Helper class for POS order related functionality.
 *
 * @internal Just for internal use.
 */
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_orderWC_Abstract_Order $order ): bool {
        return 
'pos-rest-api' === $order->get_created_via();
    }
}