Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM – Feature Request › Restrict vendors from changing order status other than completed
- This topic has 4 replies, 3 voices, and was last updated 5 years, 2 months ago by CommunityCorals.
Viewing 4 reply threads
- AuthorPosts
- October 19, 2019 at 1:48 pm #87693CommunityCoralsParticipant
Hello,
I would like to just allow status change to completed. Is it possible to restrict any other status change by the vendors via snippet?
Thanks
Dominique - October 19, 2019 at 11:49 pm #87732CraigParticipant
this may help
https://docs.woocommerce.com/document/automatically-complete-orders/or you can also purchase and install this plugin for woocommerce
https://woocommerce.com/products/woocommerce-order-status-control/ - October 21, 2019 at 11:14 am #87952WCFM ForumMember
HI,
Add this code to your site –
add_filter( 'wcfm_allowed_order_status', function( $order_statuses, $order_id = 0 ) { $order_statuses = array(); $order_statuses['wc-completed'] = 'Completed'; if( $order_id ) { $order = wc_get_order( $order_id ); $order_status = $order->get_status(); if( $order_status != 'completed' ) { $order_statuses['wc-'.$order_status] = wc_get_order_status_name( $order_status ); } } return $order_statuses; }, 50, 2 );
Thank You
- October 23, 2019 at 6:24 pm #88627CommunityCoralsParticipant
Works perfectly fine. Thanks
- October 23, 2019 at 6:26 pm #88631CommunityCoralsParticipant
Ah – one further request. Is it possible to also add to disallow the status change from “pending” to “compelted” ?
- AuthorPosts
Viewing 4 reply threads
- The topic ‘Restrict vendors from changing order status other than completed’ is closed to new replies.