local:shop:setup:handlers:std_enrolonecourse

Enrolment in a Course (Purchase for Oneself) - Implementation

Product Automation Handler

Scenario

The main scenario of this handler, on purchase validation, is to enrol the buyer in a course designated by the internal parameters. This enrolment can be done under a role to be defined, by default the standard Moodle Student role.

If a course intended for user support exists, a secondary enrolment in customer support can be triggered.

The enrolment can be configured with a duration. By default it is permanent. If the duration is defined and the product is “renewable”, it will be possible to extend the enrolment duration on the same product code.

Implementation

Data to prepare (prerequisites):

Date encoding

In a first version, “advanced” date input interfaces are not yet developed. Dates must be given as a number of seconds since the start of the universe date (for Linux fans, of course, this date is January 1st, 1970 at 00:00).

You can use an online tool such as http://www.timestamp.fr to find the integer that represents your date.

Parameter string encoding

local/shop/setup/handlers/std_enrolonecourse.txt · Dernière modification : de 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki