MdMasud

WordPress, Laravel, Flutter

How to add WooCommerce custom Order Statuses and display them in the dropdown

·

,


WooCommerce will not automatically show your custom statuses in the admin dropdown unless you explicitly add them. Below you can find how to register the statuses and make them appear in the status selection dropdown inside the order details screen.


Showing Your Statuses in the Admin Dropdown

add_filter('wc_order_statuses', 'show_new_statuses_in_dropdown', 99, 1);

function show_new_statuses_in_dropdown($statuses)
{
    return array_merge(
        ['wc-price-request' => __('Price request', 'my-domain')],
        ['wc-pending-pricing' => __('Pending pricing', 'my-domain')],
        ['wc-quoted' => __('Quoted', 'my-domain')],
        ['wc-customer-visit' => __('Customer visit', 'my-domain')],
        $statuses
    );
}


This merges your custom statuses with the existing ones in a clean way.


Once your statuses are registered and added to the dropdown, your WooCommerce order management becomes more flexible and easier to track.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *