コード例 #1
0
 /**
  * Retrieve the full HTML for the tickets email
  *
  * @param int $payment_id
  *
  * @return string
  */
 public function get_content_html($payment_id = 0)
 {
     $user_info = edd_get_payment_meta_user_info($payment_id);
     $args = array('post_type' => Tribe__Tickets_Plus__Commerce__EDD__Main::$attendee_object, 'meta_key' => Tribe__Tickets_Plus__Commerce__EDD__Main::$attendee_order_key, 'meta_value' => $payment_id, 'posts_per_page' => -1, 'fields' => 'ids');
     $query = new WP_Query($args);
     $attendees = array();
     foreach ($query->posts as $ticket_id) {
         $attendees[] = array('event_id' => get_post_meta($ticket_id, Tribe__Tickets_Plus__Commerce__EDD__Main::$attendee_event_key, true), 'ticket_name' => get_post(get_post_meta($ticket_id, Tribe__Tickets_Plus__Commerce__EDD__Main::$attendee_product_key, true))->post_title, 'holder_name' => $user_info['first_name'] . ' ' . $user_info['last_name'], 'order_id' => $payment_id, 'ticket_id' => $ticket_id, 'security_code' => get_post_meta($ticket_id, Tribe__Tickets_Plus__Commerce__EDD__Main::$security_code, true));
     }
     return Tribe__Tickets_Plus__Commerce__EDD__Main::get_instance()->generate_tickets_email_content($attendees);
 }
コード例 #2
0
ファイル: Stock_Control.php プロジェクト: TakenCdosG/chefs
 /**
  * Increments the inventory of the specified product by 1 (or by the optional
  * $increment_by value if provided).
  *
  * @param int $product_id
  * @param int $increment_by
  *
  * @return bool true|false according to whether the update was successful or not
  */
 public function increment_units($product_id, $increment_by = 1)
 {
     $ticket = Tribe__Tickets_Plus__Commerce__EDD__Main::get_instance()->get_ticket(null, $product_id);
     if (!$ticket || !$ticket->managing_stock()) {
         return false;
     }
     $stock = get_post_meta($product_id, '_stock', true);
     if (Tribe__Tickets_Plus__Commerce__EDD__Main::UNLIMITED === $stock) {
         return false;
     }
     return (bool) update_post_meta($product_id, '_stock', (int) $stock + $increment_by);
 }
コード例 #3
0
 /**
  * Check if EDD is installed and active.
  * If it is and the version is compatible, load our EDD connector.
  */
 protected function easy_digital_downloads()
 {
     // Check if the legacy plugin exists
     if (class_exists('Tribe__Events__Tickets__EDD__Main')) {
         $args = array('action' => 'deactivate', 'plugin' => $this->get_plugin_file('The Events Calendar: EDD Tickets'), 'plugin_status' => 'all', 'paged' => 1, 's' => '');
         $deactivate_url = wp_nonce_url(add_query_arg($args, 'plugins.php'), 'deactivate-plugin_' . $args['plugin']);
         $this->nag_data['easy_digital_downloads'] = array(__('Easy Digital Downloads', 'event-tickets-plus'), $deactivate_url, 'legacy-plugin');
         return;
     }
     if (!class_exists('Easy_Digital_Downloads') || !defined('EDD_VERSION')) {
         return;
     }
     // Here we will check for Comptibility problems
     if (!version_compare(EDD_VERSION, Tribe__Tickets_Plus__Commerce__EDD__Main::REQUIRED_EDD_VERSION, '>=')) {
         $this->nag_data['easy_digital_downloads'] = array(__('Easy Digital Downloads', 'event-tickets-plus'), add_query_arg(array('tab' => 'plugin-information', 'plugin' => 'easy-digital-downloads', 'TB_iframe' => 'true'), admin_url('plugin-install.php')), 'incompatible');
         return;
     }
     Tribe__Tickets_Plus__Commerce__EDD__Main::get_instance();
 }
コード例 #4
0
 /**
  * Get (and instantiate, if necessary) the instance of the class
  *
  * @static
  * @return Tribe__Tickets_Plus__Commerce__EDD__Main
  */
 public static function get_instance()
 {
     if (!self::$instance instanceof self) {
         self::$instance = new self();
     }
     return self::$instance;
 }
コード例 #5
0
ファイル: tickets.php プロジェクト: TakenCdosG/chefs
<?php

/**
 * Renders the EDD tickets table/form
 *
 * @version 4.2
 *
 * @var bool $must_login
 */
global $edd_options;
$is_there_any_product = false;
$is_there_any_product_to_sell = false;
$stock = Tribe__Tickets_Plus__Commerce__EDD__Main::get_instance()->stock();
ob_start();
?>
<h2 class="tribe-events-tickets-title"><?php 
esc_html_e('Tickets', 'event-tickets-plus');
?>
</h2>

<form action="<?php 
echo esc_url(add_query_arg('eddtickets_process', 1, edd_get_checkout_uri()));
?>
" class="cart" method="post" enctype='multipart/form-data'>
	<table width="100%" class="tribe-events-tickets">
			<?php 
foreach ($tickets as $ticket) {
    $product = edd_get_download($ticket->ID);
    if ($ticket->date_in_range(current_time('timestamp'))) {
        $is_there_any_product = true;
        $data_product_id = 'data-product-id="' . esc_attr($ticket->ID) . '"';
コード例 #6
0
ファイル: Attendees_List.php プロジェクト: TakenCdosG/chefs
 /**
  * Remove the Post Transients when a EDD Ticket is bought
  *
  * @param  int $attendee_id
  * @param  int $order_id
  * @return void
  */
 public function edd_purge_transient($attendee_id, $order_id)
 {
     $event_id = Tribe__Tickets_Plus__Commerce__EDD__Main::get_instance()->get_event_id_from_order_id($order_id);
     Tribe__Post_Transient::instance()->delete($event_id, Tribe__Tickets__Tickets::ATTENDEES_CACHE);
 }
コード例 #7
0
ファイル: Global_Stock.php プロジェクト: TakenCdosG/chefs
 /**
  * Returns an array of ticket objects for the specified event. The array is
  * indexed by ticket ID.
  *
  * @param int $event_id
  *
  * @return array
  */
 protected function get_event_tickets($event_id)
 {
     if (!isset($this->event_tickets[$event_id])) {
         $tickets = array();
         foreach (Tribe__Tickets_Plus__Commerce__EDD__Main::get_instance()->get_all_event_tickets($event_id) as $ticket_object) {
             /**
              * @var Tribe__Tickets__Ticket_Object $ticket_object
              */
             $tickets[$ticket_object->ID] = $ticket_object;
         }
         $this->event_tickets[$event_id] = $tickets;
     }
     return $this->event_tickets[$event_id];
 }