WooCommerce Code Reference

Search results

WC_Order_Data_Store_Interface

WC Order Data Store Interface

Functions that must be defined by order store classes.

Table of Contents

get_total_refunded() Get amount already refunded. float
get_total_tax_refunded() Get the total tax refunded. float
get_total_shipping_refunded() Get the total shipping refunded. float
get_order_id_by_order_key() Finds an Order ID based on an order key. int
get_order_count() Return count of orders with a specific status. int
get_orders() Get all orders matching the passed in args. array
get_unpaid_orders() Get unpaid orders after a certain date, array
search_orders() Search order data for a term and return ids. array
get_download_permissions_granted() Gets information about whether permissions were generated yet. bool
set_download_permissions_granted() Stores information about whether permissions were generated yet. mixed
get_recorded_sales() Gets information about whether sales were recorded. bool
set_recorded_sales() Stores information about whether sales were recorded. mixed
get_recorded_coupon_usage_counts() Gets information about whether coupon counts were updated. bool
set_recorded_coupon_usage_counts() Stores information about whether coupon counts were updated. mixed
get_order_type() Get the order type based on Order ID. string

Methods

get_order_id_by_order_key()

Finds an Order ID based on an order key.

public get_order_id_by_order_key( $order_key : string ) : int
Parameters
$order_key : string

An order key has generated by.

Return values
int

The ID of an order, or 0 if the order could not be found.

get_order_count()

Return count of orders with a specific status.

public get_order_count( $status : string ) : int
Parameters
$status : string

Order status.

Return values
int

get_orders()

Get all orders matching the passed in args.

public get_orders( [ $args : array = array() ] ) : array
Parameters
$args : array = array()

Arguments.

Tags
see
Return values
array

of orders

get_unpaid_orders()

Get unpaid orders after a certain date,

public get_unpaid_orders( $date : int ) : array
Parameters
$date : int

timestamp.

Return values
array

search_orders()

Search order data for a term and return ids.

public search_orders( $term : string ) : array
Parameters
$term : string

Term name.

Return values
array

of ids

set_download_permissions_granted()

Stores information about whether permissions were generated yet.

public set_download_permissions_granted( $order : WC_Order , $set : bool ) : mixed
Parameters
$order : WC_Order

Order object.

$set : bool

If should set.

Return values
mixed

set_recorded_sales()

Stores information about whether sales were recorded.

public set_recorded_sales( $order : WC_Order , $set : bool ) : mixed
Parameters
$order : WC_Order

Order object.

$set : bool

If should set.

Return values
mixed

set_recorded_coupon_usage_counts()

Stores information about whether coupon counts were updated.

public set_recorded_coupon_usage_counts( $order : WC_Order , $set : bool ) : mixed
Parameters
$order : WC_Order

Order object.

$set : bool

If should set.

Return values
mixed

get_order_type()

Get the order type based on Order ID.

public get_order_type( $order_id : int ) : string
Parameters
$order_id : int

Order ID.

Return values
string
Back to the top