wpgenie icon

auctions relist for n minutes

wpgenie | PRO | 07/01/26 09:17:42 AM UTC | 1 ⭐ | 9506 👁️ | Never ⏰ | []
PHP |

790 B

|

None

|

1 👍

/

0 👎

add_filter( 'woocommerce_simple_auctions_automatic_relist_check_time', 'custom_woocommerce_simple_auctions_automatic_relist_check_time', 10, 4 );
function custom_woocommerce_simple_auctions_automatic_relist_check_time( $data, $auction_dates_to, $relist_delay, $product ) {
    return current_time( 'timestamp' ) > ( strtotime( $auction_dates_to ) + ( intval( $relist_delay ) * 60 ) );
}
add_filter( 'woocommerce_simple_auctions_relist_auction_to_time', 'custom_woocommerce_simple_auctions_relist_auction_to_time', 10, 2 );
function custom_woocommerce_simple_auctions_relist_auction_to_time( $to_time, $product ) {
    $relist_duration = $product->get_auction_relist_duration();
    $to_time         = date( 'Y-m-d H:i', current_time( 'timestamp' ) + ( $relist_duration * 60 ) );
    return $to_time;
}

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎