Assign one delivery boy to all vendors

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 – Delivery Assign one delivery boy to all vendors

Viewing 3 reply threads
  • Author
    Posts
    • #116869
      Avatardjcceballos
      Participant

      Hi, i see in other topic, a code snipped for one delivery work for all vendors, work done but if other vendor create a new delivery boy all vendors can see or asign deliveries a this delivery boy.
      Is it possible that only the admin delivery boy is visible in all vendors?

      here is a code mentioned.

      add_filter( ‘wcfmd_get_delivery_boys_args’, function( $delivery_boys_args ) {
      if( wcfm_is_vendor() ) {
      if( isset( $delivery_boys_args[‘meta_key’] ) ) unset( $delivery_boys_args[‘meta_key’] );
      if( isset( $delivery_boys_args[‘meta_value’] ) ) unset( $delivery_boys_args[‘meta_value’] );
      }
      return $delivery_boys_args;
      }, 50 );

    • #116930

      Hi,

      Modify the code,

      add_filter( 'wcfmd_get_delivery_boys_args', function( $delivery_boys_args ) {
      	if( wcfm_is_vendor() ) {		
      		$vendor_id = get_current_user_id();
      		$adminid = 1; //replace with site admin user id
      		if( isset( $delivery_boys_args['meta_key'] ) ) unset( $delivery_boys_args['meta_key'] );
      		if( isset( $delivery_boys_args['meta_value'] ) ) unset( $delivery_boys_args['meta_value'] );
      		$delivery_boys_args['meta_key'] = '_wcfm_delivery_boy_author';        
      		$delivery_boys_args['meta_value'] = array($adminid,$vendor_id);
      	}
      return $delivery_boys_args;
      }, 50 );

      Thanks.

    • #117086
      AvatarCraig
      Participant

      I don’t have a use for this code Sarmistha Chakraborty but I just wanted to say that your ability and willingness to provide the code is awesome! thanks for your support with WC Lovers!

    • #127246
      Avatarciccupio97
      Participant

      where is possible load it?

Viewing 3 reply threads
  • You must be logged in to reply to this topic.