mycred_sales_history

Codex / mycred/content / Shortcodes / mycred_sales_history

Description

This shortcode will render a users content purchase history via the Sell Content add-on. As of version 1.7 the shortcode will render purchases in a boostrap ready table. You can select to filter results based on point type, set the number of entries you want to show and set the order.

You can use the mycred_sales_history_columns filter to adjust / add table columns as of version 1.7

Requires the Sell Content add-on to be enabled.

Available since version 1.0.9

Shortcode Attributes

Attribute Type Required Default Description
user_id int No current Option to filter purchase history based on user. By default it will show purchases made by the current user viewing the shortcode.
number int No 25 The number of purchases to show. Use -1 to show all purchases.
nothing string No "No purchases found" Message to show when the user has no purchase history. If this attribute is set to be empty and the user has not made any purchases yet, the shortcode will render nothing!
order string No DESC The purchase history is ordered by time of purchase and this attribute allows you to set the order. Accepts "DESC" for descending or "ASC" for ascending order.
ctype string No NULL Option to filter purchases based on point type if you allow payments using more then one point type. Should not be used if you only have one point type setup or you want to show all purchases no matter which point type was used as payment.

CSS Styling

// Wrapper
.mycred-sell-this-history { }

// Default table columns
.mycred-sell-this-history .col-date { }
.mycred-sell-this-history .col-title { }
.mycred-sell-this-history .col-amount { }
.mycred-sell-this-history .col-expires { }

// If results are empty
.mycred-sell-this-history .no-results { }

Examples

Example 1: Default usage.

[mycred_sales_history]

Example 2: Show all purchases and not just the last 25

[mycred_sales_history number="-1"]

Example 3: Show all purchases where user paid using the default point type.

[mycred_sales_history ctype="mycred_default"]

Example 4: Reverse order and show oldest purchases first going forward in time.

[mycred_sales_history order="ASC"]

Last edited June 23, 2016