Restrict vendors from changing order status other than completed

We're shifting our Forum based support to a more dedicated support system!

We'll be closing our Forum support from 10th June, 2020 and move to Email Support assistance.

  • If you are a WCFM premium add-ons user, contact us- here
  • Want to know more before buying our add-ons? Send Pre sale queries- here
  • If you are a WCFM free user, please open a support ticket at WordPress.org
  • For WCFM App related queries, reach us- here
From now the forum will be read-only!

Multi Vendor Marketplace Plugin | WCFM Marketplace Forums WCFM – Feature Request Restrict vendors from changing order status other than completed

Viewing 4 reply threads
  • Author
    Posts
    • #87693
      CommunityCorals
      Participant

      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

    • #87732
      Craig
      Participant
    • #87952
      WCFM Forum
      Keymaster

      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

    • #88627
      CommunityCorals
      Participant

      Works perfectly fine. Thanks

    • #88631
      CommunityCorals
      Participant

      Ah – one further request. Is it possible to also add to disallow the status change from “pending” to “compelted” ?

Viewing 4 reply threads
  • The topic ‘Restrict vendors from changing order status other than completed’ is closed to new replies.