function evotx_metabox_002() { global $post, $evotx; $ticketItem_meta = get_post_meta($post->ID); $ticket_item = new evotx_TicketItem($post->ID, $ticketItem_meta); $tix = new evotx_ticket(); // Debug email templates $show_debug_email = false; if ($show_debug_email) { $order_id = $ticketItem_meta['_orderid'][0]; $order = new WC_Order($order_id); $tickets = $order->get_items(); $email_body_arguments = array('orderid' => $order_id, 'tickets' => $tickets, 'customer' => 'Ashan Jay', 'email' => 'yes'); $tt = $tix->get_ticket_email_body($email_body_arguments); print_r($tt); } // get event times $event_id = !empty($ticketItem_meta['_eventid']) ? $ticketItem_meta['_eventid'][0] : ''; $event_time = $ticket_item->get_event_time($event_id); // get corrected event ticket ids if (empty($ticketItem_meta['ticket_ids'][0])) { $tix->correct_tix_ids($ticketItem_meta, $post->ID); } ?> <div class='eventon_mb' style='margin:-6px -12px -12px'> <div style='background-color:#ECECEC; padding:15px;'> <div style='background-color:#fff; border-radius:8px;'> <table width='100%' class='evo_metatable' cellspacing="" style='vertical-align:top' valign='top'> <tr><td><?php _e('Woocommerce Order ID', 'eventon'); ?> #: </td><td><?php echo '<a class="button" href="' . get_edit_post_link($ticketItem_meta['_orderid'][0]) . '">' . $ticketItem_meta['_orderid'][0] . '</a>'; ?> </td></tr> <tr><td><?php _e('Ticket Type', 'eventon'); ?> : </td><td><?php echo !$ticketItem_meta['type'] ? $ticketItem_meta['type'][0] : '--'; ?> </td></tr> <?php $ticket_holder = !empty($ticketItem_meta['_customerid'][0]) && $ticketItem_meta['_customerid'][0] != '0' ? '<a href="' . get_edit_user_link($ticketItem_meta['_customerid'][0]) . '">' . $ticketItem_meta['name'][0] . '</a>' : $ticketItem_meta['name'][0]; ?> <tr><td><?php _e('Ticket Holder', 'eventon'); ?> : </td><td><?php echo $ticket_holder; ?> </td></tr> <tr><td><?php _e('Email Address', 'eventon'); ?> : </td><td><?php echo $ticketItem_meta['email'][0]; ?> </td></tr> <tr><td><?php _e('Quantity', 'eventon'); ?> : </td><td><?php echo $ticketItem_meta['qty'][0]; ?> </td></tr> <tr><td><?php _e('Cost for ticket(s)', 'eventon'); ?> : </td><td><?php echo get_woocommerce_currency_symbol() . $ticketItem_meta['cost'][0]; ?> </td></tr> <tr><td><?php _e('Event', 'eventon'); ?> : </td> <td><?php echo '<a href="' . get_edit_post_link($event_id) . '">' . get_the_title($ticketItem_meta['_eventid'][0]) . '</a>'; ?> <?php // if this is a repeat event show repeat information $event_meta = get_post_meta($event_id); if (!empty($event_meta['evcal_repeat']) && $event_meta['evcal_repeat'][0] == 'yes') { echo "<p>This is a repeating event.</p>"; } ?> </td></tr> <?php // get translated checkin status $st_count = $ticket_item->checked_count(); $status = $ticket_item->get_checkin_status('checked'); $__count = ': ' . (!empty($st_count['checked']) ? $st_count['checked'] : '0') . ' out of ' . $ticketItem_meta['qty'][0]; ?> <tr><td><?php _e('Ticket Status', 'eventon'); ?> : </td><td><?php echo $status . $__count; ?> </td></tr> <tr><td><?php _e('Ticket Time', 'eventon'); ?> : </td><td><?php echo $event_time; ?> </td></tr> <tr><td ><?php _e('Ticket(s)', 'eventon'); ?> #: </td><td> <?php // get ticket IDs for this ticket item $ticketids = $ticket_item->ticket_ids(); ?> <table id='evotx_ticketItem_tickets'> <?php if (is_array($ticketids)) { foreach ($ticketids as $ff => $vv) { ?> <tr><td><?php echo apply_filters('evotx_tixPost_tixid', $ff); ?> <br/><span class='tix_status <?php echo $vv; ?> ' data-tiid='<?php echo $post->ID; ?> ' data-tid='<?php echo $ff; ?> ' data-status='<?php echo $vv; ?> '><?php echo $ticket_item->get_checkin_status($vv); ?> </span></td></tr> <?php } } else { echo "<tr><td>{$ticketids}</td></tr>"; } ?> </table> </td></tr> <?php do_action('eventontx_tix_post_table', $post->ID, $ticketItem_meta); ?> </table> </div> </div> </div> <?php }
$torderItem = new evotx_ticket_orderitem($ticket_item, $args['orderid']); $event_id = $torderItem->event_id(); $e_pmv = get_post_custom($event_id); // verify only ticket items are in this email if (empty($event_id)) { continue; } // ticket item ID $ticket_item_id = $torderItem->the_ticket_item_id; // location data $location = (!empty($e_pmv['evcal_location_name']) ? $e_pmv['evcal_location_name'][0] . ' ' : null) . (!empty($e_pmv['evcal_location']) ? $e_pmv['evcal_location'][0] : null); // event time $ticketItem = new evotx_TicketItem($ticket_item_id); $__date = $ticketItem->_event_date($event_id, $e_pmv); $time = $ticketItem->get_correct_times($event_id, $e_pmv); $event_time = $ticketItem->get_event_time($event_id, $time['start'], $time['end']); ?> <tr> <td style='<?php echo $__sty_td; ?> '> <div class='event_date' style='<?php echo $__styles_06; ?> '> <p style='padding-top:10px;color:#555555; text-transform:uppercase; font-size:12px; margin:0px; line-height:100%'><?php echo date('D', $time['start']); ?> </p>