Die [simple_points_rewards] shortcode lets you display loyalty data for the currently logged-in customer on any post, page, or widget.
Basic Usage #
[simple_points_rewards display="points"]
Attributes #
| Attribute | Values / Default | Description |
|---|---|---|
display |
See below | What data to output (required) |
user_id |
0 (current user) | User ID to display data for. Admins can pass any user ID. |
format |
raw, currency, percent, number |
How to format the output value |
decimals |
2 | Decimal places for formatted numbers |
vor |
“” | HTML to output before the value |
after |
“” | HTML to output after the value |
empty |
“” | HTML to output when the value is empty or user is not logged in |
base_url |
Home URL | Custom base URL for referral links |
Display Values #
| Value | Description |
|---|---|
Punkte |
Current spendable points balance |
total_earned |
Lifetime total points earned (all-time) |
points_value |
Monetary value of current balance (if checkout redemption is enabled) |
points_label |
The configured points label (e.g. “Points”) |
level_name |
Customer’s current level name |
level_id |
Customer’s current level ID |
level_multiplier |
Current level points multiplier (e.g. “1.5”) |
next_level_name |
Name of the next level tier |
next_level_points |
Points threshold for the next level |
points_to_next_level |
Points still needed to advance |
level_progress_percent |
Percentage progress toward next level |
referral_code |
Customer’s unique referral code |
referral_link |
Full referral URL |
referral_clicks |
Total referral link clicks |
referral_referrals |
Number of successful referrals |
referral_points_earned |
Points earned from referrals |
Examples #
// Display balance with label
[simple_points_rewards display="points" before="You have " after=" Points"]
// Show referral link
[simple_points_rewards display="referral_link"]
// Progress to next level as percentage
[simple_points_rewards display="level_progress_percent" after="%"]
// Points needed to next level
[simple_points_rewards display="points_to_next_level" before="Only " after=" points until Gold!"]
// Monetary value of balance
[simple_points_rewards display="points_value" format="currency"]
Additional Shortcodes #
Beyond the data-display shortcode above, the plugin provides several shortcodes for rendering full UI components on any page. Brackets below are shown literally – use them exactly as written.
[spar_points_rewards] #
Renders the entire Rewards dashboard – the same content shown on the My Account → Rewards tab – on any page or post. Includes the points summary, ways to earn, claimable rewards, points history, redeemed vouchers, and referral section. Useful if you want a dedicated standalone rewards page instead of (or in addition to) the My Account tab.
[spar_points_rewards]
[spar_checkout_rewards_box] #
Renders the rewards/redemption box (the same component shown at checkout) on any page. Displays the customer’s balance and the points-discount redemption interface. Requires the Points Discount at Checkout feature to be enabled.
[spar_checkout_rewards_box]
[spar_redeem_discount_tool] #
Renders the full (non-compact) points redemption tool, letting the customer convert their points balance into a cart discount. Only displays for logged-in, non-banned customers when Points Discount at Checkout is enabled.
[spar_redeem_discount_tool]
[spar_redeem_discount_compact] #
Renders a compact redemption row suitable for placement within cart/checkout totals areas. A space-efficient version of the redemption tool above.
[spar_redeem_discount_compact]
Shortcodes Summary #
| Shortcode | Purpose |
|---|---|
[simple_points_rewards] |
Display a single data value (balance, level, referral data, etc.) |
[spar_points_rewards] |
Render the full Rewards dashboard |
[spar_checkout_rewards_box] |
Render the checkout rewards box |
[spar_redeem_discount_tool] |
Render the full points redemption tool |
[spar_redeem_discount_compact] |
Render the compact redemption row |