Some of the courses I give are for certifications that need to be done every 4 years. What needs to happen is that the user needs to pay and take the course again. Currently when they "renew" they just get access to the old course, exams they already completed and the certificate with the old date. Ideally I'd like to keep the history of what they did, and make them take the course again. Currently since that isn't available, I have to go and "Reset" the course manually for that user. Is there a way for me to have the Reset function called when the user clicks on the Renew course?
ebajh69 Hi The final exam will not be changed since they already passeed but, but they can view the new lesson that you will add in the course if they have active subscription. Reset the course is manual option that present in manage students are.
Ninja Reset the course is manual option that present in manage students are.
Hi Reset course option is manual that you are using already via Manage student Tab on backend in Guru .
So I need the Renew to reset the course. Can you let me know where I can modify the "renew" code to call the "reset" code?
Thanks, Evan
Yes, but that means the admin has to do it manually. I’d like the student to be able to reset as well or for the reset to happen during the renewal process.
Ideally I’d like for the user to be able to take a course more than once, but that doesn’t seem to be an option yet.
ebajh69 Hi Did you tried this option in latest version of Guru ? http://prntscr.com/u247u8 This will help auto reset.
Regards
Thanks. I added custom code that works on the admin reset (I have a custom table that I need to modify during the reset. The file I adjusted for admin is here: /administrator/components/com_guru/models gurucustomers.php
Where could I add the code for the student reset?
ebajh69 Hi Please check When you edit a course there is option to set Reset course on Renew. turn it ON. There is no custom code as this is feature in Guru https://prnt.sc/u247u8
Yes, but I modified the reset for the administrator, so I need to do the same when the user does the reset. Can you point me to the file that does the user reset?
ebajh69 Hi Its not the file change that can be done. all data save into the DB for each user. I admin is a student the process is same. Or you can manually reset student course from Manage student option.
I think you are missing the question. I need to make a change to the code where you are calling the reset function when a Student Renews the courses. It currently does a reset, but I need to add some code to do something else in addition to what you are currently doing.
What file contains the reset code?
The administrator reset is here: /administrator/components/com_guru/models gurucustomers.php
Where is the reset that happens when the student triggers the reset?
ebajh69 Hi The file path is : /administrator/components/com_guru/views/guruprograms/tmpl/editform.php
ebajh69 Hi The above code is in admin folder \models\gurucustomers.php And he controller file is in \controllers\guruCustomers.php
In the gurucustomers.php there is a line that determines the Course ID: $course_id = JFactory::getApplication()->input->get("course", "0", "raw");
In gurucustomers.php I don't see it. How does it know which course to delete?
In my custom code I'm checking the course_id and then doing something with it.
ebajh69 Hi both are same files gurucustomers.php Here is code : http://prntscr.com/uneto6
ebajh69 Hi Sorry its something need revamp in the codes to make a custom plugin as you required and need a developer to work on this, It something beyond the support scope for core hacks codes. I suggest you to submit request on custom work helpdesk for such customizations : https://www.joomlart.com/service/joomla-website-development-service
ebajh69 Hi, You can open file components\com_guru\models\gurubuy.php
components\com_guru\models\gurubuy.php
search for function proccessSuccess
function proccessSuccess
in this function, find string $allpricecourse = $temp1["1"];
$allpricecourse = $temp1["1"];
then add your code bellow
remember, change $user_id on your code to $customer_id
$user_id
$customer_id
Perfect, that worked.
Thanks for your help.