Select Page
View Categories

LearnDash and WooCommerce Integration

In order to be able to use LearnDash and WooCommerce together you need to install the “Learndash Woocommerce Integration” add-on. If you have purchased the LearnDash plugin already this add-on will be free for you. You can see this add-on’s full documentation here: https://www.learndash.com/support/docs/add-ons/woocommerce/ 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.

How to set up your paid through woocommerce course #

Step 1: Create a product #

To do that first you need to create a product, which will be associated with the course. To do that go to Products > Add New. Then, add a name to the product. The best practice for the name of the product is to be exactly the same as the name of the course that we want to associate it with. This way the product will be easier to work with and there will be no room for mistakes later. Then, scroll down the page until you see the Product Data tab. Then, from the drop-down field choose “course”. This will be your product type. And give the product a price – this will be your course price. Then in the “LearnDash Courses” field below add the course that you want to associate the product with. To add it just begin typing its name in the field and click on the course when it shows in the list of courses. Then, upload a featured image for this product. The featured image should be the same as your course featured image. You need to that because this is the image that’s shown on the Mini Cart and Cart Pages when your buyer adds this product(course) to cart. Then, click on the Publish button to publish the product.

Step 2: Setup the course page #

Navigate your course page by going to admin / LearnDash LMS / Courses and click on the course to enter its page. Then click on the Settings tab and scroll down to see the “Course Access Settings” box. Then from the options choose and enter your course price. This is going to be how your course price will be displayed on the course grid and on the course page horizontal status bar. Then, in the “Button URL” field add the URL to your product plus this: ?add-to-cart=(insert product id here) After the equals sign you need to enter the id pf the product that this course is associated with. Example: https://divi-learndash.powdithemes.com/product/brand-identity-and-strategy-for-creatives/?add-to-cart=3033

How to find a product’s id number #

To do that navigate to the products list by going to admin / Products and hover over a product to see its id number:

How to setup your product page to display a button that leads to your course page #

If you are using WooCommerce and Learndash together for your desired course payment and management solution then you will have both a course page and a product page for that course on your site. The product page will be accessible from the Mini Cart and Cart page of your site – If a user clicks on a course added to cart from the mini cart or from the cart page the user will be redirected to the corresponding product page, not the course page. And, as this might cause confusion, to avoid this confusion and make the UX better, Divi eLearn child theme comes with a pre-made layout for your product pages, to smoothly direct users to the course pages. This is how it looks like:
As the product page layout is a Theme Builder layout, the button “Go to course page” needs to display a dynamic information, as that link will be different for each product. So, what you need to do in order for this link and layout to work properly for each product is: 1. Within the product admin page scroll down to “Custom fields” box and click on “Enter New”
2. In the name box type course_url . And in the value box insert the link to the course page (the link can be relative as shown in the example below)
3. Add the product to “Courses” category. 4. Don’t forget to click “Update Product” button at the end