-
Hello,
i want to show total duration units + exam in hours, even if my courses take 2-3 days. Now it shows as “2 days and x hours” and is confusing, as clients tend to think my course will be finished in 2 days.
I am talking about this setting: https://prnt.sc/vgqynk
How do i change that?
Thank you for your time. 🙂
anca
we can try the same with the custom code
but please confirm the version of the theme you are usingI am on 3.9 but i upgraded on 4.0 and downgrading to 3.9 again.
Anca
hi
in version 4 there is elementor course layout
vibebp>>course layout
edit the course layout and add it from here
http://prntscr.com/vhegjeI DO NOT USE ELEMENTOR ON MY WEBSITE BECAUSE IT DOES NOT WORK ON MY SITE!
CAN YOU PLEASE ANSWER AND ACCTUALLY HELP???WHY DID I PAID SUPPORT FOR????????????????????/hi
the delay in response due to support holiday
try to add this in wp-admin>>plugin>>plugin editor>>wplms customizer plugin>>wplms-customizer.phpfunction get_course_unit_durations(){ $course_id = get_the_ID(); $course_curriculum = bp_course_get_curriculum($course_id); if(!empty($course_curriculum)){ $duration = 0; foreach($course_curriculum as $key => $item){ if(is_numeric($item)){ $post_type = get_post_type($item); if( $post_type == ‘unit’ && function_exists(‘bp_course_get_unit_duration’)){ $duration += bp_course_get_unit_duration($item); }else if($post_type == ‘quiz’ && function_exists(‘bp_course_get_quiz_duration’)){ $duration += bp_course_get_quiz_duration($item); } } } if(function_exists(‘tofriendlytime’)){ $duration = apply_filters(‘wplms_cs_get_course_unit_durations’,tofriendlytime($duration),$duration); } return ‘<li><strong class=“tip” data-title=“‘._x(“Total Unit + Quiz duration in this course”,“Course Detail Sidebar Unit Duration”,“vibe-customtypes”).‘“>‘.$duration.‘</strong><i class=“icon-clock-2”></i></li>’; } }
I added that function but it breaks my site. I received a message : syntax error, unexpected ‘>’ on line 58.
function get_course_unit_durations(){ $course_id = get_the_ID(); $course_curriculum = bp_course_get_curriculum($course_id); if(!empty($course_curriculum)){ $duration = 0; foreach($course_curriculum as $key => $item){ if(is_numeric($item)){ $post_type = get_post_type($item); if( $post_type == 'unit' && function_exists('bp_course_get_unit_duration')){ $duration += bp_course_get_unit_duration($item); }else if($post_type == ‘quiz’ && function_exists('bp_course_get_quiz_duration')){ $duration += bp_course_get_quiz_duration($item); } } } if(function_exists('tofriendlytime')){ $duration = apply_filters('wplms_cs_get_course_unit_durations',tofriendlytime($duration),$duration); } return '<li><strong class="tip" data-title="'._x("Total Unit + Quiz duration in this course","Course Detail Sidebar Unit Duration","vibe-customtypes").'">'.$duration.'</strong><i class="icon-clock-2"></i></li>'; } }
make sure you have added the code before:
http://prntscr.com/vkjvq7I’m sorry…this code simply does not do nothing..
Still my courses takes “2 days, 6 hours” for example..
ok let me check again I will provide tomorrow
if I forget to do the same
please ping mehi
thanks for pinging me back
actually among so many topics forget to share the code
I am performing the testing will share the code within an hour
thankshi
please try to add the below code
as it will work like this
http://prntscr.com/vp49b9add_filter('wplms_course_details_widget','get_course_unit_durationss' ,10,2); function get_course_unit_durationss($details,$course_id){ $course_id = get_the_ID(); $course_curriculum = bp_course_get_curriculum($course_id); if(!empty($course_curriculum)){ $duration = 0; foreach($course_curriculum as $key => $item){ if(is_numeric($item)){ $post_type = get_post_type($item); if( $post_type == 'unit' && function_exists('bp_course_get_unit_duration')){ $duration += bp_course_get_unit_duration($item); }else if($post_type == 'quiz' && function_exists('bp_course_get_quiz_duration')){ $duration += bp_course_get_quiz_duration($item); } } } if(function_exists('tofriendlytime')){ $duration = tofriendlytime($duration); } $details[]= '<li><strong class="tip" data-title="'._x("Total Unit + Quiz duration in this course","Course Detail Sidebar Unit Duration","vibe-customtypes").'">'.$duration.'</strong><i class="icon-clock-2"></i></li>'; } return $details; }
You must be logged in to reply to this topic.