/**
  * Prepares the list of items for displaying.
  */
 public function prepare_items()
 {
     $this->process_bulk_action();
     $event_id = isset($_GET['event_id']) ? $_GET['event_id'] : 0;
     $items = Tribe__Events__Tickets__Tickets::get_event_attendees($event_id);
     $this->items = $items;
     $total_items = count($this->items);
     $per_page = $total_items;
     $this->set_pagination_args(array('total_items' => $total_items, 'per_page' => $per_page, 'total_pages' => 1));
 }
 /**
  * Includes the tickets metabox inside the Event edit screen
  *
  * @param $post_id
  */
 public function do_meta_box($post_id)
 {
     $startMinuteOptions = Tribe__Events__View_Helpers::getMinuteOptions(null);
     $endMinuteOptions = Tribe__Events__View_Helpers::getMinuteOptions(null);
     $startHourOptions = Tribe__Events__View_Helpers::getHourOptions(null, true);
     $endHourOptions = Tribe__Events__View_Helpers::getHourOptions(null, false);
     $startMeridianOptions = Tribe__Events__View_Helpers::getMeridianOptions(null, true);
     $endMeridianOptions = Tribe__Events__View_Helpers::getMeridianOptions(null);
     $tickets = Tribe__Events__Tickets__Tickets::get_event_tickets($post_id);
     include $this->path . 'src/admin-views/tickets/meta-box.php';
 }
示例#3
0
 /**
  * Returns the sum of all checked-in attendees for an event. Queries all registered providers.
  *
  * @static
  *
  * @param $event_id
  *
  * @return mixed
  */
 public static final function get_event_checkedin_attendees_count($event_id)
 {
     $checkedin = Tribe__Events__Tickets__Tickets::get_event_attendees($event_id);
     return array_reduce($checkedin, array("Tribe__Events__Tickets__Tickets", "_checkedin_attendees_array_filter"), 0);
 }
示例#4
0
<?php

// Don't load directly
if (!defined('ABSPATH')) {
    die('-1');
}
$header_id = get_post_meta(get_the_ID(), $this->image_header_field, true);
$header_id = !empty($header_id) ? $header_id : '';
$header_img = '';
if (!empty($header_id)) {
    $header_img = wp_get_attachment_image($header_id, 'full');
}
$modules = Tribe__Events__Tickets__Tickets::modules();
?>

<table id="event_tickets" class="eventtable">
	<?php 
if (get_post_meta(get_the_ID(), '_EventOrigin', true) === 'community-events') {
    ?>
		<tr>
			<td colspan="2" class="tribe_sectionheader updated">
				<p class="error-message"><?php 
    _e('This event was created using Community Events. Are you sure you want to sell tickets for it?', 'tribe-events-calendar');
    ?>
</p>
			</td>
		</tr>
	<?php 
}
?>
	<tr>
示例#5
0
文件: Main.php 项目: TakenCdosG/chefs
 /**
  * Class constructor
  */
 public function __construct()
 {
     load_plugin_textdomain('tribe-wootickets', false, dirname(dirname(dirname(plugin_basename(__FILE__)))) . '/lang/');
     /* Set up some parent's vars */
     $this->pluginName = 'WooCommerce';
     $this->pluginSlug = 'wootickets';
     $this->pluginPath = trailingslashit(EVENTS_TICKETS_WOO_DIR);
     $this->pluginDir = trailingslashit(basename($this->pluginPath));
     $this->pluginUrl = trailingslashit(plugins_url($this->pluginDir));
     parent::__construct();
     $this->hooks();
 }
示例#6
0
    if (empty($stock) && $stock !== 0) {
        echo sprintf(__("Sold %d %s", 'tribe-events-calendar'), esc_html($sold), $pending);
    } else {
        echo sprintf(__("Sold %d of %d %s", 'tribe-events-calendar'), esc_html($sold), esc_html($sold + $stock), $pending);
    }
    echo '<br />';
    $total_sold += $sold;
    $total_pending += $ticket->qty_pending;
    $total_completed = $total_sold - $total_pending;
}
?>
					</td>
					<td width="33%" valign="middle">
						<div class="totals">
							<?php 
$checkedin = Tribe__Events__Tickets__Tickets::get_event_checkedin_attendees_count($event_id);
?>

							<span id="total_tickets_sold_wrapper">
								<?php 
_e('Tickets sold:', 'tribe-events-calendar');
?>
								<span id="total_tickets_sold"><?php 
echo $total_sold;
?>
</span>
							</span>

							<?php 
if ($total_pending > 0) {
    ?>
示例#7
0
 /**
  * Accepts the post object or ID for a product and, if it represents an event
  * ticket, returns the corresponding event object.
  *
  * If this cannot be determined boolean false will be returned instead.
  *
  * @param $possible_ticket
  *
  * @return bool|WP_Post
  */
 function tribe_events_get_ticket_event($possible_ticket)
 {
     return Tribe__Events__Tickets__Tickets::find_matching_event($possible_ticket);
 }
示例#8
0
 /**
  * Adds ticket data to the offers property of the event object.
  */
 protected function add_ticket_offers()
 {
     foreach (Tribe__Events__Tickets__Tickets::get_all_event_tickets($this->event_id) as $this->ticket) {
         $this->add_individual_offer();
     }
 }
示例#9
0
<?php

$this->orders_table->prepare_items();
$event_id = isset($_GET['event_id']) ? intval($_GET['event_id']) : 0;
$event = get_post($event_id);
$tickets = Tribe__Events__Tickets__Tickets::get_event_tickets($event_id);
/**
 * Filters whether or not fees are being passed to the end user (purchaser)
 *
 * @var boolean $pass_fees Whether or not to pass fees to user
 * @var int $event_id Event post ID
 */
Tribe__Events__Tickets__Orders_Table::$pass_fees_to_user = apply_filters('tribe_tickets_pass_fees_to_user', true, $event_id);
/**
 * Filters the fee percentage to apply to a ticket/order
 *
 * @var float $fee_percent Fee percentage
 */
Tribe__Events__Tickets__Orders_Table::$fee_percent = apply_filters('tribe_tickets_fee_percent', 0, $event_id);
/**
 * Filters the flat fee to apply to a ticket/order
 *
 * @var float $fee_flat Flat fee
 */
Tribe__Events__Tickets__Orders_Table::$fee_flat = apply_filters('tribe_tickets_fee_flat', 0, $event_id);
ob_start();
$this->orders_table->display();
$table = ob_get_clean();
$organizer = get_user_by('id', $event->post_author);
$event_revenue = Tribe__Events__Tickets__Orders_Table::event_revenue($event_id);
$event_sales = Tribe__Events__Tickets__Orders_Table::event_sales($event_id);