/** @see WP_Widget::widget */
 function widget($args, $instance)
 {
     $instance = array_merge($this->defaults, $instance);
     echo $args['before_widget'];
     if (!empty($instance['title'])) {
         echo $args['before_title'];
         echo apply_filters('widget_title', $instance['title'], $instance, $this->id_base);
         echo $args['after_title'];
     }
     echo EM_Multiple_Bookings::cart_contents($instance);
     echo $args['after_widget'];
 }
<?php

/*
* WARNING -This is a relatively new feature and is likly to change as we fine-tune things over the coming weeks/months, if at all possible try to use our hooks or CSS/jQuery to acheive your customizations
* This displays the booking cart showing the persons bookings, attendees and a breakdown of pricing.
* You can override the default display settings pages by copying this file to yourthemefolder/plugins/events-manager-pro/multiple-bookings/ and modifying it however you need.
* For more information, see http://wp-events-plugin.com/documentation/using-template-files/
*/
$EM_Multiple_Booking = empty($EM_Multiple_Booking) ? EM_Multiple_Bookings::get_multiple_booking() : $EM_Multiple_Booking;
/* @var $EM_Multiple_Booking EM_Multiple_Booking */
//TODO add delete booking from cart
//TODO make bookings editable
?>
<table class="em-cart-table em-mb-admin-table">
	<tbody class="em-cart-summary">
		<?php 
do_action('em_multiple_bookings_table_before_events', $EM_Multiple_Booking);
//do not delete
?>
		<tr class="em-cart-title">
			<th class="em-cart-title-event">Event</th>
			<th class="em-cart-title-spaces">Spaces</th>
			<th class="em-cart-title-price">Price</th>
		</tr>
		<?php 
foreach ($EM_Multiple_Booking->get_bookings() as $EM_Booking) {
    /* @var $EM_Booking EM_Booking */
    ?>
			<tr class="em-cart-table-event-summary" id="em-cart-table-event-summary-<?php 
    echo $EM_Booking->get_event()->event_id;
    ?>
<?php

/*
* WARNING -This is a recently added template (2013-01-30), and is likly to change as we fine-tune things over the coming weeks/months, if at all possible try to use our hooks or CSS/jQuery to acheive your customizations
* This displays the booking cart showing the persons bookings, attendees and a breakdown of pricing.
* You can override the default display settings pages by copying this file to yourthemefolder/plugins/events-manager-pro/multiple-bookings/ and modifying it however you need.
* For more information, see http://wp-events-plugin.com/documentation/using-template-files/
*/
if (empty($EM_Multiple_Booking)) {
    $EM_Multiple_Booking = EM_Multiple_Bookings::get_multiple_booking();
}
//TODO add delete booking from cart
//TODO make bookings editable
?>
<table class="em-checkout-table">
	<tbody class="em-checkout-summary">
		<?php 
do_action('em_checkout_form_before_events', $EM_Multiple_Booking);
//do not delete
?>
		<tr class="em-checkout-title">
			<th class="em-checkout-title-event">Event</th>
			<th class="em-checkout-title-spaces">Spaces</th>
			<th class="em-checkout-title-price">Price</th>
		</tr>
		<?php 
foreach ($EM_Multiple_Booking->get_bookings() as $EM_Booking) {
    /* @var $EM_Booking EM_Booking */
    ?>
			<tr class="em-checkout-table-event-summary" id="em-checkout-table-event-summary-<?php 
    echo $EM_Booking->get_event()->event_id;
    public static function cart_page()
    {
        if (!EM_Multiple_Bookings::get_multiple_booking()->validate_bookings_spaces()) {
            global $EM_Notices;
            $EM_Notices->add_error(EM_Multiple_Bookings::get_multiple_booking()->get_errors());
        }
        //load contents if not using caching, do not alter this conditional structure as it allows the cart to work with caching plugins
        echo '<div class="em-cart-page-contents" style="position:relative;">';
        if (!defined('WP_CACHE') || !WP_CACHE) {
            emp_locate_template('multiple-bookings/page-cart.php', true);
        } else {
            echo '<p>' . get_option('dbem_multiple_bookings_feedback_loading_cart') . '</p>';
        }
        echo '</div>';
        if (!defined('EM_CART_JS_LOADED')) {
            //load
            function em_cart_js_footer()
            {
                ?>
				<script type="text/javascript">
					<?php 
                include 'multiple-bookings.js';
                ?>
					<?php 
                do_action('em_cart_js_footer');
                ?>
				</script>
				<?php 
            }
            add_action('wp_footer', 'em_cart_js_footer', 100);
            add_action('admin_footer', 'em_cart_js_footer', 100);
            define('EM_CART_JS_LOADED', true);
        }
    }
Esempio n. 5
0
 static function mb_booking_form_footer()
 {
     $EM_Multiple_Booking = EM_Multiple_Bookings::get_multiple_booking();
     if ($EM_Multiple_Booking->get_price() > 0) {
         self::booking_form_footer();
     }
 }
Esempio n. 6
0
 public static function em_bookings_table_rows_col_coupon($val, $EM_Booking)
 {
     //if in MB mode, change $EM_Booking with the main booking to grab coupon info, given that we don't support per-event coupons in MB mode atm
     if (get_option('dbem_multiple_bookings')) {
         $EM_Multiple_Booking = EM_Multiple_Bookings::get_main_booking($EM_Booking);
         if ($EM_Multiple_Booking !== false) {
             $EM_Booking = $EM_Multiple_Booking;
         }
     }
     //check if coupon code exists for this booking, if so, get it and replace $val with coupon code
     if (self::booking_has_coupons($EM_Booking)) {
         $vals = array();
         $coupons = self::booking_get_coupons($EM_Booking);
         foreach ($coupons as $EM_Coupon) {
             $vals[] = $EM_Coupon->coupon_code;
         }
         $val = implode(' ', $vals);
     }
     return $val;
 }
 function em_bookings_table_rows_col($value, $col, $EM_Booking, $EM_Bookings_Table, $csv)
 {
     global $EM_Event;
     if ($col == 'gateway_txn_id') {
         //check if this isn't a multiple booking, otherwise look for info from main booking
         if (get_option('dbem_multiple_bookings')) {
             $EM_Multiple_Booking = EM_Multiple_Bookings::get_main_booking($EM_Booking);
             if ($EM_Multiple_Booking !== false) {
                 $EM_Booking = $EM_Multiple_Booking;
             }
         }
         //get latest transaction with an ID
         $old_limit = $this->limit;
         $old_orderby = $this->orderby;
         $old_page = $this->page;
         $this->limit = $this->page = 1;
         $this->orderby = 'booking_date';
         $transactions = $this->get_transactions($EM_Booking);
         if (count($transactions) > 0) {
             $value = $transactions[0]->transaction_gateway_id;
         }
         $this->limit = $old_limit;
         $this->orderby = $old_orderby;
         $this->page = $old_page;
     }
     return $value;
 }