Skip to content

Loyalty program (Points)

The loyalty program module lets you reward customers with points for their purchases and allows points to be redeemed for cart discounts.

The module has no admin screen. Its settings live in the polski_pro_loyalty option and are written through PUT /wp-json/polski-pro/v1/settings under the loyalty key, which requires the manage_woocommerce capability. Setting enabled to true there is what turns the module on.

Setting Description Default
Enabled Activates the loyalty program No
Points per 1 PLN How many points for each zloty 1
Value of 1 point Discount value of a single point 0.01 PLN
Min. points to redeem Minimum number of points to redeem 100
Max. discount % Maximum percentage discount from points 50%
Points expiration After how many days points expire 365
Rounding floor (down) or ceil (up) floor

Customers automatically receive points after a completed order.

  1. Per-product setting - the “Loyalty points per unit” field in the product editor
  2. Per-category setting - the field in the product category editor
  3. Default calculation - product price x points per 1 PLN

The product page automatically displays the information:

Earn X points for purchasing this product

Customers can redeem points for a discount on the cart or checkout page:

  1. The system shows the current balance and the discount value
  2. The customer enters the number of points to redeem
  3. A one-time coupon with the discount is created
  4. The coupon is applied automatically to the cart
  • Minimum number of points to redeem (configurable)
  • Maximum discount as a % of the cart value
  • Coupon valid for 24 hours

In the My account section a Loyalty program tab appears with:

  • Current points balance and its value in PLN
  • Total points earned
  • Total points used
  • Transaction history with dates, types and details

Points expire automatically after the configured period (365 days by default). The polski_daily_maintenance cron checks for expired points daily and deducts them from the balance.

Setting it to 0 = points never expire.

  • On order cancellation/refund, awarded points are automatically deducted
  • Protection against double accrual and deduction

In order confirmation emails the customer sees information about the number of points earned.

Hook Type Description
polski/loyalty/points_awarded action After points are awarded for an order
polski/loyalty/order_points filter Modify the number of points for an order