The WooCommerce Integration extension needs Edwiser Bridge and WooCommerce to be installed and setup on your website. Have you done that yet?

WooCommerce Integration Installation

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

  1. Upon purchasing the WooCommerce Integration Extension for Edwiser Bridge, an email  containing the purchase receipt, download link, and license key will be sent to your registered email id. You can download the extension using the download link provided.
  2. Go to the ‘Plugins‘ menu from the dashboard.
  3. Click on the ‘Add New‘ button on this page.
  4. Now click on the ‘Upload Plugin‘ button and upload the WooCommerce Integration extension file that you downloaded in the first step.
  5. Click on ‘Install Now‘ button once you have located and uploaded the plugin.
  6. On successful installation click the ‘Activate Plugin‘ link to activate the plugin.
  7. Alternatively, you can unzip and upload the WooCommerce Integration  plugin folder using the FTP application of your choice.

License Key Activation

  1. Once you have activated the plugin Go to Edwiser Bridge > Settings > “Licenses” tab which will be created under the settings of Edwiser Bridge.
  2. The following screen will be available. Enter the license key provided in the purchase email in the ‘License Key‘ field and click the ‘Activate License‘ button.

edb-woocommerce-activate-license

Note: 

  • Every license issued is a single site license. You cannot use it on more than one website simultaneously.
  • If you need to migrate the plugin from your staging site to your live site you will have to first deactivate license key from the staging site and then use the same key on the live site.

Before Getting Started with the WooCommerce Moodle Integration

Following are a few WooCommerce settings you should take care of before getting started with the WooCommerce Moodle Integration for Edwiser Bridge.

1. Disable Guest Checkout

To disable the guest checkout option you will have to navigate to WooCommerce –> Settings –> Checkout and uncheck the ‘Enable Guest Checkout‘ option.

woocommerce-moodle-integration-guest-checkout

It is important to uncheck this option as users should not be able to purchase a course without registering to the WordPress site. If users are allowed to checkout without registration to the WordPress website their Moodle account will not be created. This happens because the Moodle account creation is triggered during the registration process of the WordPress account

2. Enable Registration on the Checkout Page

To enable registration at the checkout page, you will have to navigate to WooCommerce –> Settings –> Accounts from the back end. Here under the ‘Registration Options’ menu you will have to check the ‘Enable registration on the “Checkout” page‘ field provided.

woocommerce-moodle-integration-checkout-registration

3. Disable Automatic Password Generation

Automatic password generation should be disabled to allow the users to enter their own password. This password will then be used at the time of the Moodle account creation.

To disable the automatic password generation, you will have to navigate to WooCommerce –> Settings –> Accounts from the back end. Here under the ‘Registration Options’ menu you will have to uncheck the ‘Automatically generate customer password‘ field provided.

woocommerce-moodle-integration-password

4. Make the Product ‘Virtual’ & ‘Downloadable’

The product (which is essentially a course as a Product) should be made virtual and downloadable.

To configure this setting, you will have to go to the course product page and check the ‘Virtual’ and ‘Downloadable’ fields in the ‘Product Data’ meta box.

woocommerce-integration-virtual-downloadable

Getting Started with WooCommerce Integration

To start selling synchronized courses using WooCommerce, products will have to be created for courses in the WooCommerce store. This creation of courses as WooCommerce products can be done in any of the following two ways.

  1. By synchronizing courses as products from the Edwiser Bridge settings page.
  2. By associating courses with products from the product page at the back end.

1. Synchronizing Courses as WooCommerce Products from Edwiser Bridge Settings Page

  • Now that the plugin has been installed and the license key has been activated ‘WooCommerce Synchronization Options‘ will be made available to you in the Edwiser Bridge settings section.
  • To access these settings you will have to go to Edwiser Bridge -> Settings ->  Synchronization in the admin menu. Once here, you will be able to see the following settings once you click the ‘Products‘ link.

edwiser-bridge-woocommerce-integration-2

  • If you check the ‘Create courses as products‘ field and click the ‘Start Synchronization‘ button, all courses synchronized from Moodle are created as WooCommerce products. The products are published privately and will not be available to the end users.
  • If you check the ‘Update courses as products‘ field and click the ‘Start Synchronization‘ button, all courses that have been previously created as products will be updated.
  • Additionally, the price type of the course is set to ‘Closed‘ and the link of the corresponding WooCommerce product for the course is added to the ‘Optional Link‘ field on the course page.

woocommerce-integration-course-options

  • On checking the ‘Publish Synchronized Products‘ field, the courses that are created as private products will be published on the website and will be available to the end users.

2. Associating Courses with Products from the WooCommerce Product Page

  • To synchronize courses as products from the WooCommerce product page you will have to go to Products –> Add Product.
  • On the product page, a meta box labeled ‘Product Options‘ has been provided. This meta box contains a ‘Courses‘ field. You can use this field to select the course that you want to associate with this product.
  • The courses field in the metabox is a multiple select box which means multiple courses can be bundled together and be sold as a single product using the WooCommerce Integration plugin.

Edit Product ‹ rajiv — WordPress

  • Once the courses that have to be linked with a product have been selected and the necessary changes have been made to the product page it should be published.

What is Single Product Variation?

Variable products the product type in WooCommerce that lets you to, set variations to a product along with stock, prices, image etc.

We have customized this feature specifically for Moodle users who want to sell their courses through Edwiser Bridge and its extension WooCommerce Integration by setting some variations to it.

Below are the steps to create those variations and selling your Moodle course through WordPress.

  1. Setting Variations to a product,

  • Go to Products > Go to Edit Product > Go to Product Data section,
  • Here select the product type as “Variable Product”

Edwiser Bridge-WooCommerce Integration - Single Product Variation

 

 

2.  Add Attributes to use for Variations,

  • Click on “Add” button next to “Custom Product Attribute” drop down,
  • This will result in custom settings box showing up below for adding “Attributes Specific to Product”
  • There you can set the name of the Attribute, and set values to it.
  • Make sure that you check “Visible on products page” & “Used for variations” checkboxes.
  • Once done hit on “Save Attributes”

Edwiser Bridge-WooCommerce Integration - Single Product Variation

 

 

3.  Add Variations,

  • You will have to manually add variation to the product, by selecting “Add Variation” from the drop down.
  • Select attributes to variation, Click on triangle icon to expand variation and to add the relevant details in it.

Edwiser Bridge-WooCommerce Integration - Single Product Variation

 

 

4.  Adding course details to each Variations,

  • Set each variation as “Virtual”, “Downloadable” & “Enabled”
  • You can link a Moodle course to each variation.
  • Bundling of more than one course to a variation can also be achieved.
  • Once you have done that you could click on “Save Settings” and then Click on “Update Button” to set it live.

Edwiser Bridge-WooCommerce Integration

Hooks and Filters

HookDescriptionParameters
bridge_woo_course_product_createdUse this hook to execute custom code when a new product is created during synchronization from the settings page.$wp_product_id: WooCmmerce Product Id generated for a course
$wp_course_id : Id of Moodle course created on WordPress
$course_data: Course data coming from Moodle API
$sync_options:  Synchronization option selected by website admin
bridge_woo_course_product_updatedUse this hook to execute custom code when a new product is updated during synchronization from the settings page. $wp_course_id : Id of Moodle course created on WordPress
$course_data: Course data coming from Moodle API
$sync_options:  Synchronization option selected by website admin
bridge_woo_email_allowed_order_statusUse this hook to include information of courses associated with a product selectively in order status emails.array: This contains order status such as, ‘wc-processing’,’wc-completed’,’wc-on-hold’

Shortcodes

ShortcodeDescriptionParameters
bridge_woo_display_associated_coursesUsing this shortcode you can display the courses associated with a particular product on any required page.product_id: Id of product post type

 Templates

  • associated_courses_product_page.php

This template is used to display courses associated with a product on the single product page. The courses are displayed using the ‘bridge_woo_display_associated_courses’ shortcode. The template file ‘associated_courses_product_page.php’ can either be overridden in the ‘edwiserBridge/’ folder of your current theme or by using ‘eb_get_template’ & ‘eb_locate_template’ filters in a custom plugin.

  • associated_courses_order_email.php

This template can be used to include courses associated with a product in the order emails. The template file ‘associated_courses_order_email.php’ can either be overridden in the ‘edwiserBridge/emails’ folder of your current theme or by using ‘eb_get_template’ & ‘eb_locate_template’ filters in a custom plugin.