Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM – Delivery › Assign one delivery boy to all vendors
Tagged: delivery boy all vendors
- This topic has 8 replies, 5 voices, and was last updated 4 years, 5 months ago by Sarmistha Chakraborty.
- AuthorPosts
- April 8, 2020 at 4:40 pm #116869djcceballosParticipant
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 ); - April 8, 2020 at 8:35 pm #116930Sarmistha ChakrabortyMember
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.
- April 12, 2020 at 3:03 am #118184djcceballosParticipant
Wow !!!! Excelent!! Work very good!
- April 12, 2020 at 1:38 pm #118381Sarmistha ChakrabortyMember
You are always welcome 🙂
Let me know if there’s anything else we can help you with.
Can we ask for a favor? Would you mind taking a few minutes to review our plugin at https://wordpress.org/support/plugin/wc-multivendor-marketplace/reviews/ and let others know about your 5 Star experience with WCFM Marketplace. Also, follow us on Twitter https://twitter.com/wcfmmp for more exciting news, important updates, and irresistible offers.
- June 12, 2020 at 11:59 am #140789oswaldo.herbertParticipant
IN which file should I enter this code?
- June 12, 2020 at 11:01 pm #140931Sarmistha ChakrabortyMember
Add this code to your child theme’s functions.php
Thanks.
- April 9, 2020 at 4:32 am #117086CraigParticipant
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!
- May 6, 2020 at 9:09 am #127246ciccupio97Participant
where is possible load it?
- May 6, 2020 at 2:20 pm #127343Sarmistha ChakrabortyMember
Hello,
From WCFM store dashboard -> Orders (PFA)
Thanks.
Attachments:
You must be logged in to view attached files.
- AuthorPosts
- You must be logged in to reply to this topic.