How to Limit WooCommerce Points Redemption Based on Cart Total

By default, Loyalty Program for WooCommerce uses a single maximum points cap regardless of order size. That can be too generous on small orders and too restrictive on large ones. With a short snippet you can tier the cap so customers can redeem more points only when they are spending more, keeping point usage proportional to revenue.

Example Tiers

The example below uses three tiers: orders up to NT$1,500 allow 100 points maximum, orders up to NT$3,000 allow 250 points, and anything larger allows 500 points. Edit the $tiers array to fit your currency and pricing.

The Snippet

This uses the wpgens_loyalty_can_apply_points_at_checkout filter to intercept redemption attempts. When a customer tries to redeem more than the tier allows, the filter returns a WP_Error with a friendly message explaining the cap. The snippet also exposes the active cap on the widget configuration object, so custom redemption UI can read it and display the correct ceiling before the customer hits submit.

<?php
/**
 * Example: Different point redemption limits based on order amount
 *
 * Cap how many points a customer can redeem at checkout depending on the cart
 * total. For example:
 *  - Cart up to NT$1,500  -> max 100 points
 *  - Cart up to NT$3,000  -> max 250 points
 *  - Cart above NT$3,000  -> max 500 points
 *
 * Uses the `wpgens_loyalty_can_apply_points_at_checkout` filter to block
 * over-the-limit redemption attempts with a friendly message.
 *
 * Copy this snippet to your theme's functions.php or a small custom plugin.
 * Requires: Loyalty Program plugin with Points module, WooCommerce.
 */

if (!defined('ABSPATH')) {
	exit;
}

add_filter('wpgens_loyalty_can_apply_points_at_checkout', 'wpgl_limit_redeem_by_order_amount', 10, 4);

/**
 * @param bool|WP_Error $can_apply       Current decision (true to allow, WP_Error to block).
 * @param int           $user_id         User trying to redeem.
 * @param int           $points          Points the user is trying to redeem.
 * @param array         $conversion_rate Points conversion rate settings.
 * @return bool|WP_Error
 */
function wpgl_limit_redeem_by_order_amount($can_apply, $user_id, $points, $conversion_rate)
{
	// If something else already blocked it, don't override.
	if (is_wp_error($can_apply)) {
		return $can_apply;
	}

	if (!function_exists('WC') || !WC()->cart) {
		return $can_apply;
	}

	// Tiered redemption caps: cart subtotal threshold => max points allowed.
	// Keep ordered from lowest to highest threshold.
	$tiers = [
		1500 => 100,
		3000 => 250,
		PHP_INT_MAX => 500,
	];

	$cart_subtotal = (float) WC()->cart->get_subtotal();
	if ($cart_subtotal <= 0) {
		return $can_apply;
	}

	$max_points = 0;
	foreach ($tiers as $threshold => $limit) {
		if ($cart_subtotal <= $threshold) {
			$max_points = (int) $limit;
			break;
		}
	}

	if ($max_points <= 0 || $points <= $max_points) {
		return $can_apply;
	}

	return new WP_Error(
		'wpgl_redeem_over_limit',
		sprintf(
			/* translators: 1: max points, 2: cart subtotal */
			__('You can redeem up to %1$d points on an order of %2$s.', 'wpgens-loyalty-program'),
			$max_points,
			wp_strip_all_tags(wc_price($cart_subtotal))
		)
	);
}

/**
 * Optional: also cap the displayed slider/input on the redemption block so
 * customers see the correct ceiling before they try to apply.
 *
 * The plugin renders the redemption UI from settings; we expose the per-order
 * cap on the widget config so the frontend can read it if you customize the
 * template.
 */
add_filter('wpgens_loyalty_widget_config', 'wpgl_expose_redeem_cap_in_widget', 20);

function wpgl_expose_redeem_cap_in_widget($config)
{
	if (!function_exists('WC') || !WC()->cart) {
		return $config;
	}

	$tiers = [
		1500 => 100,
		3000 => 250,
		PHP_INT_MAX => 500,
	];

	$cart_subtotal = (float) WC()->cart->get_subtotal();
	if ($cart_subtotal <= 0) {
		return $config;
	}

	foreach ($tiers as $threshold => $limit) {
		if ($cart_subtotal <= $threshold) {
			$config['orderRedeemCap'] = (int) $limit;
			break;
		}
	}

	return $config;
}

Where to Put This Snippet

Drop the snippet into a small site-specific plugin under wp-content/mu-plugins/ so it survives theme changes, or paste it into your child theme’s functions.php. It is also available in the plugin folder under examples/.

Test the behavior by adding products until the cart sits inside one of your tiers, then try to redeem more points than the tier allows. The redemption should be blocked with the error message and the customer’s points balance left untouched.

Browse our plugins

Lightweight WooCommerce plugins built for speed. No bloat, no frameworks -- just clean code that works.

View all plugins
Stay in the loop

Get notified when we launch new plugins. No spam, just product updates.