Course credit enrolment

Enrolment ::: enrol_credit
Maintained by Stefan Scholz
The easiest e-commerce solution for moodle: Use credits to buy courses.
Latest release:
152 sites
24 fans
Current versions available: 1

Credit Enrolment for Moodle

While there are existing solutions to sell courses in moodle, they only cover the requirements to a certain extent: Some of the solutions (e.g. the PayPal and Stripe extensions) work great when courses are sold to individuals. Other solutions (e.g. integrations with courseware, woocommerce etc.) are much more feature rich and provide the full e-commerce experience, including seo, many billing options, invoicing, discounts etc. However, the implementation, maintenance and running cost of such a solution is a lot higher.

Our solution targets medium-sized companies who want to sell their courses to business clients (instead of individuals) by introducing a very simple credit system. Business clients can buy a certain number of credits using the existing payment/invoicing processes already in place at all customers (not within moodle). These credits can be assigned to users in moodle (manually or via upload) and then used to “buy” courses. Thus, implementation is basically done in minutes.

Key features:

  • store credits in the user’s profile
  • assign a price (=number of credits required) for a course
  • enrol into the course by deducting the required credits from the user who enrols (only if enough credits are available)

Try it out

You can see the plugin in action on our test site:

Potential privacy issues



Screenshot #0
Screenshot #1
Screenshot #2
Screenshot #3


Stefan Scholz (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Wed, Jun 9, 2021, 8:59 PM
    @Shrikant: I had the exact same issue. You probably need to change the field type in your database where the credits are stored, your credits are most probably being stored in a field of type text not integer. Once I did that, everything worked fine. Go to this plugin's GitHub, I had an exchange with Stefan about this, but eventually found the solution myself.

  • Wed, Jun 9, 2021, 10:09 PM
    Thanks Peter for your prompt and useful response! I am wondering that this solution will work only if all custom profile fields are of integer type. Since that is the case with me, I am going ahead with this solution. Thanks again!
  • Wed, Jun 9, 2021, 10:22 PM
    I am not sure but I would think that the plugin upon installation would have to ensure correct field types in the user_info_data table. However if you have created custom fields before, they might already have a data type allocated to them and that might not be possible. Something to look into I guess.
  • Thu, Jun 10, 2021, 3:41 PM
    How to connect this with the Level Up plugin? I can't seem to find any instruction anywhere.
  • Thu, Jun 10, 2021, 5:12 PM
    the integration to level up requires an additional plugin which is not publicly available. In a nutshell: the additional plugin "syncs" the XPs from level up into the credits profile field. There's also a conversion factor which you can define, e.g. 100 XP = 1 credit. The idea behind it is to make XPs more valuable, by converting them into a "currency", the credits. Students can then "buy" rewards (=courses) using the credit enrolment plugin. Please contact me directly via email or using our chat system and I can explain more.

    Peter and Shrikant,
    we do not create the profile field with our plugin – that needs to be done by the admin manually; therefore, we do not have control over the type of the profile field (see And thank you very much Peter for helping Shrikant, appreciate it!

    We are currently discussing internally if we should transition from an enrolment plugin to a payment gateway. This seems to be the solution that moodle envisions for the future. If somebody has thoughts / opinions / feedback on that, please share it with us! Also, we're currently working on the specification for a pro version of credit enrolment, which will probably add an accounts and transactions report, cohort credits and subscriptions. We're open for feature requests.

    Thanks for using our plugin!!
  • Thu, Jun 10, 2021, 6:51 PM
    Actually, the moment you create a custom profile field in the GUI in "Site administration > Users > Accounts> User Profile fields", Moodle automatically creates that field in the database as well, it is hands free, as far as the database is concerned. The problem is, that there is no preset for creating a field of type integer. So you create a text field and then those probs surface. As a result you then have to manually change this in the database as you say. This would be a change request you might ask of the Moodle team to add a type 'integer' in the dropdown when creating a new custom profile field.

    As far as payment gateway this is a vast topic, we have done a lot of research into that, there are solutions on the market, but the Moodle OS nature will mean that all your development will have to go to open source, so that is where our conversations with other vendors are stalling at the moment. There is hardly any scope for you to recoup your development investment in something like this.
  • Fri, Jun 11, 2021, 1:33 AM

    With the change suggested by Peter, my problem didn't get solved. Even though I have mentioned 1000 as the default value, it was not used by the plugin when the user tried to enroll in the course. Interestingly, when administrator edited the user profile (without making any change), the user could enroll with available balance of 1000!

    I am not a PHP developer. I tried my best to check the code but couldn't figure out why this is happening.
  • Fri, Jun 11, 2021, 2:16 AM
    Did you purge all cashes in Moodle, purge cache in browser? Create a new user, DON'T allocate any credits, go to phpmyadmin, manually add 10.000 credits to that user, go back to Moodle and check that the credits are there in the user profile. Logged in as that user, go purchase the course. After purchasing go to your credit balance and check that there is 9.000 left.
  • Mon, Jun 14, 2021, 5:12 AM
    i set the default value as 5 , so that any new user get credit of 5 , but when i test it for new user , it appear in the user profile 5 credit as expected, but on a test course that i made a 5 credit require it show that the test user balance is zero , again from site admin when edit the user profile , and the log in with test user it works !
  • Sun, Jun 27, 2021, 4:02 AM
    Hello there, we're happily using your course credit enrolment plugin. The problem is we can't see use group enrolment keys options when we set the enrolment. Can you please help us solve this issue?

    Sincere Regards
  • Sun, Sep 12, 2021, 1:19 AM
    Hello & thanks for your cool plugin. Can you please help us with 2 questions:

    1. Is there any way to know how much credit has been used on the moodle site|courses|activities?
    2. The plugin doesn't send enrolment expiry notification, what may be the reason?
  • Sun, Sep 12, 2021, 1:20 AM
    Hi Hoda,

    What we usually do is create two custom profile fields - one called „total credits“ and one called „remaining credits“.

    Whenever you „top up“ the students credits, you add the amount to both fields. That way, you can compare the two values.

    A report which lists the transactions would certainly be a good idea though! If you’re interested in that feature, contact us and we can discuss it!

  • Sun, Sep 12, 2021, 1:21 AM
    We do not support group enrolment keys by the way; it simply was not in scope when we developed the plugin.
  • Sun, Sep 12, 2021, 1:26 AM
    Hi Melika,

    We have never tested expiry notifications, so I can’t tell for sure if they work or not. We did not need them when we developed the plugin.

    I’ll test to see if they work on my site.

  • Tue, Sep 14, 2021, 2:21 AM
    Hi Melika,

    sorry for the late reply — testing this took a while, expiry notification cannot be set to less than a day. The test was positive though, I did receive the expiry notifications as configured and expected:

    | Enrolment in the course 'Credit enrolment' will expire within the next 1 days for the following users:
    | Demo User - Monday, 13 September 2021, 8:21 PM
    | To extend their enrolment, go to

    (I bought the course using credit enrolment, which has a duration of 2 days, and a notification threshold of 1 day)

    One thing that you might want to check is the notifications preferences. Maybe the user you're testing with simply does not have them turned on for whatever reason?

    Feel free to report the issue with more details on our bug tracker:

1 2 3
Please login to post comments