function update_sale_price($post_id) { if (get_post_type($post_id) == $this->post_type) { $price = STRental::get_price($post_id); update_post_meta($post_id, 'sale_price', $price); } }
<?php if ($address = get_post_meta(get_the_ID(), 'address', TRUE)) { ?> <p class="mb0"> <small> <?php echo esc_html($address); ?> </small> </p> <?php } ?> <?php $is_sale = STRental::is_sale(); $orgin_price = STRental::get_orgin_price(); $price = STRental::get_price(); $show_price = st()->get_option('show_price_free'); ?> <?php $features = get_post_meta(get_the_ID(), 'fetures', true); if (!empty($features)) { ?> <?php echo '<ul class="booking-item-features booking-item-features-rentals booking-item-features-sign clearfix mt5 mb5">'; foreach ($features as $key => $value) { $d = array('icon' => '', 'title' => ''); $value = wp_parse_args($value, $d); echo '<li rel="tooltip" data-placement="top" title="" data-original-title="' . $value['title'] . '"><i class="' . TravelHelper::handle_icon($value['icon']) . '"></i>'; if ($value['number']) { echo '<span class="booking-item-feature-sign">x ' . $value['number'] . '</span>'; }
<?php extract($data); if (!$number_of_row) { $number_of_row = 4; } $col = 12 / $number_of_row; $price = STRental::get_orgin_price(); $is_sale = STRental::is_sale(); $price_sale = STRental::get_price(); ?> <!-- start loop rental --> <div <?php post_class('col-md-' . $col . ' style_box'); ?> > <?php echo STFeatured::get_featured(); ?> <div class="thumb"> <header class="thumb-header"> <a class="hover-img" href="<?php the_permalink(); ?> "> <?php if (has_post_thumbnail() and get_the_post_thumbnail()) { the_post_thumbnail(array(400, 300, 'bfi_thumb' => true)); } else { echo st_get_default_image();
<?php while ($query->have_posts()) { $query->the_post(); $info_room = $info_room[0]; $price = STRental::get_price($info_room->ID); $price = TravelHelper::format_money($price); $date = date('l d M', strtotime(get_post_meta($info_room->ID, 'sale_price_from', true))) . " - " . date('l d M', strtotime(get_post_meta($info_room->ID, 'sale_price_to', true))); $txt = '<div class="text-center text-white"> <h2 class="text-uc mb20">' . STLanguage::st_get_language('last_minute_deal') . '</h2>'; $view_star_review = st()->get_option('view_star_review', 'review'); if ($view_star_review == 'review') { $txt .= ' <ul class="icon-list list-inline-block mb0 last-minute-rating"> ' . TravelHelper::rate_to_string(STReview::get_avg_rate()) . ' </ul>'; } elseif ($view_star_review == 'star') { $txt .= '<ul class="icon-list list-inline-block mb0 last-minute-rating">'; $star = STHotel::getStar(); $txt .= TravelHelper::rate_to_string($star); $txt .= '</ul>'; } $txt .= '<h5 class="last-minute-title">' . get_the_title() . ' - ' . $info_room->post_title . ' </h5> <p class="last-minute-date">' . $date . '</p> <p class="mb20"> <b>' . $price . '</b> / ' . STLanguage::st_get_language('night') . ' </p> <a href="' . get_the_permalink() . '" class="btn btn-lg btn-white btn-ghost"> ' . STLanguage::st_get_language('book_now') . '<i class="fa fa-angle-right"></i> </a> </div>';
</span> <small> <?php st_the_language('avg/night'); ?> </small> </p> <?php } ?> <?php if (get_post_type($hotel_id) == 'st_rental') { ?> <?php $is_sale = STRental::is_sale($hotel_id); $orgin_price = STRental::get_orgin_price($hotel_id); $price = STRental::get_price($hotel_id); $show_price = st()->get_option('show_price_free'); ?> <?php $features = get_post_meta($hotel_id, 'fetures', true); if (!empty($features)) { ?> <?php echo '<ul class="booking-item-features booking-item-features-rentals booking-item-features-sign clearfix mt5 mb5">'; foreach ($features as $key => $value) { $d = array('icon' => '', 'title' => ''); $value = wp_parse_args($value, $d); echo '<li rel="tooltip" data-placement="top" title="" data-original-title="' . $value['title'] . '"><i class="' . TravelHelper::handle_icon($value['icon']) . '"></i>'; if ($value['number']) { echo '<span class="booking-item-feature-sign">x ' . $value['number'] . '</span>'; }
//check is booking with modal $st_is_booking_modal = apply_filters('st_is_booking_modal', false); ?> <form method="post" action=""> <?php if (!get_option('permalink_structure')) { echo '<input type="hidden" name="st_rental" value="' . st_get_the_slug() . '">'; } ?> <input type="hidden" name="action" value="rental_add_cart"> <input type="hidden" name="item_id" value="<?php the_ID(); ?> "> <input type="hidden" name="price" value="<?php echo STRental::get_price(); ?> "> <input type="hidden" name="number_room" value="1"> <input type="hidden" name="rental" value="<?php echo esc_attr($post->post_name); ?> "> <div class="booking-item-dates-change"> <div class="input-daterange" data-date-format="<?php echo TravelHelper::getDateFormatJs(); ?> "> <div class="row">
st_the_language('holiday_from'); ?> </span> <?php echo STHoliday::get_price_html($post_id, false, '<br>'); ?> <span class="info_price"></span> </div> <?php break; case 'st_rental': $is_sale = STRental::is_sale($post_id); $orgin_price = STRental::get_orgin_price($post_id); $price = STRental::get_price($post_id); $show_price = st()->get_option('show_price_free'); ?> <div <?php if ($layout == 'layout2') { echo 'class="list-location-2"'; } ?> > <span class="booking-item-price-from"><?php _e("From", ST_TEXTDOMAIN); ?> </span> <?php if ($is_sale) { echo "<span class='booking-item-old-price'>" . TravelHelper::format_money($orgin_price) . "</span>";