Documentation

Get Started by Installing Edwiser Bridge

NOTE: Make sure that your PHP is version 5.3 or greater.

  1. The EdWiser Bridge plugin is available on wordpress.org for download.
  2. You can download the plugin from there and then upload it to your website.
  3. Alternatively, you can search for the plugin in the WordPress plugin repository from the back-end and install it on your website.
  4. On successful installation, activate the plugin on your website.
  5. You will now be able to see a new admin menu labelled ‘Edwiser Bridge’ in the back-end of your website.

Configure your Moodle Website

Once you have installed and activated the Edwiser Bridge plugin on your website the next step would be to configure the Moodle website and generate an ‘Access Token‘ which will be used on the WordPress website. The following steps will have to be taken through to complete the Moodle site settings.

Create an External Service on Moodle

  • Login to your Moodle site and go to Site Administration -> Plugins -> Web Services -> External Services.
  • Click on the ‘Add‘ button on the external services page.

moodle-conf-external-service-1

  • Enter a name for the External Service, check the ‘Enabled‘ field, check the ‘Authorised Users Only‘ field.
  • Now click on the ‘Add Service’ and follow it up with clicking the ‘Add functions‘ link.

moodle-configuration-access-token

  • Select the following functions and save the changes made.
    • core_user_create_users: Create users.
    • core_user_get_users_by_field: Retrieve users information for a specified unique field.
    • core_user_update_users: Update users.
    • core_course_get_courses: Return course details
    • core_course_get_categories: Return category details
    • enrol_manual_enrol_users: Manual enrol users
    • enrol_manual_unenrol_users: Manual unenrol users
    • core_enrol_get_users_courses: Get the list of courses a user is enrolled in
  • The next step would be to add users to  the list of authorized users for the external service that you created. To do this you will have to go to Site Administration -> Plugins -> Web Services -> External Services and click on the ‘Authorised users‘ link against the external service you created.
  • Once there you will be able to add users to the list of authorised users. Conversely, you can also remove users from the same setting at a later point of time if required.
Want a Stress-free Method?
Our Setup Assistance Plans can get your LMS up are running in no time.
View Plans

Enable the REST Protocol

  1. Go to Site Administration –> Plugins –> Web Services –> Manage Protocols.
  2. Click on the grey icon in the REST protocol row to enable the REST protocol and save the changes made.

moodle-configuration-REST

Generate a Moodle Web Service Token

  1. Go to Site Administration –> Plugins –> Web Services –> Manage Tokens
  2. Click on the ‘Add‘ link and select the admin user under the ‘User‘ list.
  3. Now select the external service that you created earlier in the ‘Service‘ drop down list.
  4. Click on the ‘Save Changes’ button. The token generated will be used in the Edwiser Bridge settings page on your WordPress website.

moodle-conf-external-service-2

Enable Web Services

Go to Site Administration –> Advance features, check the ‘Enable Web Services’ field and click ‘Save Changes‘ to save the changes you have made.

moodle-configuration-disable-password

Disable Password Policy

  1. Users will register to courses from the WordPress website. Their password for the Moodle website will also be created on WordPress. Therefore, we will have to change the Moodle website’s password policy, or else a user’s Moodle account will not be created after course registration.
  2. To disable the password policy go to Home -> Site Administration -> Security -> Site Policies and disable the Password policy by unchecking the check-box.

moodle-configuration-enable-web-service

With that last bit on disabling the password policy, we have completed the Moodle end configurations for the WordPress – Moodle integration to work seamlessly.

Set Up Edwiser Bridge: The WordPress Moodle Integration Plugin

Configure The General Settings

  1. Now that we have installed Edwiser Bridge and configured the Moodle website go to Edwiser Bridge –> Settings –> General tab in the WordPress website back end.
  2. Once here carry make the following three settings based on your requirement.
    1. Check the ‘Enable Registration‘ field if you want the students to be able to register to the courses from the front end.
    2. Select the page you want to display as ‘User Account Page‘ when a registered user signs-in to the WordPress website.
    3. Enter the language code in ‘Moodle Language Code‘ and make sure that the language code in your Moodle and WordPress site is the same.

edwiser-configuration-general

Need Help?
Our Setup Assistance Plans can get your LMS up are running in no time.
Get Assistance

Add the Moodle Access Token

  1. The next step would be to add the ‘Access Token‘ to the settings field provided by Edwiser Bridge. Essentially, it is this token that connects the two systems together.
  2. To add the ‘Access Token’ go to Edwiser Bridge –>  Settings –> Configurations. Now enter the Moodle website URL  to the ‘Moodle URL‘ field and token to the ‘Moodle Access Token‘ field and save the changes made.
  3. The format in which the Moodle site URL has to be added in the custom box is as follows https://yourURL.com or https://yourURL.com/moodle etc (Make sure that the Moodle site URL is as mentioned above in order to avoid cURL error).
  4. You can also test the connection before saving the changes right in the settings option. On testing the connection, an appropriate message will be displayed to the user based on the connection status.

edwiser-configuration-connection

Configure PayPal Settings

To start selling the courses from WordPress, you will also have to configure a Payment Gateway. In this case, it is PayPal. Let’s go through the process of setting up PayPal on your WordPress website.

  1. Enter the email id which will be used to accept payments in the ‘PayPal Email‘ field.
  2. Next choose your chosen currency of transaction from the ‘PayPal Currency‘ drop down box.
  3. Enter the country from which you will be operating the transaction in the ‘PayPal Country‘ field.
  4. In the ‘PayPal Cancel URL‘ field, you will enter the link of the page to which the buyer should be redirected should a payment not go through.
  5. In the ‘PayPal Return URL‘ field, you will enter the link of the page to which the buyer should be redirected after the payment of a purchase has been completed.
  6. The ‘Use PayPal Sandbox‘ field should only be checked at the time of making test transactions. Uncheck the field once the website is made live.

edwiser-configuration-paypal

If you’ve stuck somewhere in our documentation, then we have got you covered with our video demonstration on how to setup Edwiser Bridge on WordPress and Moodle. ;)

Synchronize WordPress with Moodle

With the completion of the configuration process for Moodle and WordPress, the Edwiser Bridge plugin set up has been completed. Let’s take a look now at the various options available to synchronize WordPress with Moodle.

Synchronize Courses

  1. To synchronize Moodle courses with WordPress go to Edwiser Bridge –> Settings –> Synchronization Tab.
  2. To synchronize only the course categories from Moodle to WordPress check the ‘Synchronize Course Categories‘ field and click save. Leave the remaining check boxes unchecked.
  3. To update courses that have been synchronized previously check the ‘ Update Courses Synchronized Previously‘ field and click save. Leave the remaining check boxes unchecked.
  4. To import only Moodle courses to WordPress as drafts check the ‘Synchronize Courses as Drafts‘ field and click save. Leave the remaining check boxes unchecked. The courses that have been synchronized will be saved in as a custom post type and can be accessed by going to Edwiser Bridge –> Courses from the admin menu.
  5. If all the checkboxes are checked then all values will get synchronized with WordPress and appropriate messages will be displayed once the process has been completed.
  6. If no checkbox is selected and the ‘Synchronize‘ button is clicked then the Moodle courses will get synchronized with WordPress and will be published on the website.

edwiser-bridge-woocommerce-integration-1

Synchronize Users

  1. To synchronize enrolled user data between the two systems go to Edwiser Bridge –> Settings –> Synchronization and click on the ‘Users‘ link provided at the top left.
  2. Once here you can synchronize user data for enrolled courses by checking the ‘Update user’s course enrollment status’ field provided. This field would be particularly useful to synchronize data for users who have been enrolled to some courses from the Moodle website.

edwiser-bridge-woocommerce-integration-3

Link and Unlink Users From WordPress

  1. In the case that there is a situation in which a user’s Moodle account is not linked with his WordPress account then you can do so from the ‘Users’ page at the backend of the WordPress website.
  2. To link or unlink a Moodle account with a WordPress account go to ‘Users‘ in the admin menu and  select the WordPress user accounts you want to link or unlink with Moodle.
  3. Now select the required menu from the ‘Bulk Actions‘ drop down list and click apply.
  4. It is important to note that if you link a WordPress account with a Moodle account the password will not get synced and will be the same as it was while creation of the respective accounts.
  5. If you have users who are already registered in Moodle and want to create their WordPress user accounts then you could do that by manually creating WordPress user accounts in WordPress and then following the step 2 & 3 as mentioned in this documentation.

synchronize-link-unlink

Enroll and Unenroll Users to Courses from WordPress

  1. To enroll or un-enroll users from the WordPress website go to the ‘Users‘ tab in the admin menu and select the user you want to enroll or un-enroll to or from a course.
  2. On the users profile page at the back end, a setting will be provided to select a course from a drop-down box and enroll the user to that course.
  3. Similarly, a drop down box will be provided to select a course from the drop-down box and un-enroll the user from that course.
  4. For both fields, on selecting the required course and saving the details, the enrollment information is updated in both WordPress as well as Moodle.

synchronize-enroll-unenroll

Create Categories in WordPress

Courses imported from Moodle can be assigned various categories. The categories can either be imported from Moodle by using the ‘Synchronize Course Categories‘ Option in the ‘Synchronization’ tabs on the settings page.

Alternatively, new courses can be created and can be assigned to courses imported from Moodle.

  1. To create a category go to Edwiser Bridge –> Course Categories.
  2. Here enter a name for the category, a URL friendly slug for the category, assign a parent category if applicable and description of the category.
  3. After making all the necessary changes and click the ‘Add New Course Category’ button. Once you have made the changes the category just created will be displayed in the table alongside.
  4. The category will also be available in the category widget on a single course page.

create-course-category

Sell Moodle Courses from WordPress

Now, coming to the most important functionality of the system, that of selling Moodle courses from WordPress. Now that all the configuration and setup has been completed the only step left on your end would be to set up the courses that have been imported from Moodle to WordPress for sale.

Assign a Price to Courses

  • Go to the Edwiser Bridge –> Courses and open a course page of your choice.
  • Lower on the course page there is a ‘Course Options‘ widget. Here you can set the various parameters to start selling the course.
  • You can select if you want to make a course paid or not from the ‘Course Price Type‘ drop down box. In this field, there are three options that can be selected.
    • The ‘Free‘ option is for free courses which will be available for all registered users.
    • The ‘Paid‘ option is for courses which will have to be purchased by users.
    • The ‘Closed‘ option is if the course is not available to be taken however you still want to display it on the website.
  • If  you have selected ‘Free‘ in the previous field all users will be able to take the course from the Moodle website.

course-free

  • If you select the ‘Paid‘ option the ‘Course Price‘ field will now be displayed. You will have to enter the price at which you want to sell the course here.

course-paid

  • On selecting the ‘Closed’ option, an additional field labelled ‘Optional URL‘ will be displayed. Here you will have to enter the URL of a page to which you want the end user to be redirected to on clicking the ‘Take Course‘ button.

course-closed

  • Be sure to save any changed that you make to the course page by clicking on ‘Publish‘ or ‘Update‘ whichever is applicable.

User Interaction with Your WordPress Website

  • Below is a screen shot of the course page when a new user lands on it.

course-purchase-page

  • On clicking the ‘Take Course‘ button, the user will be redirected to the login page as he is not logged in.

wordpress-login-page

  • Since the user is new, he will have to click on the ‘Don’t have an Account?‘ following which the user will be redirected to the registration page.

wordpress-registration-page

  • Once a user has successfully registered on the WordPress website an account for that user is also created on the Moodle website with the same username and password.
  • The user will now be redirected to the course page from which the user will be able to purchase the course by clicking the ‘Take Course‘ button on the course page.
  • On successful payment for the course, the ‘Take Course‘ button on the course page will now be replaced by the ‘Access Course‘ button. On clicking this button, the user will now be redirected to the Moodle website where he can take the course by signing in to the system.

View Purchase Orders

To view the a compilation of all the courses that have been purchased from your course you will have to go to Edwiser Bridge –> Orders where you will be able to see a full purchase history of all courses.

Edwiser Bridge Action Hooks

Action HooksDescriptionParameter
eb_update_optionUse this action hook to save settings manually on the settings page.$field: Value of field which you want to handle or save at a custom location.
eb_course_synchronization_completeUse this action hook to execute a custom action after the completion of course synchronization.$courses_created: Id of newly created courses on WordPress. $courses_updated: Id of previously updated courses on WordPress.
eb_course_created_wpUse this action hook to execute custom code after course creation on WordPress.$wp_course_id: Id of course created on WordPress.
$sync_options: Synchronization option selected by website admin.
$course_data
eb_course_updated_wpUse this hook to execute custom code after updating courses on WordPress.$existing_wp_course_id: Id of course updated on WordPress.
$sync_options: Synchronization option selected by website admin.
$course_data  
eb_user_synchronization_complete_singleUse this hook to execute a custom action after each user’s synchronization completion.$user_id: User Id for whom synchronization has been completed.
$sync_options: Synchronization option selected by website admin.
eb_user_synchronization_completeUse this hook to execute custom code after user data synchronization has been completed.$all_users: Array of users for whom synchronization has been performed.
$sync_options: Synchronization option selected by website admin.
eb_created_userUse this to execute custom code after registering a WordPress account & linking it with the Moodle account.$user_args: Details entered by user while registration. ( Includes the random password generated for the user)
eb_linked_to_existing_wordpress_userUse this hook to execute custom code after an existing WordPress account is linked with a Moodle account. $user_args: User details used to create an account on moodle.
eb_user_courses_updatedUse this hook to execute custom code after a user enrolls to a course.$user_id: Id of user who has been enrolled to a course.
$success: Check if enrollment was successfully completed.
$courses:Courses to which a user has been enrolled.
eb_order_createdUse this hook to execute custom code after a new order has been created to save custom data in order meta.$order_id
eb_order_status_(completed/pending/failed)Use this dynamic hook to execute custom code based on order status.$order_id
eb_register_taxonomyUse this hook to execute a custom function before registration of the plugin’s default taxonomy.
eb_after_register_taxonomyUse this hook to execute a custom function after registration of the plugin’s default taxonomy.
eb_register_post_typeUse this hook to execute a custom function before registration of the plugin’s default post types.
eb_after_register_post_typeUse this hook to execute a custom function after registration of the plugin’s default post types.
eb_before_course_archiveUse this hook to add content before the course grid on course archive page.
eb_after_course_archiveUse this hook to add content after the course grid on course archive page.
eb_before_single_courseUse this hook to add content before course data on a single course page.
eb_after_single_courseUse this hook to add content after course data on a single course page.
eb_email_headerUse this hook to add custom header to emails being sent by the plugin.$header
eb_email_footerUse this hook to add custom footer to emails being sent by the plugin.

Edwiser Bridge Filter Hooks

Filter HooksDescriptionParameters
eb_create_default_pagesUse this hook to create pages on plugin activation.
eb_new_user_dataUse this hook to add custom data to a user’s profile when an account is created on WordPress.$userdata
eb_unique_moodle_usernameUse this hook to filter the username used when a new  account is created for a user on Moodle.$username: Username already generated by the system for a user.
eb_filter_moodle_passwordPassword is randomly generated if a user with an existing WordPress account is linked to Moodle. Using this filter a custom password can be set for user accounts.$random_password
eb_moodle_user_profile_detailsUse this filter to transfer additional profile field data from WordPress to Moodle.$userdetails: Profile details to be passed to Moodle for a user.
$update: To know if an existing user’s profile is being updated or a new account is created on Moodle.
$userdetails: In case of profile being updated array should contain the moodle user id of a user.
eb_taxonomy_args_eb_course_catUse this filter to modify arguments passed when creating course category taxonomy.
eb_register_post_type_coursesUse this filter to modify arguments passed when creating a Moodle course post type
eb_register_post_type_orderUse this filter to modify arguments passed when creating course order post type.
eb_post_optionsThis hook can be used to modify existing custom options added to post types or to add new fields.
eb_course_login_buttonUse this filter hook to modify the ‘Take this Course’ button displayed to non logged in users.$login_button
$login_url
eb_course_access_buttonUse this filter hook to modify the ‘Access Course’ button displayed on a single course page. $access_button
$access_params: Parameters that can be used to modify the button.
eb_course_closed_buttonUse this filter hook to modify the ‘Take this Course’ button displayed for courses where course price type is closed.$closed_button
$closed_params: Parameters that can be used to modify the button.
eb_course_free_buttonUse this filter hook to modify the ‘Take this Course’ button displayed for courses where course price type is free.$free_button
$course id
eb_course_payment_buttonUse this filter hook to modify the ‘Take this Course’ button displayed for courses where price is defined.$paypal_button
$payment_params: The parameters passed are course id and price.
eb_course_not_purchasable_noticeUse this filter to display custom notice for courses that cannot be purchased. (This can happen if PayPal details are not entered in plugin settings or if course price type is not set.)
eb_get_templateUse this hook to allow external plugins to filter plugin template files from their own plugin.
eb_login_redirectUse this filter to redirect user to custom location after login.$redirect: Default redirection URL
$user: Current Logged in User.
eb_registration_redirectUse this filter to redirect user to custom location after registration.$redirect: Default redirection URL
$user: Current Logged in User.
eb_get_settings_pagesUse this filter to include the custom settings page class to define custom plugin settings page.$settings: Array of registered settings classes.
ed_filter_email_parametersUse this filter to add custom parameters to emails being sent.$args: Existing parameters.
$tempalte_name: Name of email template to identify which email is being sent.
eb_email_headersUse this filter to add custom email headers for all emails being sent.
eb_new_user_email_subjectUse this filter to modify email subject for email sent on user registration.
eb_existing_wp_user_email_subjectUse this filter to modify email subject for email sent on linking an existing WordPress account with a new moodle user account.
eb_order_completion_email_subjectUse this filter to modify email subject for  email sent on order completion.