2016-11-17 13:18:24 +00:00
|
|
|
<?php
|
|
|
|
if ( ! defined( 'ABSPATH' ) ) {
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* WC Order Data Store Interface
|
|
|
|
*
|
|
|
|
* Functions that must be defined by order store classes.
|
|
|
|
*
|
2017-03-15 16:36:53 +00:00
|
|
|
* @version 3.0.0
|
2016-11-17 13:18:24 +00:00
|
|
|
* @category Interface
|
|
|
|
* @author WooThemes
|
|
|
|
*/
|
|
|
|
interface WC_Order_Data_Store_Interface {
|
2016-11-17 14:37:29 +00:00
|
|
|
/**
|
|
|
|
* Get amount already refunded.
|
|
|
|
*
|
2017-03-28 17:52:32 +00:00
|
|
|
* @param WC_Order $order
|
2016-11-17 14:37:29 +00:00
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function get_total_refunded( $order );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the total tax refunded.
|
|
|
|
*
|
2017-03-28 17:52:32 +00:00
|
|
|
* @param WC_Order $order
|
2016-11-17 14:37:29 +00:00
|
|
|
* @return float
|
|
|
|
*/
|
|
|
|
public function get_total_tax_refunded( $order );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the total shipping refunded.
|
|
|
|
*
|
2017-03-28 17:52:32 +00:00
|
|
|
* @param WC_Order $order
|
2016-11-17 14:37:29 +00:00
|
|
|
* @return float
|
|
|
|
*/
|
|
|
|
public function get_total_shipping_refunded( $order );
|
2016-11-18 14:07:21 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Finds an Order ID based on an order key.
|
|
|
|
*
|
|
|
|
* @param string $order_key An order key has generated by
|
|
|
|
* @return int The ID of an order, or 0 if the order could not be found
|
|
|
|
*/
|
2016-11-21 14:30:56 +00:00
|
|
|
public function get_order_id_by_order_key( $order_key );
|
2016-11-18 14:07:21 +00:00
|
|
|
|
|
|
|
/**
|
2017-01-19 23:36:26 +00:00
|
|
|
* Return count of orders with a specific status.
|
|
|
|
* @param string $status
|
2016-11-18 14:07:21 +00:00
|
|
|
* @return int
|
|
|
|
*/
|
2017-01-19 23:36:26 +00:00
|
|
|
public function get_order_count( $status );
|
2016-11-18 14:07:21 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get all orders matching the passed in args.
|
|
|
|
*
|
|
|
|
* @see wc_get_orders()
|
|
|
|
* @param array $args
|
|
|
|
* @return array of orders
|
|
|
|
*/
|
|
|
|
public function get_orders( $args = array() );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get unpaid orders after a certain date,
|
2017-03-28 17:52:32 +00:00
|
|
|
* @param int $date timestamp
|
2016-11-18 14:07:21 +00:00
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function get_unpaid_orders( $date );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Search order data for a term and return ids.
|
|
|
|
* @param string $term
|
|
|
|
* @return array of ids
|
|
|
|
*/
|
|
|
|
public function search_orders( $term );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets information about whether permissions were generated yet.
|
|
|
|
* @param WC_Order $order
|
2016-11-21 14:30:56 +00:00
|
|
|
* @return bool
|
2016-11-18 14:07:21 +00:00
|
|
|
*/
|
|
|
|
public function get_download_permissions_granted( $order );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Stores information about whether permissions were generated yet.
|
|
|
|
* @param WC_Order $order
|
|
|
|
* @param bool $set
|
|
|
|
*/
|
|
|
|
public function set_download_permissions_granted( $order, $set );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets information about whether sales were recorded.
|
|
|
|
* @param WC_Order $order
|
2016-11-21 14:30:56 +00:00
|
|
|
* @return bool
|
2016-11-18 14:07:21 +00:00
|
|
|
*/
|
|
|
|
public function get_recorded_sales( $order );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Stores information about whether sales were recorded.
|
|
|
|
* @param WC_Order $order
|
|
|
|
* @param bool $set
|
|
|
|
*/
|
|
|
|
public function set_recorded_sales( $order, $set );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets information about whether coupon counts were updated.
|
|
|
|
* @param WC_Order $order
|
2016-11-21 14:30:56 +00:00
|
|
|
* @return bool
|
2016-11-18 14:07:21 +00:00
|
|
|
*/
|
|
|
|
public function get_recorded_coupon_usage_counts( $order );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Stores information about whether coupon counts were updated.
|
|
|
|
* @param WC_Order $order
|
|
|
|
* @param bool $set
|
|
|
|
*/
|
|
|
|
public function set_recorded_coupon_usage_counts( $order, $set );
|
2017-02-08 19:18:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the order type based on Order ID.
|
|
|
|
* @param int $order_id
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function get_order_type( $order_id );
|
2016-11-17 13:18:24 +00:00
|
|
|
}
|