Advertisement
wpgenie

change bid message

May 25th, 2018
562
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.61 KB | None | 0 0
  1. add_filter( 'woocommerce_simple_auctions_placed_bid_message' , 'custom_woocommerce_simple_auctions_placed_bid_message', 10, 2);
  2.  
  3. function custom_woocommerce_simple_auctions_placed_bid_message ($message,$product_id ){
  4.  
  5.     $product = wc_get_product($product_id);
  6.     $current_user = wp_get_current_user();
  7.  
  8.     if($current_user->ID == $product->get_auction_current_bider()){
  9.         if(!$product->is_reserve_met()){
  10.             if('yes' === $product->get_auction_sealed() )
  11.                 $message = sprintf( esc_html__( 'Successfully placed bid for "%s"!', 'wc_simple_auctions' ),$product -> get_title()  );
  12.         }
  13.     }
  14.  
  15.     return $message;
  16.  
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement