Home › Forums › Legacy Support › Support queries › Other issues › Modify Start and Continue course button
- This topic has 21 replies, 3 voices, and was last updated 3 years, 7 months ago by Veronica.
-
AuthorPosts
-
March 31, 2021 at 4:12 pm #349829somenergiaSpectatorHello I have WPLMS version 4. I want to modify the course button. In wplms-customize.php i have some code like this: add_filter('wplms_take_course_button_html','custom_non_loggedin_user_redirect',9999,2); function custom_non_loggedin_user_redirect($html,$course_id){ /* some code */ } This work fine for request courses but not for free courses. Maybe there is another filter? ThanksApril 1, 2021 at 5:54 am #349950DianaParticipantThe above code will work for non logged in users when they click on paid course Do you want same for Free Courses as well?April 1, 2021 at 8:18 am #350015somenergiaSpectatorI want to modify the course button for free courses for logged in users (starts and continue button)April 2, 2021 at 5:43 am #350182DianaParticipantDear User, Please it's a request to explain it properly what should I modify? the color, the size? In my above response I asked that if you are asking for a popup which should open when we click on button?April 2, 2021 at 7:49 am #350257somenergiaSpectatorI want to hide the button start an continue course for free courses when the user has empty some profile fields.April 3, 2021 at 5:30 am #350407DianaParticipantNeed to check the hook for this if it is possible or not can you please tell me which Buddypress Profile Fields? On which I have to write the code to check if it is empty or not?April 4, 2021 at 9:43 am #350511somenergiaSpectatorThanks Diana. I want to execute this code: //si no tiene todos los campos obligatoriso del perfil llenos //se oculta el botón y se le muestra un enlace al perfil if ( is_user_logged_in() && $member_type == 'socia' && has_term("curso-para-personas-socias", "course-cat") ) { /**recorre todos los campos del perfil **/ $faltan_campos = FALSE; $campos_que_faltan = ""; $r = bp_parse_args($args['args'], array('profile_group_id' => 0, 'user_id' => $user->ID, 'hide_empty_fields' => 0), 'bp_xprofile_user_admin_profile_loop_args'); if ( bp_has_profile($r) ) { while ( bp_profile_groups() ) { bp_the_profile_group(); if ( bp_profile_group_has_fields() ) { //bp_the_profile_group_name(); while ( bp_profile_fields() ) { bp_the_profile_field(); $campo = bp_get_the_profile_field_name(); if ((bp_get_the_profile_field_is_required()) && ( !bp_field_has_data() )){ $campos_que_faltan .= $campo."<br />"; $faltan_campos = TRUE; } } } } } if ($faltan_campos) { echo "<div class='oculta-boton'>"; echo $user->display_name.", para inscribirte en este curso por favor rellena estos campos de tu perfil:<br />"; echo $campos_que_faltan; echo "user_nicename."#component=profile&action=edit'>Accede a tu perfil para rellenarlos"; echo "</div>"; return; } else { return $html; }April 5, 2021 at 1:43 pm #350729VeronicaModeratorcheckingApril 5, 2021 at 1:57 pm #350736VeronicaModeratorhi in the new version(vibebp) we don't have user-id we don't have this provision in the newframe workApril 5, 2021 at 2:04 pm #350747somenergiaSpectatorHello Veronica I can modify the code. What I need is to know what is the hook to modify the start and stop button, for loggin users.April 6, 2021 at 12:03 pm #350935VeronicaModeratorfor the course button filter is wplms_take_course_button_html but as I have mentioned above we don't have user-id in the new provisionApril 8, 2021 at 9:04 am #351322somenergiaSpectatorHello Veronica I have this code in wplms-customizer.php: add_filter('wplms_take_course_button_html','prueba',10,2); function prueba($html,$course_id){ echo "ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ"; return $html; } When the product course is Request Course the string "ZZZZZ" is showing, but when the product course is Free the string is not showing. I think the filter is not executing. Here is a video: http://demos.dabne.net/Video.mp4April 9, 2021 at 7:59 am #351504VeronicaModeratorhi can you provide a URL of that course it can be possible that the filter is different on that type of course so please provide details need to checkApril 9, 2021 at 9:19 am #351513somenergiaSpectatorThis reply has been marked as private.April 10, 2021 at 12:40 pm #351732VeronicaModeratorchecking
-
AuthorPosts
- The topic ‘Modify Start and Continue course button’ is closed to new replies.