Menu Close
    Hire us Request quote Reading list Switch to dark mode

    Moodle Connector for Magento 2

    Moodle is a learning platform designed to provide educators, administrators, and learners with a single robust, secure and integrated system to create personalized learning environments.

    With the help of Moodle Connector for Magento 2, the Moodle courses will be created in the Magento store. The user can purchase the Moodle courses from Magento store. And if the user does not have an account on Moodle then after purchasing the course in Magento store the user account will be created.

    And when the invoice will be generated the user will be enrolled for the purchased course on Moodle as well. The customer will be notified via email for the enrollment in Moodle.


    • Allow admin to synchronize courses from Moodle to the Magento store.
    • User account will auto-created on Moodle store if not available.
    • User can directly enroll to the courses from the Magento store after purchase.
    • Customer will be notified via email for enrollment in the Moodle.
    • Admin can map the Moodle category with the Magento category.


    Customers will get a zip folder and they have to extract the contents of this zip folder on their system. The extracted folder has an src folder, inside the src folder you have the app folder. You need to transfer this app folder into the Magento2 root directory on the server as shown below.

    After the successful installation, you have to run these commands in the Magento2 root directory.

    First command –

    Second Command –

    Third Command –

    After running the commands, you have to flush the cache from the Magento admin panel by navigating through ->System->Cache management as shown below.

    Multilingual Configuration

    For Multilingual support, please navigate to Store>Configuration>General >Locale Options. And select your desired language from the Locale option.

    Language Translation

    If you need to do the module translation, please navigate to the following path in your system app/code/Webkul/MoodleConnector/i18n Open the file named en_US.CSV for editing as shown in the below screenshot.

    Once you have opened the file for editing. Replace the words after the comma(,) on the right with your translated words.

    After editing and translating the CSV file, you need to save the translated file name according to your region language and country code such as – de_DE.CSV. Then upload the translated file to the same folder from where you have obtained it. Now your module translation is complete.

    How to Get Moodle Credentials

    Enabling web services:

    First admin needs to enable web services in Moodle. Follow below steps to enable web services:

    1. Navigate to Site administration > Advanced features
    2. Check “Enable web services” then click “Save Changes”

    Enabling protocols:

    Now admin needs to enable the protocols to create external service

    1. Navigate to Site administration > Plugins > Web services > Manage protocols
    2. Enable the protocols (REST, SOAP, and XML-RPC).
    3. Make sure the Web services documentation is enabled.

    Creating a service:

    1. Navigate to Site administration > Plugins > Web services > External services
    2. Click Add to add new custom service
    3. Enter a name and check Enabled
    4. Click the button “Add service”

    Adding functions to a service:

    After service creation, we need to add the required functions to the service which are required for Moodle Connector.

    1. Navigate to Site administration > Plugins > Web services > External services
    2. Click Functions to add functions

    After clicking Functions a new page will be open. Here click on Add functions to add functions to this service.

    After clicking Add functions on a new page select the required functions. Below is the list of functions which we need to select from this list.

    After selecting all the required functions from above list click Add functions to add the selected functions to the list.

    Creating a token:

    1. Navigate to Site Administration > Plugins > Web services > Manage tokens
    2. Click on Add
    3. Select the created user and service
    4. Click on Save changes

    Here you need to repeat this process two times. As first you need to create token for default Moodle mobile web service. And after that, you need to create the token for custom created service.

    After the token creation, you can use them in the module configuration.

    Moodle Configuration

    After successful installation of the module the admin can configure it under “Store > Configuration > Moodle Connector”.

    Connect Settings:

    • Moodle Base Url – Here admin will enter the base URL of the Moodle.
    • Access Token – Here enter the default token of Moodle mobile web service.
    • User Token – Here enter the user token created for custom service.
    • Check API  Status –  Here admin check the API status.

    Product Settings:

    • Attribute Set ID – Select the respective attribute set id for the Moodle courses(Magento products).
    • Website ID – Select the website where the courses(Magento products) will be created.
    • Moodle Role Id – Enter role id for which you want to create the enrolment in Moodle after purchasing the course in Magento Store.

    Note: You can get the Moodle Role id of the user from Moodle.

    Navigate to  Site administration > Users > Permissions > Define roles select a role and from the URL you can get the role id. As in the below image, the role id for Student is 5.

    • Default price – Enter the default price for the courses (Magento products) which will be assigned to the course when it will be created in Magento. Later on, the admin can update it as per the requirement.

    Manage Moodle Email Setting:

    • Email notification for moodle – Select “Yes” to enable email notification for Moodle.
    • Email Template Account Create on Moodle – Select email template for account creation in Moodle.
    • Email Template User Enroll for Course – Select email template for user enrollement in Moodle.

    Manage Moodle Categories

    After successful configuration of the module, the admin can map Moodle categories by navigating to MOODLE CONNECTOR > Manage Moodle Categories.

    Here, by clicking Sync Categories all the categories of the Moodle will be synchronized in the Magento.

    After successful synchronization of all the categories, the status of the categories will be “Mapping Required”. To map Moodle categories with the Magento categories click on Map Categories. 

    By clicking ADD the option to map categories will be available. Here, the admin can choose the Magento category and its respective Moodle category from the drop-down. After by clicking Save the categories will be mapped and displayed as below image.

    Manage Moodle Products

    The admin can manage the Moodle products under MOODLE CONNECTOR > Manage Moodle Product.

    On this page, by clicking Update Courses the Moodle courses will be fetched from the Moodle to the Magento store.

    The courses fetch status will be displayed as per the below image.

    After successful fetching, the Moodle courses will be displayed in Magento as per the below image.

    Front-end Workflow

    On the Magento store, the course will be displayed as per the below image. Now the user can purchase a course from the Magento Store.

    After placing the order the account will be created for the customer over Moodle if the account is not available on Moodle with the email id used to purchase the course. Customer will be notified for account creation by email as per the below image.

    When the invoice of the purchase is generated in Magento store the user will be enrolled on Moodle for the purchased course. And notified via email as per the below image.

    After login on the Moodle the user can find the purchased course as below image.

    That’s all for the Moodle Connector for Magento 2 if you still have any issue feel free to add a ticket and let us know your views to make the module better

    Current Product Version - 2.0.0

    Supported Framework Version - 2.0.x, 2.1.x, 2.2.x, 2.3.x

    . . .


    Add Your Comment

    Be the first to comment.

    Back to Top
    Hire Us!
    Brief us about your requirements and we'll get back to you.
    Woo! Hooy!
    We have just received your message and our expert will get back to you shortly.
    Send Again

    Table of Content

    Hide Index