Criteria of Order Completion
Criteria for Order Completion
Bright allows you to control whether it will autocomplete an order once it is done processing.
At the end of the Checkout Process, Bright will determine whether to complete the order.
Setting The Site Default for Auto-Completion
By default, all Bright products [with linked courses] default their value for the custom field
bright_autocomplete_order
to '1', even if not set. When this is set to '1', or the site default is unchanged, this product is eligible for autocompletion.
To override the product default for this on an individual site, add the following to an activated plugin or your theme's [or child theme's] functions.php
add_filter('bright_woocommerce_integration_autocomplete_order_default',function($default) {
return false;
});
The net effect of this is that unless a product explicitly sets 'bright_autocomplete_order' to 1, it will default to 0, and thus make any order that includes in ineligible for autocompletion.
Determining Whether to Complete The Order.
The Woocommerce Bridge for WordPress will set an order status to completed in the following circumstances:
- every product in the order must have a connected Bright course id (or ids) and/or Bright Metadata covering a license key, or set a meta key on the product of 'bright_autocomplete_order' to 1.
- If any product has a meta key of 'bright_autocomplete_order' set to 0, the order will not be completed.
- If the site default has been switched to autocomplete off, and all products have not set 'bright_autocomplete_order' to 1, the order will not be completed.
- If the autocompletion is not halted be scenario #2 or #3 above, the order will be completed.