I have a similar issue on a wordpress on the content-product.php page
Here is what I'm trying to give out... sadly ain't working... any idea what i could use there to check if my members got their plan and show the price in function of that?
The first price is without discount. The second price is with vip discount.
<?php
if (wc_memberships_is_user_active_member($user_id, 'pack-vip') {
echo $price_val, $symbol
} else {
echo $price_val - $vip_discount, $symbol
}
So I have try with a few alternatives to echo...
//print / printf /printr doesn't work
//return (doesn't work)
//echo (doesn't work)
//empty before $price_val (doesn't work)
//What i want to deliver is something like
//echo $price_val - $vip_discount, $symbol //
//Without if or else, works fine but only for
//users without the pack VIP.
//For users with pack VIP, it reduces the prices
//again on it
//Solution, need to split with if else in content-
//product.php to verify
//If user is active member of 'pack-vip' (slug)
//Display the price without $vip_discount
?>