Skip to content

Commit

Permalink
new method added to detect is single order
Browse files Browse the repository at this point in the history
  • Loading branch information
harunollyo committed Jan 20, 2025
1 parent 653625e commit 787bdd6
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions models/OrderModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,20 @@ public static function is_subscription_order( $order ) {
return $order && self::TYPE_SUBSCRIPTION === $order->order_type;
}

/**
* Check order is single order
*
* @since 3.2.0
*
* @param int|object $order order id or object.
*
* @return boolean
*/
public static function is_single_order( $order ) {
$order = self::get_order( $order );
return $order && self::TYPE_SINGLE_ORDER === $order->order_type;
}

/**
* Mark order Unpaid to Paid.
*
Expand Down

0 comments on commit 787bdd6

Please sign in to comment.