In my WooCommerce webshop, I am using a plugin that displays a checkout notice with the following function:
public function action_add_checkout_notice() {
$balance = (float) get_user_meta( get_current_user_id(), 'affwp_wc_credit_balance', true );
$cart_coupons = WC()->cart->get_applied_coupons();
$coupon_applied = $this->check_for_coupon( $cart_coupons );
$notice_subject = __( 'You have an account balance of', 'affiliatewp-store-credit' );
$notice_query = __( 'Would you like to use it now', 'affiliatewp-store-credit' );
$notice_action = __( 'Apply', 'affiliatewp-store-credit' );
// If the user has a credit balance,
// and has not already generated and applied a coupon code
if( $balance && ! $coupon_applied ) {
wc_print_notice(
sprintf( __( '%1$s <strong>%2$s</strong>. %3$s <a href="%4$s" class="button">%5$s</a>' ) ,
$notice_subject,
wc_price( $balance ),
$notice_query,
add_query_arg( 'affwp_wc_apply_credit', 'true', WC()->cart->get_checkout_url() ),
$notice_action
),
'notice' );
}
}
I would like to display that checkout notice to all user roles, except 'subscriber' user role. I have tried to do it without success.
How can I achieve this?
Thanks.