// 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)
Open
Last updated: December 1, 2024
0 comments
Log in to comment on this feature request.