How to create Shortcode for WooCommerce Points & Rewards Plugin

How to create Shortcode for WooCommerce Points & Rewards Plugin

WooCommerce Points & Rewards is one of the best choice to implement points and reward system in your WooCommerce based website. With tons of features being continuously developed by WooThemes such as:

  • Easily define how many points are earned for purchases, and the value of points for discounts.
  • Control the maximum discount that can be earned using points at the cart, category, or product level.
  • Award customers points for actions like signing up or writing a product review.
  • Apply points earned to all previous orders so customers can start redeeming points for discounts immediately
  • Quickly adjust the points balance for a customer
  • View a log of all points changes made for customers

As of July 2017, the current version 1.6.4 dated May 2017 can only be displayed on the standard woocommerce default My Account page. Without the support of shortcode feature, it is quite troublesome to make it visible on any pages that we need. Especially if you are using a customised WooCommerce My Account page or plugin.

Therefore we will share here a working fix to create a custom shortcode for the My Points page to be used anywhere within your site. Additional codes has been added into the plugins core files for this purpose, therefore it is advisable to keep backup copy of the original file and take notes on the /**SHORTCODE** comments.

File to edit: woocommerce-points-and-rewards-template.php [around line 25 and below]

And an example of the implementation to make it works for YITH WooCommerce Customize My Account Page plugin.

Share this post

Leave a Reply

Your email address will not be published. Required fields are marked *