Advanced Shortcodes
Advanced Shortcodes

Knowledge Base

In this section, you will find shortcodes dedicated to advanced users

User status – Conditional Display

Use this shortcode to show content to your customers only if they meet the required condition(s).

[wr_conditional_display]The content to show[/wr_conditional_display]

Options

Here are the available options for this shortcode

  • system : The points and rewards systems for which to test the condition.
  • authorized : Only customers who have or don’t have access to the system will see the content.
    • yes : Default value. Only customers who have access to the system will see the content.
    • no : Only customers who don’t have access to the system will see the content
  • minpoints : (Optional) The customer must have at least this amount of points to see the content
  • maxpoints : (Optional) The customer must have at most this amount of points to see the content

Reward Button

Use this shortcode to show a button to your customers they can use to unlock a specific reward

[wr_reward_button reward=""] Button text [/wr_reward_button]

Options

Here are the available options for this shortcode

  • reward : The id of the reward to unlock. You can find this information if you place your mouse over a reward in your points and rewards system
  • applyreward : (Optional) If set, the reward will be automatically applied to the cart in addition to its unlock. Only applies for coupon type rewards
  • redirection : (Optional) If set, customers will be redirected to the set url. Otherwise, customers will either be redirected to the cart page (if the rewards has to be applied) or to the current page
  • alt : (Optional) Alternative text if the reward cannot be redeemed for any reason

Cart Content – Conditional Display

Use this shortcode to show content to your customers only if the current cart meet the required condition(s).

[wr_is_in_cart coupons="yes"] Button text [/wr_is_in_cart]

Options

Here are the available options for this shortcode, all are optionnal. If several are used, all must be validated to show the shortcode content

  • coupons : If set, test if the current cart contains at least one discount coupon (yes) or none (no)
  • coupon_codes : If set, use the value as a Regular Expression (including delimiters) to test the coupon codes in the current cart.
  • products : If set, test if the cart contains at least one product with the given ID. Accept a list of coma separated product IDs.
  • cats : If set, test if the cart contains at least one product belonging to the category with the given ID. Accept a list of coma separated category IDs (no slugs).
  • tags : If set, test if the cart contains at least one product tagged with the given tag ID. Accept a list of coma separated tag IDs (no slugs).
  • guest : If set, test if the current customer is logged in (no) or a simple guest (yes)
  • not : Set it with the value true to reverse the tests above. For example, to test if a given product is not in the cart.
Was this article helpful?
Dislike 0
Views: 504

Continue reading

Previous: Badges and Achievements