BST Category | Sitewide Banner Q1 2025

Added by Marketing - Russell L

Product Icon

WooCommerce Points and Rewards

Reward your customers for purchases and other actions with points which can be redeemed for discounts.

Add this to give a shortcode for points

// Add shortcode to display the logged-in user’s points
add_shortcode(‘user_points’, function() {
if (!is_user_logged_in()) {
return ‘You need to log in to view your points.’;
}

$user_id = get_current_user_id();
$points = get_user_meta($user_id, ‘wc_points_balance’, true);

if (!$points) {
$points = 0;
}

return ‘You have ‘ . $points . ‘ points.’;
});

adding this to woocommerce-points-and-rewards.php should do the trick i think.

DO NOT IMPLEMENT YOURSELF LET THE DEVS TEST IT FIRST AND UPDATE IF THEY WISH (FINGERS CROSSED THEY DO)

Author

winitrideit

Current Status

Open

Last updated: December 1, 2024

0 comments

Log in to comment on this feature request.