Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_action( 'woocommerce_simple_auctions_outbid', 'woocommerce_simple_auctions_extend_time', 50 );
- add_action( 'woocommerce_simple_auctions_proxy_outbid', 'woocommerce_simple_auctions_extend_time', 50 );
- function woocommerce_simple_auctions_extend_time($data){
- $product = get_product( $data['product_id'] );
- if ('auction' === $product->get_type() ){
- $date1 = new DateTime($product->get_auction_dates_to());
- $date1->add(new DateInterval('PT30S'));
- update_post_meta( $data['product_id'], '_auction_dates_to', $date1->format('Y-m-d H:i:s') );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement