In this tutorial we’ll integrate WC Vendors plugins with WPLMS.
Environment :
Component : Version
WPLMS : 2.0.9.3
WooCommerce : 2.5.5
WC Vendors : 1.9.0
Please follow these steps:
- Installation :
- Go to wp-admin->plugins->add new.
- Now search for wc vendors plugin.
- Click on install Now
- Activate the plugin.
refer:
- Adding code in customizer plugin:
- Now go to wp-admin->plugins->editor.
- Now select wplms customizer plugin.
- Now add the below code in the wplms-customizer.php file before “?>”.
refer:
- Here is the code:
add_action('init','add_instructor_properties_to_vendors',1); function add_instructor_properties_to_vendors(){ $caps = array ('delete_posts','delete_published_posts','edit_posts','manage_categories','edit_published_posts','publish_posts','read','upload_files','unfiltered_html','level_1'); $role = get_role( 'vendor' ); foreach ( $caps as $cap ){ $role->add_cap( $cap ); } }
- Now any user can go to vendor dashboard page and can apply for becoming a vendor, refer:
- Approving the vendors:
- Now admin can go to wp-admin->users.
- Click on pending vendor.
- Now approve the vendors individually or select all and bulk approve vendors.
refer:
- Now vendors can create their own courses and products which will appear in the shop page and vendors will get commission for it.
- For setting commission go to wp-admin->woocommerce->wc vendors->general and set the commission, refer: