Sensei: When course access is delayed, possible conflict with Memberships

Created on 22 May 2017  路  3Comments  路  Source: Automattic/sensei

Re: Ticket 574925-zd-woothemes

Note from Beka at SkyVerge (3PD of Memberships):

I see this: https://github.com/Automattic/sensei/blob/21d6b189f8f67f2dc1294c801b3f9eebe63ae4ae/includes/class-sensei-wc-memberships.php#L129-L131

which won't start course access when the membership is purchased. As this really isn't needed (Memberships will handle the access on it's own, it doesn't need Sensei to do this check), thinking this should likely be removed.

cc @danjjohnson (I also cc'd you on the ticket)

[Pri] High [Type] Bug

Most helpful comment

@danjjohnson right now Sensei won't enroll the learner in the course unless the membership is active. Instead, it should enroll the learner in the course regardless of member status.

This is because Memberships has a concept of a "delayed" status if the membership period hasn't started yet (ie the plan starts later in the year), which means Sensei won't enroll the learner right away since this isn't an active status. However, this isn't needed; as the course _will be accessible_ in the future and the member sees the course in the "My content" list; they should already be enrolled, as it's confusing to see the course as a perk but think you have to sign up separately for it.

So the learner should be enrolled in the course when the membership is created, and Membership will still restrict it if the member isn't active. Basically, Sensei should enroll the learner and let Memberships decide when to show the course to the user, instead of Sensei trying to make that determination by checking active status right now.

The few lines @MindyPostoff referenced for the 'member active' should therefore be removed -- Sensei should put the learner in the course for the plan no matter the membership status, as Memberships will take it from there and control access based on the plan settings whether the member is active or not.

cc @pgk

All 3 comments

Thanks @MindyPostoff

While Memberships handles access to the course content, it doesn't actually enrol the learner in the course, so we added this to do that: https://github.com/Automattic/sensei/commit/6cd6509ec1c968079ac385afe8fbb0da1347e342

I'm not sure what's meant in the ticket by "It looks like this is because your course access is delayed"

If there's a problem with the method we've used, might need @bekarice to discuss with @pgk

@danjjohnson right now Sensei won't enroll the learner in the course unless the membership is active. Instead, it should enroll the learner in the course regardless of member status.

This is because Memberships has a concept of a "delayed" status if the membership period hasn't started yet (ie the plan starts later in the year), which means Sensei won't enroll the learner right away since this isn't an active status. However, this isn't needed; as the course _will be accessible_ in the future and the member sees the course in the "My content" list; they should already be enrolled, as it's confusing to see the course as a perk but think you have to sign up separately for it.

So the learner should be enrolled in the course when the membership is created, and Membership will still restrict it if the member isn't active. Basically, Sensei should enroll the learner and let Memberships decide when to show the course to the user, instead of Sensei trying to make that determination by checking active status right now.

The few lines @MindyPostoff referenced for the 'member active' should therefore be removed -- Sensei should put the learner in the course for the plan no matter the membership status, as Memberships will take it from there and control access based on the plan settings whether the member is active or not.

cc @pgk

@bekarice thanks for clarifying :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

danjjohnson picture danjjohnson  路  7Comments

BusinessBloomer picture BusinessBloomer  路  3Comments

richardmtl picture richardmtl  路  7Comments

danjjohnson picture danjjohnson  路  5Comments

gaurav1984 picture gaurav1984  路  4Comments