General-use functions for creating and retrieving orders.
// Creates a new, blank APP_Order object. appthemes_new_order(); // Retrieves the APP_Order object for a particular order id. appthemes_get_order( $order_id ); |
APP_Order
Methods available on any instance of APP_Order
.
// General Information $order->get_id(); $order->get_description(); $order->get_author(); $order->get_ip_address(); // Returns IP address used to create the order $order->get_currency(); $order->get_gateway(); $order->get_parent(); // Used for recurring orders $order->is_recurring(); // Returns true if the order is recurring $order->is_escrow(); // Returns true if the order is an escrow order // Payment Gateway helpers $order->get_return_url(); // URL to redirect after order is completed $order->get_cancel_url(); // URL to redirect to change gateways // Items $order->get_item( $index = 0 ); // Returns the nth-item on the order $order->get_items( $item_type = '' ); // Returns an array of items $order->get_total(); $order->add_item( $item_type, $price, $post_id ); $order->refresh_total(); // Updates the total based on the database // Event $order->get_status(); // Returns the current state of the order. See Order States $order->get_display_status(); // Gateways $order->set_gateway( $gateway_id ); $order->clear_gateway(); |
APP_Instant_Order
Methods available only on instances of APP_Instant_Order
for instant payment orders.
APP_Escrow_Order
Methods available only on instances of APP_Escrow_Order
for escrow payment orders.