I have a wholesale side of website which when users logon are given the role “wholesale”. As these are trade customers I want to disable Clearpay on all product, category, cart and checkout pages. I have been able to disable the checkout page but really struggling with the individual product page and category pages.
This is the code I have tried to get to work.
add_filter( 'clearpay_is_product_supported', 'clearpay_ips_callback', 10, 2 );
function clearpay_ips_callback( $bool_result, $product ) {
if( wc_current_user_has_role( 'wholesale' ) ) {
$bool_result = false;
}
return $bool_result;
}
Can anyone help please
New contributor
user26579068 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.