Shortcodes
Shortcodes

Referral Codes provides a lot of shortcodes you can use to display information to your customers. We’ll detail them here.

Find more shortcodes with their documentation directly in the plugin.

WordPress Admin
Admin menu
Referral Codes
Menu entry
Appearance
Page
Shortcodes
Group

Referral Code display

Shows the current user’s referral code if he has one.

[referral_code]

In addition, there are some options you can use with this shortcode

  • before : Displays a text before the code
  • after : Displays a text after the code
  • auto : Default is ‘false’. If set to ‘true’, a default Code will be generated for the user if they have never set one themselves.
  • raw : (Optional) If set to ‘true’, the result will be a simple text. If not, the result will be embedded in a stylable DOM element

Referral URL display

Shows the current user’s referral link if he has a code.

[referral_url]

In addition, there are some options you can use with this shortcode

  • before : Displays a text before the url
  • after : Displays a text after the url
  • auto : Default is ‘false’. If set to ‘true’, a default Code will be generated for the user if they have never set one themselves.
  • raw : (Optional) If set to ‘true’, the result will be a simple text. If not, the result will be embedded in a stylable DOM element

Referral Standby Amount

Referral earnings that weren’t converted into a reward yet.

[referral_total_amount period="year"]

In addition, there are some options you can use with this shortcode

  • period : A period over which the rewards are summed up. No time limit if omitted.
    • year : Covers a year (the last floating year unless yous define a reset date)
    • month : Covers a month (the last floating month unless yous define a reset date)
  • count : The number of periods to cover (default: 1). Ignored if the period option is omitted.
  • reset : A reference date for the period to start over as “day/month”, for example reset=”01/05″ period=”year” to start over each first of May. If reset is omitted, period is floating. Without a period, sum starts at this very date.
  • raw : (optional) If set to true, the result will be a simple numeric value. Otherwise, the result will be displayed as an amount with currency according to your WooCommerce settings

Conditional Display

Displays the content only if a condition is fulfilled. Shortcodes inside the content will be processed too.

[referral_mask condition="code"]My conditional content[/referral_mask]

In addition, there are some options you can use with this shortcode

  • condition : The settings to check. Possible values are :
    • code : Displays the content only if the current user has a Referral Code
    • standby : Displays the content only if the current user has a standby amount greater than zero.
    • coupon : Displays the content only if the reward settings are set to create coupons.
    • wallet : Displays the content only if the reward settings are set to add money to the virtual wallet.
  • not : (optional) Set it to true (not=”true”) to reverse the result. For example to show the content when a user has no code.
  • else : (optional) A simple text to display as an alternative.

Was this article helpful?
Dislike 0
Views: 119

Continue reading

Previous: WooCommerce
Next: Emails