Hi. How can we help?

Auctions - How to show a message when you successfully bid but the Reserve price has not been met

Adding the following snippet code, your customers will see a notice when the reserve price has not been met

Add the following code in functions.php of your theme:

if( !function_exists('yith_wcact_successfully_bid_notice' ) ) {
function yith_wcact_successfully_bid_notice($userid, $product, $args)
{
if ( $product->has_reserve_price() ) {

$instance = YITH_Auctions()->bids;
$max_bid = $instance->get_max_bid($product->get_id());

$reserve_price = $product->get_reserve_price();

if ($max_bid && $max_bid->bid <= $reserve_price ) {

if( $args['bid'] <= $reserve_price ) {
wc_add_notice(__('The Reserve has not been met. Please try again', 'yith-auctions-for-woocommerce'), 'error');
}

}

}

}

add_action('yith_wcact_successfully_bid', 'yith_wcact_successfully_bid_notice', 10, 3);
}
Was this article helpful?
0 out of 0 found this helpful

Back to Help Center >

Powered by Zendesk