wpsharks / s2member-kb

The s2Member® and s2Member® Pro Knowledge Base
9 stars 4 forks source link

How do I sell ebooks? #270

Open kristineds opened 8 years ago

kristineds commented 8 years ago
KB Article Creation Checklist
title: How do I sell ebooks?
categories: questions
tags:  pro-forms, custom-capabilities, conditional-tags
author: kristineds
github-issue: https://github.com/websharks/s2member-kb/issues/270

Introduction

See: s2Member → API/Scripting → Custom Capabilities (Packages) To learn more about custom capabilities, see this article

Step 1: Restrict content

Create a new page and add the text books to the Custom Capabilities restriction.

If you want to create a separate WordPress Page for each book, you can simply restrict each Book Page to the books Custom Capability, and then only users with the books Custom Capability will have access to those pages.

Step 2: Generate shortcode for [Payment Gateway] button

When generating the [Payment Gateway] button, add the necessary Custom Capabilities (e.g., books) to the generator before clicking the Generate Shortcode button. Otherwise, you should make sure that the ccaps="" attribute in the shortcode contains the Custom Capabilities that the new user should have assigned to their account after purchasing.

Step 3: Add the code below on the newly created page from Step1.

(This includes the shortcode for the [Payment Gateway] button generated from Step 2)

[s2If current_user_can(access_s2member_level1)]

    Some premium content for all Level 1 Members.

    [_s2If current_user_can(access_s2member_ccap_books)]
        Display links for downloading your eBooks.
    [/_s2If]
    [_s2If !current_user_can(access_s2member_ccap_books)]
        [s2Member-Pro-ClickBank-Button cbp="0" cbskin="" cbfid="" cbur="" cbf="auto" level="1" ccaps="books" desc="Upgrade Your Membership for access to my Books!" custom="example.com" rp="1" rt="L" rr="0" image="default" output="anchor" /]
    [/_s2If]

[/s2If]

[s2If !current_user_can(access_s2member_level1)]
    Some public content.
[/s2If]

Step 4: Restrict files based on custom capabilities

Create Custom Capability Sub-directories under: /wp-content/plugins/s2member-files. For the Custom Capability books, you can place protected files that should ONLY be accessible to Members with access_s2member_ccap_books, inside: /s2member-files/access-s2member-ccap-books/

So the protected file would look something like this: /s2member-files/access-s2member-ccap-books/KDP_book.pdf


See also:

raamdev commented 8 years ago

Awesome idea for a KB Article! I've been meaning to draft something like this for a long time. I'm glad you beat me to it! :-)


Here's some initial feedback:

I suggest not using something as generic as books for the Custom Capability. The title of this KB Article says "ebooks", i.e., more than one ebook, but all the examples here seem to explain how to provide access to one thing (books) and not multiple things (book1, book2, etc.).

I suggest using an example where someone wants to sell two separate ebooks (book1 and book2) and then explain how you can create a page for eBook 1 and another page for eBook 2. Then you could explain how /s2member-files/access-s2member-ccap-book1/ would contain all of the materials related to eBook 1 (e.g., PDF version of the ebook, Kindle version of the ebook, etc.).

A multiple eBooks example like this is likely to be far more common than someone just wanting to provide access to "all of their ebooks" via a single books Custom Capability. They're more likely to want to sell various ebooks, where people could buy one ebook, then come back and buy another later.

There are actually two ways to do this:

  1. Specific Post/Page (Buy Now), where visitors purchase access to an ebook and receive an email with a link to page that contains all the downloads. This has no account associated with the purchase.
  2. Membership Level Access + Custom Capabilities, where a user purchases a membership with a Custom Capability that gives them access to the book materials. In this scenario, if the user wanted to purchase more ebooks, they would need to use the Custom Capability (Buy Now) form to add a new Custom Capability to their existing account, so that their existing account gains access to the new ebook they're purchasing.

Both approaches have their pros and cons. The Specific Post/Page method is easier (for both the site owner and for the person purchasing access), however the Membership Level Access + Custom Capability method is more flexible and allows the site owner to collect the email address of the person purchasing. It also allows the site owner to keep track of how many ebooks each person has purchased and even expand the site in other ways going forward (e.g., they might decide later to add a discussion forum to their site--then all the existing users who purchased ebooks can use their existing account to gain access to the forum; if they used Specific Post/Page access, there would be no existing accounts and anyone who wanted to access the forum would then have to create an account).

There is actually a lot to the use case and I suggest changing this to a Tutorial and calling it "Selling eBooks with s2Member".

needmoreinfoarh commented 8 years ago

Absolutely!

Many of us are selling ebooks and the Website/Membership was an afterthought (prompted by friends/family) and a great idea.

jaswrks commented 8 years ago

@kristineds

Create a new page and add the text books to the Custom Capabilities restriction.

In addition to Raam's comments, a screenshot after this statement would be helpful.