Beispiel #1
0
    $date = $_REQUEST['date'];
}
$uid = $tour_id . $date;
$adults = isset($_REQUEST['adults']) ? $_REQUEST['adults'] : 1;
$kids = isset($_REQUEST['kids']) ? $_REQUEST['kids'] : 0;
if (($cart_data = CT_Hotel_Cart::get($uid)) && $adults == $cart_data['tour']['adults'] && $kids == $cart_data['tour']['kids']) {
    // init booking info if cart is not empty
    $total_price = $cart_data['tour']['total'];
} else {
    // init cart if it is empty
    $total_price = ct_tour_calc_tour_price($tour_id, $date, $adults, $kids);
    $cart_data = array('tour' => array('adults' => $adults, 'kids' => $kids, 'total' => $total_price), 'tour_id' => $tour_id, 'date' => $date, 'total_adults' => $adults, 'total_kids' => $kids, 'total_price' => $total_price);
    CT_Hotel_Cart::set($uid, $cart_data);
}
$cart = new CT_Hotel_Cart();
$cart_service = $cart->get_field($uid, 'add_service');
// main function
if (!ct_get_tour_checkout_page()) {
    ?>
	<h5 class="alert alert-warning"><?php 
    echo esc_html__('Please set checkout page in theme options panel.', 'citytours');
    ?>
</h5>
<?php 
} else {
    // function
    $is_available = ct_tour_check_availability($tour_id, $date, $adults, $kids);
    if (true === $is_available) {
        ?>

	<form id="tour-cart" action="<?php 
<?php

// validation
if (isset($_REQUEST['uid'])) {
    // init variables
    $uid = $_REQUEST['uid'];
    if (!CT_Hotel_Cart::get($uid)) {
        do_action('ct_hotel_booking_wrong_data');
        // ct_redirect_home() - if data is not valid return to home
        exit;
    }
    $cart = new CT_Hotel_Cart();
    $hotel_id = $cart->get_field($uid, 'hotel_id');
    $date_from = $cart->get_field($uid, 'date_from');
    $date_to = $cart->get_field($uid, 'date_to');
    $cart_rooms = $cart->get_field($uid, 'room');
    $cart_service = $cart->get_field($uid, 'add_service');
    $user_info = ct_get_current_user_info();
    $_countries = ct_get_all_countries();
    $deposit_rate = get_post_meta($hotel_id, '_hotel_security_deposit', true);
    $deposit_rate = empty($deposit_rate) ? 0 : $deposit_rate;
    // function
    if (!ct_get_hotel_thankyou_page()) {
        ?>
		<h5 class="alert alert-warning"><?php 
        echo esc_html__('Please set booking confirmation page in theme options panel.', 'citytours');
        ?>
</h5>
	<?php 
    } else {
        ?>
Beispiel #3
0
        do_action('ct_hotel_booking_wrong_data');
        // ct_redirect_home() - if data is not valid return to home
        exit;
    }
}
// init variables
$hotel_id = $_REQUEST['hotel_id'];
$date_from = $_REQUEST['date_from'];
$date_to = $_REQUEST['date_to'];
$room_ids = ct_hotel_get_available_rooms($hotel_id, $date_from, $date_to);
$deposit_rate = get_post_meta($hotel_id, '_hotel_security_deposit', true);
$deposit_rate = empty($deposit_rate) ? 0 : $deposit_rate;
$add_services = ct_get_add_services_by_postid($hotel_id);
$uid = $hotel_id . $date_from . $date_to;
$cart = new CT_Hotel_Cart();
$cart_service = $cart->get_field($uid, 'add_service');
if (!ct_get_hotel_checkout_page()) {
    ?>
	<h5 class="alert alert-warning"><?php 
    echo esc_html__('Please set checkout page in theme options panel.', 'citytours');
    ?>
</h5>
<?php 
} else {
    // function
    if (!empty($room_ids) && is_array($room_ids)) {
        ?>

	<form id="hotel-cart" action="<?php 
        echo esc_url(add_query_arg(array('uid' => $uid), ct_get_hotel_checkout_page()));
        ?>
foreach ($required_params as $param) {
    if (!isset($_REQUEST[$param])) {
        do_action('ct_tour_booking_wrong_data');
        // ct_redirect_home() - if data is not valid return to home
        exit;
    }
}
// init variables
$uid = $_REQUEST['uid'];
if (!CT_Hotel_Cart::get($uid)) {
    do_action('ct_tour_booking_wrong_data');
    // ct_redirect_home() - if data is not valid return to home
    exit;
}
$cart = new CT_Hotel_Cart();
$tour_id = $cart->get_field($uid, 'tour_id');
$date = $cart->get_field($uid, 'date');
$cart_tour = $cart->get_field($uid, 'tour');
$adults = $cart_tour['adults'];
$kids = $cart_tour['kids'];
$cart_service = $cart->get_field($uid, 'add_service');
$user_info = ct_get_current_user_info();
$_countries = ct_get_all_countries();
$deposit_rate = get_post_meta($tour_id, '_tour_security_deposit', true);
$deposit_rate = empty($deposit_rate) ? 0 : $deposit_rate;
// function
if (!ct_get_tour_thankyou_page()) {
    ?>
	<h5 class="alert alert-warning"><?php 
    echo esc_html__('Please set booking confirmation page in theme options panel.', 'citytours');
    ?>