Skip Navigation

[Resolved] The best way to build a website that sells online courses?

This support ticket is created 7 years ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 1 reply, has 2 voices.

Last updated by Christian Cox 7 years ago.

Assisted by: Christian Cox.

Author
Posts
#587570
11111.jpg

Hello,

I would like to discuss with you the best way to build a website that sells online courses (screenshot attached).

Each course contains several lessons. Each lesson has a description + video clip. Those who buy the course (via PAYPAL) have access to all the lessons that belong to the course.

What is the best way to build such a thing?

Thanks

#587695

Hi, here's how I would approach this using Toolset and WooCommerce:
- Create a Course custom post type and a Lesson custom post type. Set Lessons to be children of Courses. Begin adding content to Courses and Lessons.
- Create Products for each Course in WooCommerce. This is what your Users will purchase to access each Course. You can configure WooCommerce to accept PayPal payments.
- Create a repeating numeric custom field on User profiles. This repeating numeric field will be used to store multiple Course IDs. The User will be able to access only the Courses that are included in their repeating numeric field. We will fill out this information programmatically, see below.
- Create a New User CRED form to allow Users to register for your site. Remove the repeating numeric field from the form, since you don't want your Users to be able to set this value.
- Create a new post type called "Purchase Tracker" or something similar. This post type will be hidden from the front-end of your site, and is used internally to track Order status and perform custom actions when the Order is complete.
- Create a custom field on the Purchase Tracker post type that stores a User ID.
- Create another custom field on the Purchase Tracker post type that stores a Course ID.
- Create a New Post CRED form that creates Purchase Tracker posts and activate CRED Commerce for this form.
- Remove the input fields from this CRED form except the submit button, which you can set to say "Buy Course" or something similar.
- Insert this CRED form in the page where you want to sell a Course.
- Supply values for the custom fields User ID and Course ID based on the current User's ID and the current Course ID. You can use Views shortcodes to supply these values: [wpv-post-id] and [wpv-current-user info="id"]
- Configure the form to select the proper Product and place that Product in the User's cart. Redirect the User to the checkout page, where they can use PayPal to purchase the product.
- Use the CRED Commerce API to detect when an Order is marked as complete in the WooCommerce Order dashboard, and copy the Course ID from the Purchase Tracker post into the User's repeating custom field.
- Use conditional HTML in the site to determine which Courses a User should be able to access. Hide any content they have not yet purchased.

As you can see, it's a complex scenario that's probably too much to try to handle in one ticket. I have some related documentation for you to review:
https://toolset.com/documentation/user-guides/using-cred-commerce-to-add-payments-to-forms/
https://toolset.com/documentation/user-guides/conditional-html-output-in-views/
https://toolset.com/documentation/programmer-reference/cred-commerce-api/#cred_commerce_after_order_completed