How to customize the order statuses used when auto-assigning drivers

0 minutes, 31 seconds

When the Delivery Drivers for WooCommerce Pro plugin auto-assigns a driver, it’ll check the order statuses and only assign a driver if the order status is set to Processing.

There’s a filter included that allows you to customize the order statuses used when auto-assigning a driver.

ddwc_pro_assign_drivers_order_statuses

The code snippet below can be copied to your theme functions.php file, and line #15 can be changed to the order status of your choice, for instance “on-hold”.

<?php
/**
* Auto-assign drivers order statuses
*
* This filter can be used to change the order statuses that are used when auto-assigning
* the driver after the order has been successfully placed.
*
* @author Robert DeVore <deviodigital@gmail.com>
* @link https://deviodigital.com/product/delivery-drivers-for-woocommerce-pro/
* @return array
*/
function acme_assign_drivers_order_statuses( $statuses ) {
$statuses = array(
'processing',
'another-one-here'
);
return $statuses;
}
add_filter( 'ddwc_pro_assign_drivers_order_statuses', 'acme_assign_drivers_order_statuses' );

View all filters for the Delivery Drivers for WooCommerce Pro plugin.

Was this article helpful?