Updating to 1.7 – Sell Content Add-on

Home / Blog / Updating to 1.7 – Sell Content Add-on

The Sell Content Add-on

The Sell Content add-on has received a complete re-write in version 1.7, in order to accomodate some long awaited features. Once you update to 1.7, you will be required to update your settings in order to continue to use this add-on. In this article I will introduce you to these new features and walk you through the update process in detail.

Make sure you backup your website before updating to 1.7 in case something goes wrong during the update process. If you have any custom code that you have added to adjust how this add-on works, please remove them temporarily before updating to prevent issues during the update process.

Set for sale by default

One of the features that has been requested for a long time is the ability to set content for sale by default without having to edit each post, set it for sale and save. While installations with a few posts that needs to be set for sale might not be that cumbersome, this can quickly become a huge task if you have thousands of posts that needs to be set for sale.

In 1.7, your add-on settings will allow you to set content for sale by default. You can select to set all posts for sale or filter by taxonomies. For example you can now tell myCRED that all posts in a certain category should be for sale by default. This way, you can focus on the important stuff.

Of course if you don’t like / need this feature, there is a “Manual Mode” which instead requires you to manually set content for sale (like before 1.7).

Your New Settings

Once you update to 1.7, you will see a notice in the admin area, warning you that the Sell Content add-on needs to be updated. You can click on the provided button or go to the myCRED > Settings page where you will find (just like before) your Sell Content settings. If you have multiple point types setup, you will find your settings under your first point types menu.

The first thing you will see is a list of all publicly available post types that exists on your website. Here you will need to check all the post types that you want to put up for sale. You have to select at least one.

For each post type you select, myCRED will add a row under this list with a dropdown menu. By default this menu will indicate that you want to set all posts for sale. This is the filter setting that allows you to select if you want to filter posts by category / tag / taxonomy etc.

myCRED will list all registered taxonomies that each post type uses, so for Posts, you will see “Category” and “Tag” options while custom post types will show the taxonomies associated with that post type. If a post type does not have a taxonomy associated with it, it will not show up as an option.

You can select to use different filters for each post type that you select to set for sale as each post type is handled individually.

The new settings for the Sell Content add-on.

You have the following options in the dropdown menu:

Option Description
All "post type" All items of this post type will be set for sale.
"post type" I manually select Only items you manually select to set for sale are sold. When editing the post type you will see the "Sell This" metabox where you can enable sales of each particular item.
All "post type" except All items of this post type is set for sale with the exception of a list of post IDs that you provide.
Only "post type" Only items listed by ID are set for sale.
Only "post type" in Category Only items in one or multiple categories are set for sale.
Only "post type" not in Category Only items that are not in a particular category are set for sale.
Only "post type" with Tags Only items with a particular set of tags are set for sale.
Only "post type" without Tags Only items that do not have one of the tags you provide are set for sale.
Only "post type" with Format Only items with a particular format are set for sale.
Only "post type" without Format Only items that do not have a particular format is set for sale.

Costs & Accepted Payment Methods

Once you have setup what posts we want to sell, next we need to setup what point type we want to accept as payment and how much it will cost. In previous versions, myCRED only allowed you to set content for sale using one particular point type, in 1.7, you can use multiple point types. This means that users can pay using the point types you have enabled. Note that content is not sold by combining multiple types! Instead a user might be able to pay using one point type OR another.

Just like in previous versions, you can select to share the profits with the post author and optionally set sales to expire after certain number of hours.

Point type settings for content you set for sale.

The log entry templates can not be empty or users will be charged the amount but not be able to see the content they purchased!

Templates

In 1.7, all sales are handled via AJAX so the content is loaded without refreshing the page. If you prefer or if your content is not loaded correctly when purchased, you can select to override this and reload the page for each purchase.

Your final section is your templates. These are the templates that will be shown to the users when they have not yet purchased the content. Just like previous versions myCRED uses three different templates:

Members

Shown to logged in users that have not yet purchased the content they are viewing AND can afford to buy it. The custom template tag %buy_button% must be used somewhere in this template as it is where the purchase buttons will be rendered.

Visitors

Shown to users that are not logged in on your website.

Insufficient Funds

Shown to logged in users that can not afford to buy the content.

The Sell Content templates.
Shortcodes

I have added a few new shortcodes for the Sell Content add-on in version 1.7, but since all transactions are now handled via AJAX, it also means that the mycred_sell_this_ajax shortcode has been removed. Furthermore, the mycred_sell_this shortcode no longer allows you to set the cost of the content! This is because the shortcode’s purpose is to indicate to myCRED what section of your content needs to be set for sale. The cost of the content is controlled by your settings. So if you are using this shortcode and have the price set in the shortcode, these values will be ignored and instead the cost you set in your settings or in the metabox (if you are using manual mode) will be used.

 

Available Shortcodes

mycred_sales_history

This shortcode can be used to show the user viewing it a list of content they have purchased.

mycred_content_sale_count

This shortcode will render the number of times the content it is placed into has been sold.

mycred_content_buyer_count

This shortcode will render the number of unique users have purchased the content it is placed into.

mycred_content_buyer_avatars

This shortcode will render the avatars of users that have purchased the content the shortcode is placed into.

Final Notes

If you have custom code that adjusts how the Sell Content add-on works, it is important that you remove this before you update to 1.7 and then re-insert it once you have updated. This is because some of the functions the add-on uses has been removed or replaced and if the code uses these functions, you could end up with a fatal error (white screen of death). If this is happening to your code, please open a support ticket and include the code snippet you are using for me to help you update it. The same goes for installations that does not use custom code snippets but still experience issues.

Finally I feel the Sell Content add-on now has all the features an add-on like this should have and I do not plan on adding any further features. You can however submit a request for a quote if you need further custom features and I will be happy to help you out.

Please do not post issues or code snippets in the comments section as it will be deleted!

Last edited August 11, 2016