Charge Profile Views

Estimated reading: 7 minutes 559 views

Charging for Profile Access

By default, everyone view each other’s profiles in BuddyPress. This feature allows you to either set all profiles for sale by default or let your users select if they want to sell access or not. Profiles that are set for sale prohibits members from viewing the profile’s content / sub pages until a payment has been made in myCred points.

 

Once a member makes this payment, the profile is “unlocked” and is rendered based on your theme / active plugins. It’s important to remember that the plugin blocks access to the entire profile and can not be adjusted to block access to just parts of the profile or certain profile pages.

Installation

To enable this feature, you must visit your wp-admin area and under the myCred menu, visit the “BuddyPress Charges” page. Note that if you have multiple point type’s setup, this page will only be accessible from your main points type (first in the menu) only.

 

Clicking on “View profile” will scroll down and reveal your settings. Besides the very first option of “Charge for this”, you have a few options to consider when using this feature. These options can be grouped into three sections:

BuddyPress Options

First we need to decide what to call our BuddyPress Menu where users need to go for selling access to their profile or when buying access. These two can have the same titles but not the same Menu URL Slugs!

 

You can also set the position of the menu items, which might need some tweaking depending on what other custom profile menus exists.

 

Finally you are given the option to hide or show profile buttons e.g. “Add Friend” or “Send Private Message”. If you are using third-party plugins to add features or customize your BuddyPress installation, this option might conflict with them. If you are experiencing issues with buttons, make sure you disable this by selecting “Show profile buttons even if user has not purchased access”.

Sales Setup

Next we need to decide if we want to put all profiles for sale by default or if we want to give users the option to start selling access.

 

If you choose to set all profiles for sale, we will need to decide on a price and we get an option to give the profile owner a share of the payment. This share is defined in percentage and can be disabled by setting it to zero.

 

On the other hand we let users decide, we get the option to set a default price and a minimum / maximum price range that users can use. This can be used to for example prevent users from setting very high prices. We can also select to take a percentage of all sales as a “Fee” and set an option for purchases to expire after a given number of days. Once a purchase expires, the buyer will need to make a new purchase to regain access to the profile.

Settings when selecting to give users the option to sell access to profiles.
Settings when selecting to set all profiles for sale by default.
 

Templates

Finally we have our templates. These templates are used in the users profiles and in the myCred log and none of them can be left empty.

 

First, we have our three profile templates. These templates are what a user sees in a profile that is set for sale. This involves cases where the profile is viewed by someone who is not logged in (ignored if you do not allow public access to your website), when the profile is viewed by someone who is logged in but can not afford to pay the set price and when the profile is viewed by someone who has not paid yet but can afford to do so.

 

Under each template you will find a list of template tags that you can use in the above field. The most important template tag is the %button% tag. This can only be used in the “Sale Template” and it is responsible for rendering the purchase button. You can use shortcodes and virtually any type of content in these templates, but remember that just like myCred, this plugin does not come with built-in CSS, in order give you the freedom to style templates anyway you like. Most of the template content will be styled based on your theme.

 

Once you have setup your templates, just scroll down, save, and you are ready to go.

This is the “Sales Template” in action asking the user to pay in order to continue. While the profile navigation is visible, no matter where the user clicks, they will be redirected back to this page.
 

Profile Stats

Users that have profiles set for sale will gain access to a custom profile page where they can view their sales statistics. The page will show the amount of points they have made in sales along with their top buyer.

This page is only accessible to the profile owner and administrators.

Users that have profile sales enabled, will have access to a statistics page in their profile.
 

Profile Setup

This setup page is only accessible if you have not selected to enable sales by default. This is where users can select to enable / disable sales, the amount of points they want to charge and if sales expire. Users can also select if they want to give their “Friends” free access assuming the Friends module in BuddyPress is enabled!

If sales are optional, all users that are not excluded will gain access to a dedicated settings page in their profile.