class-wc-abstract-order-data-store-interface.php
4 years ago
class-wc-coupon-data-store-interface.php
4 years ago
class-wc-customer-data-store-interface.php
4 years ago
class-wc-customer-download-data-store-interface.php
4 years ago
class-wc-customer-download-log-data-store-interface.php
4 years ago
class-wc-importer-interface.php
4 years ago
class-wc-log-handler-interface.php
4 years ago
class-wc-logger-interface.php
4 years ago
class-wc-object-data-store-interface.php
4 years ago
class-wc-order-data-store-interface.php
4 years ago
class-wc-order-item-data-store-interface.php
3 years ago
class-wc-order-item-product-data-store-interface.php
4 years ago
class-wc-order-item-type-data-store-interface.php
4 years ago
class-wc-order-refund-data-store-interface.php
4 years ago
class-wc-payment-token-data-store-interface.php
4 years ago
class-wc-product-data-store-interface.php
4 years ago
class-wc-product-variable-data-store-interface.php
4 years ago
class-wc-queue-interface.php
4 years ago
class-wc-shipping-zone-data-store-interface.php
4 years ago
class-wc-webhooks-data-store-interface.php
4 years ago
class-wc-order-data-store-interface.php
138 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Order Data Store Interface |
| 4 | * |
| 5 | * @version 3.0.0 |
| 6 | * @package WooCommerce\Interface |
| 7 | */ |
| 8 | |
| 9 | /** |
| 10 | * WC Order Data Store Interface |
| 11 | * |
| 12 | * Functions that must be defined by order store classes. |
| 13 | * |
| 14 | * @version 3.0.0 |
| 15 | */ |
| 16 | interface WC_Order_Data_Store_Interface { |
| 17 | /** |
| 18 | * Get amount already refunded. |
| 19 | * |
| 20 | * @param WC_Order $order Order object. |
| 21 | * @return float |
| 22 | */ |
| 23 | public function get_total_refunded( $order ); |
| 24 | |
| 25 | /** |
| 26 | * Get the total tax refunded. |
| 27 | * |
| 28 | * @param WC_Order $order Order object. |
| 29 | * @return float |
| 30 | */ |
| 31 | public function get_total_tax_refunded( $order ); |
| 32 | |
| 33 | /** |
| 34 | * Get the total shipping refunded. |
| 35 | * |
| 36 | * @param WC_Order $order Order object. |
| 37 | * @return float |
| 38 | */ |
| 39 | public function get_total_shipping_refunded( $order ); |
| 40 | |
| 41 | /** |
| 42 | * Finds an Order ID based on an order key. |
| 43 | * |
| 44 | * @param string $order_key An order key has generated by. |
| 45 | * @return int The ID of an order, or 0 if the order could not be found. |
| 46 | */ |
| 47 | public function get_order_id_by_order_key( $order_key ); |
| 48 | |
| 49 | /** |
| 50 | * Return count of orders with a specific status. |
| 51 | * |
| 52 | * @param string $status Order status. |
| 53 | * @return int |
| 54 | */ |
| 55 | public function get_order_count( $status ); |
| 56 | |
| 57 | /** |
| 58 | * Get all orders matching the passed in args. |
| 59 | * |
| 60 | * @see wc_get_orders() |
| 61 | * @param array $args Arguments. |
| 62 | * @return array of orders |
| 63 | */ |
| 64 | public function get_orders( $args = array() ); |
| 65 | |
| 66 | /** |
| 67 | * Get unpaid orders after a certain date, |
| 68 | * |
| 69 | * @param int $date timestamp. |
| 70 | * @return array |
| 71 | */ |
| 72 | public function get_unpaid_orders( $date ); |
| 73 | |
| 74 | /** |
| 75 | * Search order data for a term and return ids. |
| 76 | * |
| 77 | * @param string $term Term name. |
| 78 | * @return array of ids |
| 79 | */ |
| 80 | public function search_orders( $term ); |
| 81 | |
| 82 | /** |
| 83 | * Gets information about whether permissions were generated yet. |
| 84 | * |
| 85 | * @param WC_Order $order Order object. |
| 86 | * @return bool |
| 87 | */ |
| 88 | public function get_download_permissions_granted( $order ); |
| 89 | |
| 90 | /** |
| 91 | * Stores information about whether permissions were generated yet. |
| 92 | * |
| 93 | * @param WC_Order $order Order object. |
| 94 | * @param bool $set If should set. |
| 95 | */ |
| 96 | public function set_download_permissions_granted( $order, $set ); |
| 97 | |
| 98 | /** |
| 99 | * Gets information about whether sales were recorded. |
| 100 | * |
| 101 | * @param WC_Order $order Order object. |
| 102 | * @return bool |
| 103 | */ |
| 104 | public function get_recorded_sales( $order ); |
| 105 | |
| 106 | /** |
| 107 | * Stores information about whether sales were recorded. |
| 108 | * |
| 109 | * @param WC_Order $order Order object. |
| 110 | * @param bool $set If should set. |
| 111 | */ |
| 112 | public function set_recorded_sales( $order, $set ); |
| 113 | |
| 114 | /** |
| 115 | * Gets information about whether coupon counts were updated. |
| 116 | * |
| 117 | * @param WC_Order $order Order object. |
| 118 | * @return bool |
| 119 | */ |
| 120 | public function get_recorded_coupon_usage_counts( $order ); |
| 121 | |
| 122 | /** |
| 123 | * Stores information about whether coupon counts were updated. |
| 124 | * |
| 125 | * @param WC_Order $order Order object. |
| 126 | * @param bool $set If should set. |
| 127 | */ |
| 128 | public function set_recorded_coupon_usage_counts( $order, $set ); |
| 129 | |
| 130 | /** |
| 131 | * Get the order type based on Order ID. |
| 132 | * |
| 133 | * @param int $order_id Order ID. |
| 134 | * @return string |
| 135 | */ |
| 136 | public function get_order_type( $order_id ); |
| 137 | } |
| 138 |