/* custom show countdown timer in loop, future auctions have Starts Sunday, 30 July instead of countdown timer */
add_action( 'woocommerce_after_shop_loop_item_title','wpgenie_show_counter_in_loop',50 );
function wpgenie_show_counter_in_loop() {
global $product;
$time = '';
$future_class = '';
if ( ! isset( $product ) ) {
return;
}
if ( 'auction' !== $product->get_type() ) {
return;
}
$timetext = esc_html__( 'Time left', 'wc_simple_auctions' );
if ( ! $product->is_started() ) {
// $timetext = esc_html__( 'Starting in', 'wc_simple_auctions' );
// $counter_time = $product->get_seconds_to_auction();
$future_class = ( $product->is_closed() === false ) && ( $product->is_started() === false ) ? 'future' : '';
echo apply_filters( 'time_text', esc_html__( 'Starts', 'wc_simple_auctions' ), $product->get_id() ). ' ';
echo date_i18n( 'l, j F', strtotime( $product->get_auction_start_time() ) ).'
';
echo $time;
} else {
$counter_time = $product->get_seconds_remaining();
$time = '' . $timetext . '