wpgenie

max single bid limit

May 4th, 2016
233
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. add_action('woocommerce_simple_auctions_before_place_bid' , 'custom_max_single_bid_limit' ,10 , 3);
  2.  
  3. function custom_max_single_bid_limit($product_id, $bid,$product_data) {
  4. global $product_data;
  5.  
  6.  
  7. if (($bid - $product_data->auction_current_bid) >= '100') {
  8.  
  9. wc_add_notice(sprintf('Your bid is bigger than max single bid amount', 'wc_simple_auctions'),'error');
  10. $product_data = FALSE;
  11. return false;
  12.  
  13.  
  14. }
  15.  
  16.  
  17. }
RAW Paste Data