= '0' ) ? ' +' . get_option( 'gmt_offset' ) : " " . get_option( 'gmt_offset' ); $gmt_offset = str_replace( array( '.25', '.5', '.75' ), array( ':15', ':30', ':45' ), $gmt_offset ); ob_start(); foreach ( $tickets as $ticket ) { global $product; if ( class_exists( 'WC_Product_Simple' ) ) { $product = new WC_Product_Simple( $ticket->ID ); } else { $product = new WC_Product( $ticket->ID ); } $end_date = $ticket->end_date; if ( empty( $ticket->end_date ) ) { $event_end_date = tribe_get_end_date(); if ( tribe_get_all_day( get_the_ID() ) ) $event_end_date = date( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ), strtotime( TribeDateUtils::endOfDay( $event_end_date ) ) ); $end_date = apply_filters( 'wootickets_default_end_date', $event_end_date, $ticket->ID ); if ( method_exists( 'DateTime', 'createFromFormat' ) ) { $end_date = DateTime::createFromFormat( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ), $end_date ); } else { $end_date = new DateTime( date( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ), strtotime( $end_date ) ) ); } if ( !empty( $end_date ) ) $end_date = $end_date->format( 'Y-m-d g:i a' ); } $end_date = strtotime( $end_date . $gmt_offset ); $start_date = null; if ( !empty( $ticket->start_date ) ) $start_date = strtotime( $ticket->start_date . $gmt_offset ); // if ( !empty( $ticket->start_date ) ) { // $start_date = DateTime::createFromFormat( get_option( 'date_format' ), $ticket->start_date ); // $start_date = strtotime( $start_date->format( 'Y-m-d' ) . $gmt_offset ); // } if ( ( !$product->is_in_stock() ) || ( empty( $start_date ) || time() > $start_date ) && ( time() < $end_date ) ) { $is_there_any_product = true; echo sprintf( "", $ticket->ID ); echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; $wootickets_pricing[] = $product->get_price(); } } $contents = ob_get_clean(); if ( $is_there_any_product ) { ?>

"; if ( $product->is_in_stock() ) { woocommerce_quantity_input( array( 'input_name' => 'quantity_' . $ticket->ID, 'input_value' => 0, 'min_value' => 0, 'max_value' => $product->backorders_allowed() ? '' : $product->get_stock_quantity(), ) ); $is_there_any_product_to_sell = true; } else { echo "" . esc_html__( 'Out of stock!', 'tribe-wootickets' ) . ""; } echo ""; echo $ticket->name; echo ""; echo $product->get_price_html(); echo ""; echo $ticket->description; echo "