custom post types – Create an user checklist system for a course plateform using ACF Pro and ACF Extended

Question

I’m currently trying to develop a learning plateform on my website and I want to integrate a system allowing users to check a list of step defined for each course.

I don’t have heavy PHP skills to be honest, I’m just able to understand what sample codes does and to bring some modification to existing codes.

So to give you some details :
I’m using Divi builder + All Divi Engine plugins to manage the front-end content and display dynamic content and ACF field in a simple way. Divi Machine is build to work with ACF to display ACF fields and form in a such custom way. So for the moment the front-end is not a problem.

I have created a CPT named “courses” on which I added an ACF Field Group to manage the course content (video / description etc.)

I have created another ACF field group on the “courses” CPT to manage the steps I want the user to follow. Inside this field group I added a repeater field with 2 text fields for the step title and instructions, and here come the difficult part.

The steps have to be edited by the administrator only for every course specifically (thats ok) but y want to add for every step inside every course a checkbox or boolean field that can be edited on the frontend by the user. I’m able to add an user field and to build a form to allow the user to check or uncheck the box but it is not specific for the step and course.

So I need to have on the DB or on the user fields a dynamic list of bool fields that sync with the list of steps and courses I create on the CPT side. Here an example :

Imagine I have 3 courses created with the “courses” CPT
In the first course I added 2 steps in my repeater, in the second courses I added 1 step and in the third course I added 3 steps.

On the user profile fields, my data should be organized like this :
Course 1 :
Step 1 :
Done : Yes/No
Step 2 :
Done : Yes/No
Course 2 :
Step 1 :
Done : Yes/No
Course 3 :
Step 1 :
Done : Yes/No
Step 2 :
Done : Yes/No
Step 3 :
Done : Yes/No

For every Step on the user profile fields I should have the label and description of step visible but not editable (as it should only be edited on the course cpt side).

To complicate the things again I need to have this system for separated courses programs that the user have access to or not depending on the woocommerce membership plugin so the field steps associated with courses the user is not a member of should not be added to the profile fields. But for that part i think I should find a solution.

Thanks in advance !

PS : I have ACF Pro and also ACF Extended Pro that add some pretty cool functionalities.

0
Alexandre ROMANI 4 months 2022-04-15T07:58:00-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse