I've created a custom enrolment plugin using the paypal plugin as a base. It works perfectly. There's one last thing I'd like to customize, and I'm stuck on how to do it. If you put a value of "0" into the "enrol cost" field, the following message comes up when a user attempts to enrol in the course:
There is no cost associated with enrolling in this course!
There is no button which would allow a user to enrol in this course. I've tried turning on self-enrolment, hoping the system would be smart enough to only allow that option in the event a course had zero dollars associated with it. Unfortunately, a user is presented with both options, and when I add a monetary value back into the Paypal-based plugin, a user can still enter the course for free using the self-enrolment button.
What I would really love to do is be able to add a button to the if/else in my Paypal-based enrolment plugin that would allow a user to self-enrol in the event there's no cost associated with the course. I occassionally need to be able to have a zero value in that box for crazy-pants work related reasons I don't even want to try to go into here, and I would also really love to get more experience writing plugins.
I looked at the "Create an Enrolment Plugin" page, but the information for 2.0 is pretty much blank. I've spent about four hours digging through the enrol/self and enrol/paypal plugins, but it's not really making a lot of sense to me.
Any help/hand-holding would be greatly appreciated.