paid groups

Please add this code in your wplms-customizer.php file in wplms customizer plugin  :

function group_connect($product_metabox){
 $product_metabox[]=array( // Single checkbox
                        'label' => __('Connect group','vibe-customtypes'), // <label>
                        'desc'  => __('Group','vibe-customtypes'), // description
                        'id'    => 'vibe_group_product', // field id and name
                        'type'  => 'groups'
    return $product_metabox;
function add_student_to_group($order_id){
  $order = new WC_Order( $order_id );

    $items = $order->get_items();

    foreach($items as $item_id=>$item){
    $product_id = apply_filters('bp_course_product_id',$item['product_id'],$item);
    $group_id= get_post_meta($product_id,'vibe_group_product',true);
    if(isset($group_id) && is_numeric($group_id) && !empty($group_id))
    groups_join_group($group_id, $user_id ); 

Now create a product and connect a group in it :

Now if user purchase this product then user will be added to the group which was connected to the product.

Was this article helpful?


  1. Autohr

    Hi How do I create paid groups, I tried this snippet ut does not work.

    I want to allow resellers that purchased course batches to be able to sell batch seats as wc products separate from course pages

Leave A Comment?