problems with be the generation of the certificate (2)

Home Forums Legacy Support Support queries How-to & Troubleshooting problems with be the generation of the certificate (2)

Tagged: 

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #48377
    pedrohoc
    Spectator
    Hi, Alex (vibe) . You have closed the topic I created "problems with be the generation of the certificate", so I had to create another topic to continue the same subject. I delayed to answer, because I had a problem with my hosting server. Just today I could add that code you gave me. I put the code in wplms-customizer.php file before the "?>" (even it do not have "?>" in this file) in wplms customizer plugin. Then I used the shortcode in the certificate. However, it did not work. Note: I tested it with a new user, after adding the code. null Original topic: https://wplms.io/support/forums/topic/problems-with-the-generation-of-the-certificate/
    #48546
    Anshuman Sahu
    Keymaster
    I also mentioned there that this code will only work on new users who will purchase the course choosing the duration of course form the variable options . It will not work on user who were in the course before adding the code .
    #48651
    pedrohoc
    Spectator
    Yeap, Alex. I tested it with new users who bought the course after I added the code, but it did not work. The shortcode is not "working," it only appears on the certificate as "[certificate_product_duration]".
    #48807
    Anshuman Sahu
    Keymaster
    Okay can you please share your admin credentials and site url to check the issue at your end . PS  :  mark reply as private while sharing credentials .
    #49090
    pedrohoc
    Spectator
    Ok. Url: http://www.ieducacursos.com.br/ user admin: IEDUCA password: ieducaadm2015 ------ PS: Too, I would like you examine the links of the certificates in the student profile. They are duplicated Thanks
    #49350
    Anshuman Sahu
    Keymaster
    Okay i checked your site and found there is some error in the code that i gave . Fixed that and it fixed the issue also please check with a new user .
    #49388
    pedrohoc
    Spectator
    Alex ... I think I explained wrong for you. Because I think what is being shown is the duration field of the course of the variation: "12 meses or duration: 365 days or 12 months". And what I'd like to show it would be the variation that the student has acquired, "30 hours | 60 hours | 80 hours | 120 hours | 180 hours | 240 hours | 300 hours". What should be shown when the user/student has acquired one of these variations: Sorry for my confusion. I hope to have explained better now
    #49527
    Anshuman Sahu
    Keymaster
    You told us to you want to show the duration of the product which the user bought actually . Why are you setting the duration to be 365 days for each variation ? If you have label as 30 hours then the duration of that variation must be 30 hours . I guess you want to show the variations for display purpose only . the code that we gave you previously will not be able to show the variation name . Please provide us more information what actually you want for the user to show in certificate and also what duration you want for users to be set if they purchase the variation coz right now in your site there is not difference in your variable pricing as duration for all variations is 365 days .
    #49564
    pedrohoc
    Spectator
    Alex, I'm sorry for not explaining properly. The duration of the product, or duration of the course, represents the number of days that students can enjoy the course that acquired, that is the time that the course will be available to the student. So assigns 365 days. That is, he will have one year to take the course. But you're right. Because if I put the "label value" in the "duration of the course" Example: 30 hours, the value will be printed correctly on the certificate, but the student can not enjoy the course for 365 days. And I wish he enjoyed for one year (365 days). The hours that the student will spend to complete the course (30 hours | 60 hours | 80 hours | 120 hours | 180 hours | 240 hours and 300 hours) is different from the days that the student can enjoy the course (365 days) And what I'd like to show it would be the variation (variation label) that the student has acquired, "30 hours | 60 hours | 80 hours | 120 hours | 180 hours | 240 hours | 300 hours, not the day that the student can enjoy the course (365 days).
    #49826
    Anshuman Sahu
    Keymaster
    Please remove the previous code and try adding the given code in wplms customizer : add_action('wplms_course_product_puchased','set_duration_meta',10,5); function set_duration_meta($course,$user_id,$y=0,$x=0,$product_id){  $variation = wc_get_product($product_id);   update_user_meta($user_id,'certificate_product_duration',$variation->get_formatted_name() ); }   add_shortcode('certificate_product_duration','certificate_product_duration_function');   function certificate_product_duration_function( $atts, $content = null ) { $id=$_GET['u']; $meta = get_user_meta($id,'certificate_product_duration',true); if(isset($meta) && $meta) return tofriendlytime($meta) ; else             return '[certificate_product_duration]';       }
    #49850
    pedrohoc
    Spectator
    Alex, I removed the previous code and added this code you gave me. Then, I added a new user and purchased the variation 120 hours of course "Governance Concept". Unfortunately, in the certifcate is showing "Curso Expirado" (means Expired Course). But i need that the certificate shows the 120 hours that the user has acquired. Thanks
    #50196
    Anshuman Sahu
    Keymaster
    I just modified the above code and it is showing the variation value now . But you have to create attributes for variations in course product named exactly " carga-horaria " .
    #51290
    pedrohoc
    Spectator
    Thanks, Alex. Now it's working.
Viewing 13 posts - 1 through 13 (of 13 total)
  • The topic ‘problems with be the generation of the certificate (2)’ is closed to new replies.