Example #1
0
        $page_search = st_get_page_search_result('st_rental');
        if (!empty($page_search)) {
            $link = add_query_arg(array('location_id' => get_the_ID()), get_the_permalink($page_search));
        } else {
            $link = home_url(esc_url('?s=&post_type=st_rental&location_id=' . get_the_ID()));
        }
        if ($offer < 2) {
            $offer = $offer . " " . __("Rental from", ST_TEXTDOMAIN);
        } else {
            $offer = $offer . " " . __("Rentals from", ST_TEXTDOMAIN);
        }
        echo '<li><a href="' . $link . '"><i class="fa fa-home"></i> ' . $offer . ' ' . $min_price . '/' . STLanguage::st_get_language('night') . '</a></li>';
    }
}
$car = new STCars();
if ($car->is_available()) {
    $min_price = get_post_meta(get_the_ID(), 'min_price_st_cars', true);
    $min_price = TravelHelper::format_money($min_price);
    $offer = get_post_meta(get_the_ID(), 'offer_st_cars', true);
    if (!empty($min_price) and !empty($offer)) {
        $page_search = st_get_page_search_result('st_cars');
        if (!empty($page_search)) {
            $link = add_query_arg(array('location_id' => get_the_ID()), get_the_permalink($page_search));
        } else {
            $link = home_url(esc_url('?s=&post_type=st_cars&location_id=' . get_the_ID()));
        }
        if ($offer < 2) {
            $offer = $offer . " " . __("Car from", ST_TEXTDOMAIN);
        } else {
            $offer = $offer . " " . __("Cars from", ST_TEXTDOMAIN);
        }
Example #2
0
            } else {
                //$link = home_url(esc_url('?s=&post_type=st_hotel&location_id='.get_the_ID()));
                //$link = home_url(esc_url('?s=&post_type=st_rental&location_id='.get_the_ID()."&pick-up=".get_the_title()));
                $link = add_query_arg(array('s' => '', 'post_type' => 'st_rental', 'location_id' => get_the_ID(), 'pick-up' => get_the_title()), home_url('/'));
            }
            if ($offer <= 1) {
                $offer_string = sprintf(__('%d Rental from %s/night', ST_TEXTDOMAIN), $offer, $min_price);
            } else {
                $offer_string = sprintf(__('%d Rentals from %s/night', ST_TEXTDOMAIN), $offer, $min_price);
            }
            echo '<li><a href="' . $link . '"><i class="fa fa-home"></i> ' . $offer_string . '</a></li>';
        }
    }
}
$car = new STCars();
if ($car->is_available() && TravelHelper::checkTableDuplicate('st_cars')) {
    $info = new STLocation();
    $info = $info->get_info_by_post_type(get_the_ID(), 'st_cars');
    $min_price = $info['min_max_price']['price_min'];
    $min_price = TravelHelper::format_money($min_price);
    if (empty($min_price) or !$min_price) {
        $min_price = __("Free", ST_TEXTDOMAIN);
    }
    if (is_array($info) && count($info)) {
        $offer = $info['offers'];
        if (!empty($offer)) {
            $page_search = st_get_page_search_result('st_cars');
            if (!empty($page_search) and get_post_type($page_search) == 'page') {
                //$link = add_query_arg(array('location_id'=>get_the_ID()),get_the_permalink($page_search));
                $link = add_query_arg(array('location_id_pick_up' => get_the_ID(), 'pick-up' => get_the_title()), get_the_permalink($page_search));
            } else {