It’s true that it would be much simpler to have a shortcode for each message!
I don’t think it’s very complicated to code, but unfortunately I don’t have the skills, and if I did, I’d do without the plugin; it lacks functionality.
// 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.’;
}
adding this to woocommerce-points-and-rewards.php should do the trick i think. no promises people. DO NOT IMPLEMENT YOURSELF LET THE DEVS TEST IT FIRST AND UPDATE IF THEY WISH (FINGERS CROSSED THEY DO)
It’s true that it would be much simpler to have a shortcode for each message!
I don’t think it’s very complicated to code, but unfortunately I don’t have the skills, and if I did, I’d do without the plugin; it lacks functionality.
// 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. no promises people. DO NOT IMPLEMENT YOURSELF LET THE DEVS TEST IT FIRST AND UPDATE IF THEY WISH (FINGERS CROSSED THEY DO)
yes this would defo be a good feature
Yes! I would love to be able to integrate points balance text anywhere. A widget would be great as well.