add custom order status

This topic contains 1 reply and 2 voices, and was last updated by towhid 8 years, 9 months ago
Viewing 1 Posts - 1 through 1 (of 1 total)
Author Posts
July 7, 2015 at 10:27 pm 54658
towhid Hello, I am attempting to add a custom order status. I have created the status in woocommerce with the following code:
 
function register_custom_order_status() {
    register_post_status( 'x-test', array(
        'label'                     => 'Test',
        'public'                    => true,
        'exclude_from_search'       => false,
        'show_in_admin_all_list'    => true,
        'show_in_admin_status_list' => true,
        'label_count'               => _n_noop( 'Test <span class="count">(%s)</span>', 'Test <span class="count">(%s)</span>' )
    ) );
}
add_action( 'init', 'register_custom_order_status' );

// Add to list of WC Order statuses
function add_custom_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['x-test'] = 'Test';
        }
    }

    return $new_order_statuses;
}
add_filter( 'wc_order_statuses', 'add_custom_order_statuses' );
To display this status as an option for the seller I added the following code to the dokan_get_order_status_class( $status ) function located in order-functions.php :

 case 'x-test':
        case 'wc-x-test':
            return 'success';
            break;
This allows me to select the Test status and will display "Test" as the status. the problem is that once the page is refreshed the order status changes to wc-x-test. Then when i go to the sellers order dashboard page it changes to x-test. Additionally, when I log in as the customer to view the order, the order disappears. the parent order displays as processing and the child order that has not been switched to "Test" appears, but the child order with the changed status does not appear. Please walk me through the process of adding a custom order status and having it appear on both the seller and customer order pages using the appropriate label.
July 8, 2015 at 1:05 pm 54729
towhid towhid

Hello Bryan,

The requirements appear to me that you need customization of the plugin. But I am really sorry to say that we do not provide any customization services. If you need this feature very urgently please hire a developer.

Thanks

Viewing 1 Posts - 1 through 1 (of 1 total)