DraftOrders
Service class for adding DraftOrder functionality to WooCommerce core.
Description Description
Sets up all logic related to the Checkout Draft Orders service
Source Source
File: packages/woocommerce-blocks/src/Domain/Services/DraftOrders.php
Methods Methods
- __construct — Constructor
- append_draft_order_post_status — Append draft status to a list of statuses.
- assert_order_results — Asserts whether incoming order results are expected given the query this service class executes.
- delete_draft_order_post_status_from_args — Remove draft status from the 'status' argument of an $args array.
- delete_expired_draft_orders — Delete draft orders older than a day in batches of 20.
- ensure_draft_status_registered — Since it's possible for third party code to clobber the `$wp_post_statuses` global, we need to do a final check here to make sure the draft post status is registered with the global so that it is not removed by WP_Query status validation checks.
- get_post_status_properties — Returns the properties of this post status for registration.
- init — Set all hooks related to adding Checkout Draft order functionality to Woo Core.
- install — Installation related logic for Draft order functionality.
- maybe_create_cronjobs — Maybe create cron events.
- maybe_remove_cronjobs — Unschedule cron jobs that are present.
- register_draft_order_post_status — Register custom order post status for orders created via the API during checkout.
- register_draft_order_status — Register custom order status for orders created via the API during checkout.
- uninstall — Remove cronjobs if they exist (but only from admin).