WC Points & Rewards Filters
-
Hi,
I’m looking to create a filter that alters the text displayed at the checkout page depending on whether a user is logged in or not. If not, they are suggested to login in order to qualify for the points.
PHP isn’t my strong point – this is what I’ve come up with so far but doesn’t work. If someone could point me in the right direction it would be greatly appreciated.
apply_filters ( 'wc_points_rewards_earn_points_message', $message, $points_earned ); function points_rewarded_message($message) { if(is_user_logged_in()) { return "Complete your order and earn {points} points for a discount on a future purchase"; } else { return"Please login to qualify for your Cavendish Points"; } }
Thanks,
Joe
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘WC Points & Rewards Filters’ is closed to new replies.