Integrating WPLMS with Custom ecommerce Plugin

Assuming that your custom eCommerce structure is similar to WooCommerce.

Meaning it has a Custom Post type for Products.

Here is a general way of how you can do this :

a. You need to redirect a user to a Custom Page/Product page where the user can Purchase the Product.

b. Attach the Course Meta box to the Custom Post type for Products.

c. You need to run a function when the order is complete, which identifies the courses connected to the product purchased

PART I : Redirect a User to Product page when user Clicks on Take this course

1. Go to WP Admin -> Plugins -> Editor -> WPLMS Customizer -> customizer_class.php
2. Add the following code in the function_construct()

PHP Code:

3. Add the following function in the class:
PHP Code:

 

 

PART II : Attach the Course Meta box to the Course Post type and Custom Post type for Products assumed as product.

1. Go to WP Admin -> Plugins -> Editor -> WPLMS Customizer -> customizer_class.php
2. Add the following code in the function_construct()

PHP Code:

3. Add the function in the Class:

PHP Code:

PART III : Run the function which grants access to the course on order completion .

1. Go to WP Admin -> Plugins -> Editor -> WPLMS Customizer -> customizer_class.php

2. Add the following code in the _construct function :

PHP Code:

3. Add the following function in the Class

PHP Code:


 

Was this article helpful?

Related Articles