New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show post content for paid courses on single course page #2315

Merged
merged 1 commit into from Nov 14, 2018

Conversation

Projects
None yet
2 participants
@donnapep
Contributor

donnapep commented Nov 13, 2018

Fixes #2314.

This PR shows the post content of a course on the single course page when Access Permissions is selected and the course is attached to a product.

Testing

  • Check the Access Permissions checkbox in Sensei > Settings.
  • Attach a product to a course.
  • View the single course page as a logged out user.
  • Ensure that the post content is displayed.

@donnapep donnapep self-assigned this Nov 13, 2018

@donnapep donnapep added this to the 1.12.2 milestone Nov 13, 2018

@donnapep donnapep requested a review from alexsanford Nov 13, 2018

@donnapep donnapep changed the title from Show post content for paid courses to Show post content for paid courses on single course page Nov 13, 2018

@alexsanford

This works as described, but I'm not sure I follow the logic. From what I can see the following statements are true:

  • If "Users must be logged in to view Course and Lesson content" is FALSE (which means, unintuitively, that the variable $access_permission is TRUE), and the course is NOT attached to a product, we will show the full description. This makes sense to me.

  • If "Users must be logged in to view Course and Lesson content" is FALSE ($access_permission is TRUE), and the course IS attached to a product, we will show only the excerpt. Why wouldn't we show the full description in this case?

  • If "Users must be logged in to view Course and Lesson content" is TRUE ($access_permission is FALSE), and the course is NOT attached to a product, we will show only the excerpt. This makes sense to me.

  • If "Users must be logged in to view Course and Lesson content" is TRUE ($access_permission is FALSE), and the course IS attached to a product, we will show the full description. I guess this is the bug that we're fixing, but I'm not entirely sure it makes sense given how it behaves in other cases. If we're going to do this, why not just show the full description in every case?

I'm approving this because it works as described, but I just don't understand why it should work this way. If I'm just missing something obvious, go ahead and merge 🙂

@donnapep

This comment has been minimized.

Contributor

donnapep commented Nov 14, 2018

I went through and mapped out all of this logic yesterday, and the Access Permissions box complicates everything. 🙁(It's why I'm advocating to get rid of it.)

This code is somewhat counter-intuitive to that setting, but I wanted to provide a quick fix for people who are trying to sell paid courses, yet not go down the rabbit hole of fixing other scenarios that still don't work quite right (and likely never worked quite right it seems). Ultimately, I think the Access Permissions setting should only be applicable to lesson content, and not to content on the course page.

This fixes the reported issue though, and makes it easier for people who are selling courses to better entice their visitors to actually purchase a course.

Given all of the above, I'm going to go ahead and merge.

@donnapep donnapep merged commit b81101d into master Nov 14, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@donnapep donnapep deleted the fix/full-content-on-single-course branch Nov 14, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment