Last active
March 3, 2022 02:49
-
-
Save nayemDevs/d732f60608345c40532c92021987bf8e to your computer and use it in GitHub Desktop.
Process of adding custom order status on Dokan for vendor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You may need to do custom code to show your custom order status on the frontend in both order list and order details.php. | |
When you will add new order Status for WooCommerce you need to use the same filter to ADD NEW CASE to show and save the | |
order status when someone updates the order and to send order status changes through order-notes on the frontend. | |
Kindly use the below hooks to get it done. | |
dokan_get_order_status_translated & dokan_get_order_status_class | |
Kindly open dokan-lite/templates/orders/listing.php and check this filter- dokan_bulk_order_statuses which should help you. | |
To add custom order status on Dokan you may need to modify on dokan-lite/includes/order-functisons.php file and inside these functions - | |
dokan_get_order_status_class and dokan_get_order_status_translated | |
Just you need to add your new order status as CASE like below : | |
case 'completed': | |
case 'wc-completed': | |
return __( 'Completed', 'dokan-lite' ); | |
break; | |
Also, you have to use this filter to save the order status like below on your child-theme functions.php - | |
add_filter( 'wc_order_statuses', 'new_orders_vendor_status'); | |
function new_orders_vendor_status($order_statuses){ | |
$order_statuses['wc-shipping-progress'] = _x('Shipping in Progress','dokan-lite'); | |
return $order_statuses; | |
} | |
Thank you! |
Thank you. Your script is run on Dokan Dashboard Orders. BUT any order in that status is disappeared at Woocommerce Orders.
Please help to make appeared.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How can we translate existing order status by overriding or using filter for dokan orders ? do we need to directly edit dokan-lite/includes/Order/functions.php ?