add_action( 'woocommerce_simple_auctions_before_place_bid','check_influence_before_bid',10,3 );
function check_influence_before_bid($product_id, $bid, $product) {
global $product_data;
$user_id = get_current_user_id();
$mycred = mycred();
$balance = $mycred->get_users_balance( $user_id );
if ( $balance < $bid ) {
wc_add_notice (sprintf(__('You dont have enough Influence to bid!', 'wc_simple_auctions'), get_permalink(woocommerce_get_page_id('myaccount'))), 'error');
$product_data = FALSE;
return false;
}
}
Comments