Woocommerce Custom Order Status
-
Woocommerce Order Statuses Automatically Changing to Delivered after certain time, Why ?
Hey There !!
I have created a custom order status in woocommerce using the following code.
// Register new status
function register_awaiting_shipment_order_status() {
register_post_status( ‘wc-awaiting-shipment’, array(
‘label’ => ‘Awaiting shipment’,
‘public’ => true,
‘exclude_from_search’ => false,
‘show_in_admin_all_list’ => true,
‘show_in_admin_status_list’ => true,
‘label_count’ => _n_noop( ‘Awaiting shipment (%s)’, ‘Awaiting shipment (%s)’ )
) );
}
add_action( ‘init’, ‘register_awaiting_shipment_order_status’ );_________________________________________________________________________
// Add to list of WC Order statuses
function add_awaiting_shipment_to_order_statuses( $order_statuses ) {$new_order_statuses = array();
// add new order status after processing
foreach ( $order_statuses as $key => $status ) {$new_order_statuses[ $key ] = $status;
if ( ‘wc-processing’ === $key ) {
$new_order_statuses[‘wc-awaiting-shipment’] = ‘Awaiting shipment’;
}
}return $new_order_statuses;
}
add_filter( ‘wc_order_statuses’, ‘add_awaiting_shipment_to_order_statuses’ );_______________________________________________________________________________
I have created 4 custom order statuses as per my need, and all are working fine. The Actual issue came into picture that after a certain time (24-48 Hours) the custom order status gets changed to Completed Automatically. This sends an email to customers that your order is delivered , but actually its not.
I just want to know , why the order statuses is changing to completed automatically without even doing anything.
Thanks
Waiting for happy responses..The page I need help with: [log in to see the link]
- The topic ‘Woocommerce Custom Order Status’ is closed to new replies.