Pay Per View is an awesome module. It allows you to sell access to individual pieces of content, as opposed to sweeping access to content types based on Roles. This is really great for many business models which have premium nodes, like videos, yellow page entries, etc.
Today we are going to see how easy it is to sell access to nodes using Pay Per View. We won't need any special access control module for this, since Pay Per View handles all of that natively. So, without further ado, let's begin.
Installing and Configuring the Modules
First, we need to install MS Core, a payment gateway (we will use PayPal WPS for this tutorial), the Token module (a prerequisite of MS Core), and of course Pay Per View.
MS Core has a few settings you should look at, such as the currency and such things. Also, you will need to set up the Payment Gateway you chose to install. This tutorial won't cover those, but they are very straightforward.
Remember to set up the permissions for Pay Per View and MS Core. I suggest giving both anonymous and authenticated users the ability to access cart and checkout pages, and also the ability to purchase pay per view nodes. Don't give them the 'view x for free' permissions in the Pay Per View area or they will be able to bypass the payment for those content types.
Setting up the Content Type
So now we need to set up the content type. I am going to call it 'Premium Content'. Original, I know. So, the only thing we need to worry about is the PPV Settings fieldset on the Content Type Settings page when we are adding it. We need to click the checkbox to activate PPV for this content type, and set the default price and access period. You can leave the access period blank to have there be no expiration once a user has purchased the node.
Also, you need to set a 'protected message' which will show if the user doesn't have access to the node yet. You can use many different tokens in here, but I do suggest at least using the Add To Cart token that is there by default, so that the users can purchase access to the node.
Testing it out
Now we simply can create a node of the Premium Content type and see if it works. I've created one as a test. Note that the author, admin, and anyone else who has view content type x for free permission won't see the protected message. They will just see the full node as usual. So to test this, I will go to another browser and view it as an anonymous user. This is what it looks like:
So I am going to add this node to my cart and proceed to checkout.
Then we go on to PayPal
And finally return to the site.
Now we can go back to the node and find that we have been given access to view the full node.
We can also view all of the content we have purchased from the 'Your Content' tab in the User Account.
Well, that concludes this tutorial. As you can see, it is pretty straightforward yet very customizable. You can use this powerful module to build just about any business plan you need. I hope everyone enjoys this as much as I have!
















