Hide Class Based on User’s Subscription with variation
-
Hello,
I am trying to work out how to hide a class and when a logged in user has an active subscription with a variation.
So far I have the below function which i’m trying to use.
function has_woocommerce_subscription($the_user_id, $the_product_id, $the_status) { $current_user = wp_get_current_user(); if (empty($the_user_id)) { $the_user_id = $current_user->ID; } if (WC_Subscriptions_Manager::user_has_subscription( $the_user_id, $the_product_id, $the_status)) { return true; } }
I then have another snippet code
if (has_woocommerce_subscription('','5463','active')) { ?> <style> .hrfull {background: display: inherit !important;} .hrfree {display: none !important;} </style> <?php }
I am not having any luck. Any help would be great here.
Thank you,
Dv
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Hide Class Based on User’s Subscription with variation’ is closed to new replies.