Translated Course becomes another Course

Home Forums Legacy Support Support queries Setup issues Translated Course becomes another Course

Viewing 15 posts - 16 through 30 (of 33 total)
  • Author
    Posts
  • #157057
    ptah-hk
    Spectator
    This reply has been marked as private.
    #157206
    Anshuman Sahu
    Keymaster
    Well thanks for this code but its not working . I first tried it with course id it did not work ,then I tried it with wp posts but again it did not work .Any reasons why  the functions are not working on my setup ? refer : http://prntscr.com/jj2r3t
    #157454
    ptah-hk
    Spectator
    This reply has been marked as private.
    #157509
    Anshuman Sahu
    Keymaster
    Well that was a very valuable information. I will try that code again once I will be back in office  on Monday  .      
    #157661
    ptah-hk
    Spectator
    This reply has been marked as private.
    #157757
    Anshuman Sahu
    Keymaster
    Well yes this time it works but Im having a little problem assigning all versions of the courses in one go .It is getting stuck in a loop  . Please provide me some time for this .
    #163906
    ptah-hk
    Spectator
    This reply has been marked as private.
    #164030
    Anshuman Sahu
    Keymaster
    Hi, Please wait.
    #170131
    ptah-hk
    Spectator
    This reply has been marked as private.
    #170187
    Anshuman Sahu
    Keymaster
    Hi I was able to develop this custom code to allocate the course when its translated course purchased . this code will work when course product is purchased and order gets completed . add it in your wplms-customizer.php file in wplms customizer plugin :   add_action('wplms_course_product_puchased',function($course,$user_id,$total_duration,$bool,$product_id,$item_id){   $trid = apply_filters('wpml_element_trid', null,$course,'post_course');   $translations = apply_filters('wpml_get_element_translations', null,$trid,'post_course' );   if(!empty($translations)){     foreach ($translations as $key => $value) {         if(!empty($total_duration)){             bp_course_add_user_to_course($user_id,$value->element_id,$total_duration,1);             }else{             bp_course_add_user_to_course($user_id,$value->element_id);           }     }   } },10,6);
    #170223
    ptah-hk
    Spectator
    This reply has been marked as private.
    #170315
    Anshuman Sahu
    Keymaster
    I guess mistake was made in reading on where to add that code . you have to add that code in your wplms-customizer.php file in wplms customizer plugin not in appearance -> customize .   
    #170345
    ptah-hk
    Spectator
    This reply has been marked as private.
    #170426
    Anshuman Sahu
    Keymaster
    Please add this code in your wplms-customizer.php file in wplms customizer plugin :   add_action('wplms_course_code',function($code,$course_id,$user_id){   $trid = apply_filters('wpml_element_trid', null,$course_id,'post_course');   $translations = apply_filters('wpml_get_element_translations', null,$trid,'post_course' );   if(!empty($translations)){     foreach ($translations as $key => $value) {         bp_course_add_user_to_course($user_id,$value->element_id);     }   } });
    #170891
    ptah-hk
    Spectator
    This reply has been marked as private.
Viewing 15 posts - 16 through 30 (of 33 total)
  • The topic ‘Translated Course becomes another Course’ is closed to new replies.