SHARE
TWEET

extend auction end time on every bid placed

wpgenie Mar 13th, 2018 (edited) 419 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. add_action( 'woocommerce_simple_auctions_outbid', 'woocommerce_simple_auctions_extend_time', 50 );
  2.  
  3. function woocommerce_simple_auctions_extend_time($data){
  4.     $product = get_product( $data['product_id'] );
  5.     if ('auction' === $product->get_type() ){
  6.         $date1 = new DateTime($product->get_auction_dates_to());
  7.         $date1->add(new DateInterval('PT30S'));
  8.         update_post_meta( $data['product_id'], '_auction_dates_to', $date1->format('Y-m-d H:i:s') );
  9.     }
  10. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top