WooCommerce Integration
Unlock the power of LearnDash and WooCommerce to elevate your e-learning platform with features designed to streamline your processes. You can use the WooCommere integration to connect courses and groups effortlessly to WooCommerce products, empower retroactive enrollment management for courses and groups, and seamlessly regulate enrollment status based on WooCommerce subscription expiration (WooCommerce Subscriptions add-on required).
Table of Contents [hide]
- 1Requirements
- 2Installation
- 3Set Up Your Product
- 4Additional Course/Group Configuration
- 5Additional Tips
- 6The User Experience
- 7Access and Enrollment Status
- 8Retroactive Course Access Tool
- 9Subscription Access Removal on Expiration
- 10FAQ
Requirements
To get started with the WooCommerce integration, you’ll need to have the LearnDash and WooCommerce plugins installed and activated. If you are planning to use subscriptions in WooCommerce, you’ll also need to have WooCommerce Subscriptions installed and activated.
Installation
Option 1: Add-ons Menu (requires activated LearnDash license )
- Navigate to LearnDash LMS > Add-ons in your WordPress dashboard
- Find the WooCommerce for LearnDash add-on under the Available section
- Click the Install button on the right side
- Click the Activate button for WooCommerce for LearnDash under the Installed section
Option 2: Manual Upload
- Visit https://account.learndash.com/plugins
- Click the Download link for the WooCommerce for LearnDash addon
- Once downloaded, visit Plugins > Add New Plugin in your WordPress dashboard
- Click the Upload Plugin button at the top of the screen
- Click the Choose File button and select the WooCommerce for LearnDash addon file that you downloaded
- Click Install Now, then click on Activate Plugin
Set Up Your Product
The integration allows you to associate both courses and/or groups to a product so that when your users purchase a product, they are enrolled into the courses/groups based on that specific order status.
NOTE
If you’re new to WooCommerce, consider reviewing the Getting Started guide before continuing. We’ll show you how to create a simple product, but there are many other setup options to consider.
Supported Product Types
WooCommerce supports various product types when configuring a product. You have the ability to associate courses/groups to the following types:
- Simple product
- Variable product
- Simple subscription
- Variable subscription
- Course
Depending upon your setup, you’ll need to choose the appropriate product type. Most users select either the “Simple product” or “Course” product type.
Before continuing, you’ll want to ensure that your courses/groups are already published and using the “Closed” access mode.
Course/Group Product Association
If you don’t already have a product created, navigate to Products > Add New in your WordPress dashboard. Otherwise, you can find your existing products at Products > All Products and select the product you want to modify.
The example below walks you through association if you are using either the “Simple product”, “Simple subscription” or “Course” product types mentioned above.
- Find the “Product data” metabox
- Click inside either the LearnDash Courses or LearnDash Groups fields, search for your course/group and click on it
- You can add multiple courses/groups to a product by clicking on the fields again, searching, and then clicking
- Click Update to ensure that the association saves
If you are using the “Variable product” or “Variable subscription” types, you’ll need to take a few additional steps. If you aren’t familiar with using variable products in WooCommerce, we suggest you check out their Variable Products documentation for more information.
- Find the “Product data” metabox
- Click the Attributes tab, then click Add New
- Configure a name and value(s) for the attributes following the instructions shown in the text area
- Click on Save Attributes once you are done
- Click the Variations tab, then either generate them automatically or add them manually
- Click on the Variation Item row to expand the settings
- Add your courses/groups using the LearnDash Courses and LearnDash Groups fields
- Click on Save Changes, then click on Update
Additional Course/Group Configuration
If you want to further optimize the checkout process for your users, you can add the product URL as the Button URL for the course/group.
- Visit your product on the front end of your site and copy the URL
- Visit LearnDash LMS > Courses or LearnDash LMS > Groups and select the course/group you want to modify
- Click on the Settings tab
- Find the Access Mode section, paste the product URL into the Button URL field
- Click Update to save your changes
Now, when visiting your course/group on the front end of your site, if users click on the button to enroll, they will be taken directly to the product page where they can make a purchase.
TIP
Want to speed up the checkout process? You can add the product to a user’s cart AND redirect them to the cart page all in one step. In the Button URL field, enter your cart URL (typically /cart/), followed by ?add-to-cart=123, where 123 is the WooCommerce product ID. The entire URL will look like this:
https://yoursite.com/cart/?add-to-cart=123
Additional Tips
While not required, there are a few additional things you might want to consider with your setup.
Add a Purchase Note
WooCommerce has a built-in field called “Purchase Note.” This note is shown to the customer on the purchase confirmation page, or in the customer’s receipt email after a successful purchase.
Consider using this field to provide instructions or next steps for taking your course, along with a link to the course page.
- Navigate to Products
- Click on the product you’d like to add a purchase note for
- Scroll down to the Product data section
- Click on the Advanced tab
- Enter your instructions and/or a link to your course
This field accepts HTML. Here’s an example to create a link to your course. Replace the URL with the URL to your specific course.
<a href=”https://yoursite.com/courses/course-name/”>Start This Course</a>
Post Purchase Redirect
After purchase, your customers are sent to the WooCommerce purchase confirmation page. You can bypass this step and send customers directly to the course by utilizing the Thank You Page for WooCommerce plugin:
https://wordpress.org/plugins/wc-thanks-redirect/
Once you have the plugin installed and activated, you’ll find a Thank You URL field when editing your product inside of the Product data metabox under the General tab.
Sales Funnel Using CartFlows
To optimize the checkout process for conversions, we recommend using the free CartFlows plugin which has an integration with LearnDash.
The User Experience
NOTE: When testing, we recommend visiting your site in a private browsing window. To see how the integration works, you should be logged out of your account (by default, administrators will already be enrolled in the course).
Once everything is set up correctly, there are a few ways in which potential customers can go through the process of purchasing one of your courses/groups. See the three examples below:
Customers start on your main shop page, which is automatically created by WooCommerce and contains a list of all of your products, including the ones that you’ve set up for your courses/groups:
1. The customers click on a product to visit the product page
2. They add the product to their cart
3. They complete the WooCommerce checkout process
4. If online payment was successful, they are enrolled into the configured courses/groups
The customer lands on your LearnDash course/group page first:
1. They click the “Take this Course” or “Join Group” button
2. They continue through the checkout process outlined above
- You create a separate landing page including a purchase button and link directly to the WooCommerce cart, bypassing the product page altogether:
https://yoursite.com/cart/?add-to-cart=123
NOTE: When going through the WooCommerce checkout process, users will be required to create an account during checkout. This is to ensure that enrollment into courses/groups associated with the product is successful.
Access and Enrollment Status
As of LearnDash WooCommerce 2.0.0, you can find the Enrollment Status option under LearnDash LMS > WooCommerce. This feature allows you full control over how a customer gains access to a course/group based on the order and subscription status.
The Enrollment Status feature contains a list of all order and subscription ( if using WooCommerce Subscriptions ) statuses and a toggle switch to control whether a user is enrolled in the courses/groups associated with the products in that order.
Order/Subscription Status
This column lists the different types of order and subscription statuses that are configured within WooCommerce, custom statuses are supported as well.
Access
This column has a Deny/Grant toggle switch that controls a user’s enrollment status into any courses/groups associated with a product(s) within that order.
Retroactive Course Access Tool
If you find that some customers don’t have the correct access to a course/group, you can use the retroactive course access tool to parse through the list of users on your site and update their enrollment status. To use this tool:
- Navigate to WooCommerce > Status
- Click on the Tools tab
- Scroll down to the “Give LearnDash Students Retroactive Access” row and click on Run
The tool will control enrollment based on the configuration set in the Enrollment Status feature.
Subscription Access Removal on Expiration
By default, if you have subscriptions set up, the associated course/group access will be removed as soon as the subscription expires. However, you can disable this default behavior:
- Navigate to WooCommerce > Settings
- Click on the “Subscriptions” tab
- Scroll down to the “LearnDash’ section and ensure that the checkbox for the Access Removal on Expiration setting is checked
- Click on “Save changes”
FAQ
Why wasn’t a user created and enrolled into the associated course/group after purchase?
If a user is not logged into your site already, during the checkout process an account will be required to be created in order to complete the payment. This requirement helps ensure that the user is properly enrolled into the associated course/group that is associated with the product being purchased.
Which payment gateways can I use with WooCommerce?
Any officially supported payment gateway should work.
Is this integration compatible with WooCommerce Subscriptions?
Yes!
Can I disable the account required setting during checkout?
Yes, you can use a snippet of code to disable this requirement. You can use a plugin such as Code Snippets to control this or add the following code into your active theme’s functions.php file:
add_filter( 'learndash_woocommerce_registration_required', function() { return false; } );