/**
  *
  *
  * @since 1.1.3
  * */
 static function _format_money()
 {
     $data = STInput::post('money_data', array());
     if (!empty($data)) {
         foreach ($data as $key => $value) {
             $data[$key] = TravelHelper::format_money($value);
         }
     }
     echo json_encode(array('status' => 1, 'money_data' => $data));
     die;
 }
示例#2
0
 function get_book_history($type = '')
 {
     global $current_user;
     get_currentuserinfo();
     $user_id = $current_user->ID;
     $paged = 1;
     if (!empty($_REQUEST['paged'])) {
         $paged = $_REQUEST['paged'];
     }
     // get list id order
     $arg = array('post_type' => 'st_order', 'paged' => $paged, 'post_status' => array('publish'), 'posts_per_page' => '10', 'meta_query' => array(array('key' => 'id_user', 'value' => array($user_id), 'compare' => 'IN')));
     if (STInput::request('data_type')) {
         $type = STInput::request('data_type');
     }
     if ($type != "") {
         $arg['meta_query'][] = array('key' => 'status', 'value' => array($type), 'compare' => 'IN');
     }
     query_posts($arg);
     $html = '';
     global $wp_query;
     while (have_posts()) {
         the_post();
         $id_item = get_post_meta(get_the_ID(), 'item_id', true);
         $check_in = get_post_meta(get_the_ID(), 'check_in', true);
         $check_out = get_post_meta(get_the_ID(), 'check_out', true);
         $total_price = get_post_meta(get_the_ID(), 'item_price', true);
         $comment_post_id = apply_filters('st_real_comment_post_id', $id_item);
         $action = '';
         $user_url = st()->get_option('page_my_account_dashboard');
         $data['sc'] = 'write_review';
         $data['item_id'] = $id_item;
         if (STReview::check_reviewable($comment_post_id) and comments_open($comment_post_id)) {
             $action = '<a href="' . st_get_link_with_search(get_permalink($user_url), array('sc', 'item_id'), $data) . '">' . st_get_language('user_write_review') . '</a>';
         }
         if ($check_in and $check_out) {
             $date = mysql2date('d/m/y', $check_in) . ' <i class="fa fa-long-arrow-right"></i> ' . mysql2date('d/m/y', $check_out);
         }
         if (get_post_type($id_item) == 'st_tours') {
             $type_tour = get_post_meta($id_item, 'type_tour', true);
             if ($type_tour == 'daily_tour') {
                 $duration = get_post_meta($id_item, 'duration_day', true);
                 $date = __("Check in : ", ST_TEXTDOMAIN) . mysql2date('d/m/y', $check_in) . "<br>";
                 $date .= __("Duration : ", ST_TEXTDOMAIN) . $duration;
             }
         }
         $icon_type = $this->get_icon_type_order_item($id_item);
         if (!empty($icon_type)) {
             $html .= '
             <tr class="' . get_the_ID() . '">
                 <td class="booking-history-type ' . get_post_type($id_item) . '">
                    ' . $this->get_icon_type_order_item($id_item) . '
                 </td>
                 <td class="booking-history-title"> <a href="' . $this->get_link_order_item($id_item) . '">' . $this->get_title_order_item($id_item) . '</a></td>
                 <td>' . $this->get_location_order_item($id_item) . '</td>
                 <td>' . get_the_date() . '</td>
                 <td>' . $date . '</td>
                 <td>' . TravelHelper::format_money($total_price) . '</td>
                 <td>' . get_post_meta(get_the_ID(), 'status', true) . '</td>
                 <td>' . $action . '</td>
             </tr>';
         }
     }
     wp_reset_query();
     if (!empty($_REQUEST['show'])) {
         if (!empty($html)) {
             $status = 'true';
         } else {
             $status = 'false';
         }
         echo json_encode(array('html' => $html, 'data_per' => $paged + 1, 'status' => $status));
         die;
     } else {
         return $html;
     }
 }
示例#3
0
</a></h5>
                        <?php 
        if ($address = get_post_meta(get_the_ID(), 'address', TRUE)) {
            ?>
                            <p class="mb0">
                                <small> <?php 
            echo esc_html($address);
            ?>
</small>
                            </p>
                        <?php 
        }
        ?>
                        <p class="mb0 text-darken"><span
                                class="text-lg lh1em"><?php 
        echo TravelHelper::format_money(STHotel::get_avg_price());
        ?>
</span>
                            <small> <?php 
        st_the_language('avg/night');
        ?>
</small>
                        </p>
                    </div>
                </div>
            </div>
        <?php 
    }
    ?>
    </div>
<?php 
示例#4
0
            _e('review', ST_TEXTDOMAIN);
        }
        ?>
                                </p>
                            <?php 
    }
    ?>
                            <?php 
    if (!empty($offer)) {
        ?>
                                <p class="mb0">
                                    <?php 
        if ($offer > 1) {
            printf(__('%d offers from %s', ST_TEXTDOMAIN), $offer, TravelHelper::format_money($min_price));
        } else {
            printf(__('%d offer from %s', ST_TEXTDOMAIN), $offer, TravelHelper::format_money($min_price));
        }
        ?>
                                </p>
                            <?php 
    }
    ?>
                        </div>
                    </div>
                </a>
            </div>
        </div>
<?php 
}
?>
</div>
        echo date(get_option('date_format'), strtotime($data['data']['check_in']));
        ?>
                    <?php 
    }
    ?>
                    <?php 
    if (isset($data['data']['check_out'])) {
        ?>
                    <?php 
        st_the_language('to');
        echo date(get_option('date_format'), strtotime($data['data']['check_out']));
        ?>
                    <?php 
    }
    ?>
</small>
                </p>
            </div>
            <div class="col-xs-3">
                <p class="text-right"><span class="text-lg">
                    <?php 
    $money = STCart::get_hotel_price($data['data'], $data['price'], $data['number']);
    echo TravelHelper::format_money($money);
    ?>
                </span>
                </p>
            </div>
        </div>
    </li>
    <?php 
}
                        <?php 
        echo '<span class="onsale">' . $price_old . '</span> <i class="fa fa-arrow-right "></i>';
        ?>
                        <?php 
    }
    ?>
                        <strong><?php 
    echo TravelHelper::format_money($price_car);
    ?>
</strong>
                        <small>/<?php 
    echo STCars::get_price_unit();
    ?>
</small>
                    </p>
                </li>
                <li>
                    <p class="booking-item-payment-price-title"><?php 
    st_the_language('car_total');
    ?>
 </p>
                    <p class="booking-item-payment-price-amount"><?php 
    echo TravelHelper::format_money($item['data']['price_total']);
    ?>
                    </p>
                </li>
            </ul>
        </li>
    </ul>
<?php 
}
示例#7
0
                                        <?php 
if (!empty($info_price)) {
    foreach ($info_price as $k => $v) {
        ?>
                                                    <tr>
                                                        <td>
                                                            <?php 
        echo date('d/m/Y', strtotime($v['start']));
        ?>
                                                            <i class="fa fa-arrow-right "></i>
                                                            <?php 
        echo date('d/m/Y', strtotime($v['end']));
        ?>
                                                        </td>
                                                        <td><?php 
        echo TravelHelper::format_money($v['price']);
        ?>
/<small><?php 
        st_the_language('per_night');
        ?>
</small></td>
                                                    </tr>

                                                <?php 
    }
}
?>
                                        </table>
                                    </div>
                                </div>
                                <div class="form-row">
示例#8
0
                     </tbody>
                     <tr class="bg-white">
                         <th>
                             <?php 
 _e("Total", ST_TEXTDOMAIN);
 ?>
                         </th>
                         <td class="text-center">
                             <?php 
 echo esc_html($data_js['info_total']['number_orders']);
 ?>
                         </td>
                         <td class="text-center">
                             <?php 
 if ($data_js['info_total']['average_total'] > 0) {
     echo TravelHelper::format_money($data_js['info_total']['average_total']);
 } else {
     echo "0";
 }
 ?>
                         </td>
                     </tr>
                 </table>
             </div>
         </div>
     </div>
 </div>
 <script>
     var data_lable = <?php 
 echo balanceTags($data_js['lable']);
 ?>
示例#9
0
        }
        echo '</li>';
    }
    echo "</ul>";
    ?>
            <?php 
}
?>
            <div>
                <?php 
if (!empty($is_sale)) {
    ?>
                    <span class="text-small lh1em  onsale">
                                    <?php 
    echo TravelHelper::format_money($price);
    ?>
                                </span>
                    <i class="fa fa-long-arrow-right"></i>
                <?php 
}
?>
                <?php 
if (!empty($price)) {
    echo '<span class="text-darken mb0 text-color">' . TravelHelper::format_money($price_sale) . '<small> /' . __('night', ST_TEXTDOMAIN) . '</small></span>';
}
?>
            </div>
        </div>
    </div>
</div>
<!-- end loop rental -->
示例#10
0
"><i class="im im-width"></i><span class="booking-item-feature-sign"><?php 
    echo esc_html($room_footage);
    ?>
</span>
                        </li>
                    <?php 
}
?>
                </ul>
                <ul class="booking-item-features booking-item-features-small clearfix">
                    <?php 
get_template_part('single-hotel/room-facility', 'list');
?>
                </ul>
            </div>
                <div class="col-md-3">
                    <span class="booking-item-price-from"><?php 
st_the_language('user_from');
?>
</span>
                                <span class="booking-item-price">
                                    <?php 
echo TravelHelper::format_money(get_post_meta(get_the_ID(), 'price', true));
?>
                                </span>
                </div>
        </div>
    </a>
</li>

示例#11
0
    ?>
</th>
            </tr>
            </thead>
            <tbody>
                <?php 
    foreach ($_data_post as $k => $v) {
        ?>
                    <tr>
                        <th scope="row"><strong><?php 
        $obj = get_post_type_object($k);
        echo esc_html($obj->labels->singular_name);
        ?>
</strong></th>
                        <td><?php 
        echo TravelHelper::format_money($v['average_total']);
        ?>
</td>
                        <td><?php 
        echo esc_html($v['number_items']);
        ?>
</td>
                    </tr>
                <?php 
    }
    ?>
            </tbody>
        </table>
    </div>
<?php 
}
示例#12
0
$count_sale = $info_price['discount'];
$price_origin = $info_price['price_origin'];
?>
                    <?php 
if ($cars_price != $price_origin) {
    ?>
                        <span class="text-lg lh1em sale_block onsale">
							<?php 
    echo TravelHelper::format_money($price_origin);
    ?>
                        </span>
                    <?php 
}
?>
                    <?php 
echo TravelHelper::format_money($cars_price);
?>
                </span>
            <span class="booking-item-price-unit">/<?php 
echo strtolower(STCars::get_price_unit('label'));
?>
</span>
            <?php 
$category = get_the_terms(get_the_ID(), 'st_category_cars');
?>
            <?php 
$txt = '';
if (!empty($category)) {
    foreach ($category as $k => $v) {
        $txt .= $v->name . ' ,';
    }
示例#13
0
 static function get_price_html($post_id = false, $get = false, $st_mid = '', $class = '')
 {
     /*
      * since 1.1.3
      * filter hook get_price_html
      */
     if (!$post_id) {
         $post_id = get_the_ID();
     }
     $html = '';
     $prices = self::get_price_person($post_id);
     $adult_html = '';
     $adult_new_html = '<span class="text-lg lh1em item ">' . TravelHelper::format_money($prices['adult_new']) . '</span>';
     // Check on sale
     if (isset($prices['adult']) and $prices['adult']) {
         if ($prices['discount']) {
             $adult_html = '<span class="text-small lh1em  onsale">' . TravelHelper::format_money($prices['adult']) . '</span>&nbsp;&nbsp;';
             $html .= sprintf(__('Adult: %s %s', ST_TEXTDOMAIN), $adult_html, $adult_new_html);
         } else {
             $html .= sprintf(__('Adult: %s', ST_TEXTDOMAIN), $adult_new_html);
         }
     }
     /*$child_new_html = '<span class="text-lg lh1em item ">' . TravelHelper::format_money( $prices[ 'child_new' ] ) . '</span>';
     
     
                 // Price for child
                 if($prices[ 'child_new' ]) {
                     $html .= ' ' . $st_mid . ' ';
     
                     // Check on sale
                     if(isset( $prices[ 'child' ] ) and $prices[ 'child' ] and $prices[ 'discount' ]) {
                         $child_html = '<span class="text-small lh1em  onsale">' . TravelHelper::format_money( $prices[ 'child' ] ) . '</span>&nbsp;&nbsp;';
     
                         $html .= sprintf( __( 'Children: %s %s' , ST_TEXTDOMAIN ) , $child_html , $child_new_html );
                     } else {
                         $html .= sprintf( __( 'Children: %s' , ST_TEXTDOMAIN ) , $child_new_html );
                     }
     
                 }
     
                 $infant_new_html = '<span class="text-lg lh1em item ">' . TravelHelper::format_money( $prices[ 'infant_new' ] ) . '</span>';
     
     
                 // Price for child
                 if($prices[ 'infant_new' ]) {
                     $html .= ' ' . $st_mid . ' ';
     
                     // Check on sale
                     if(isset( $prices[ 'infant' ] ) and $prices[ 'infant' ] and $prices[ 'discount' ]) {
                         $infant_html = '<span class="text-small lh1em  onsale">' . TravelHelper::format_money( $prices[ 'infant' ] ) . '</span>&nbsp;&nbsp;';
     
                         $html .= sprintf( __( 'Infant: %s %s' , ST_TEXTDOMAIN ) , $infant_html , $infant_new_html );
                     } else {
                         $html .= sprintf( __( 'Infant: %s' , ST_TEXTDOMAIN ) , $infant_new_html );
                     }
     
                 }*/
     return apply_filters('st_get_tour_price_html', $html);
 }
        <?php 
}
?>

        <?php 
if (!empty($selected_equipments)) {
    ?>
            <p><strong><?php 
    _e("Equipments: ", ST_TEXTDOMAIN);
    ?>
</strong>
                <ul>
                <?php 
    foreach ($selected_equipments as $equipment) {
        $price_unit = '';
        if (isset($equipment->price_unit) and $equipment->price_unit) {
            $price_unit = ' (' . TravelHelper::format_money($equipment->price) . '/' . st_car_price_unit_title($equipment->price_unit) . ')';
        }
        // echo "<li>".$equipment->title.$price_unit." ->xx ".TravelHelper::format_money(STCars::get_equipment_line_item($equipment->price,$equipment->price_unit,$check_in_timestamp,$check_out_timestamp))."</li>";
        echo "<li>" . $equipment->title . $price_unit . "</li>";
    }
    ?>
                </ul>
            </p>

        <?php 
}
?>
    </td>
</tr>
if (get_option('woocommerce_tax_total_display') == 'itemized') {
    $wp_cart = WC()->cart->cart_contents;
    $item = $wp_cart[$st_booking_data['cart_item_key']];
    $tax = $item['line_tax'];
    if (!empty($tax)) {
        ?>
                <b class='booking-cart-item-title'><?php 
        echo __("Tax", ST_TEXTDOMAIN);
        ?>
: </b>
                <?php 
        echo TravelHelper::format_money($tax);
        ?>
            <?php 
    }
} else {
    $tax = 0;
}
?>
    </div>
    <div class='cart_border_bottom'></div>
    <div class="cart_item_group" style='margin-bottom: 10px'>        
        <b class='booking-cart-item-title'><?php 
echo __("Total amount", ST_TEXTDOMAIN);
?>
:</b>  
        <?php 
echo TravelHelper::format_money($st_booking_data['ori_price'] + $tax);
?>
    </div>   
</div>
示例#16
0
                        <?php 
st_the_language('car_equipment');
?>
                        <span class="st_data_car_equipment_total" data-value="0">
                          <?php 
echo TravelHelper::format_money(0);
?>
                        </span>
                    </p>
                </li>
                <li><p>
                        <?php 
st_the_language('car_rental_total');
?>
                        <span class="st_data_car_total"> <?php 
echo TravelHelper::format_money($data_price_tmp);
?>
                        </span>
                    </p>
                    <div class="spinner cars_price_img_loading ">
                    </div>
                </li>
            </ul>

            <?php 
if ($st_is_booking_modal) {
    ?>
                <a href="#car_booking_<?php 
    the_ID();
    ?>
" class="btn btn-primary btn_booking_modal" data-target=#car_booking_<?php 
示例#17
0
 public function _get_availability_hotel_room()
 {
     $list_date = array();
     $room_id = STInput::request('post_id', '');
     $check_in = STInput::request('start', '');
     $check_out = STInput::request('end', '');
     $hotel_id = intval(get_post_meta($room_id, 'room_parent', true));
     $allow_full_day = get_post_meta($hotel_id, 'allow_full_day', true);
     if (!$allow_full_day || $allow_full_day == '') {
         $allow_full_day = 'on';
     }
     $year = date('Y', $check_in);
     if (empty($year)) {
         $year = date('Y');
     }
     $year2 = date('Y', $check_out);
     if (empty($year2)) {
         $year2 = date('Y');
     }
     $month = date('m', $check_in);
     if (empty($month)) {
         $month = date('m');
     }
     $month2 = date('m', $check_out);
     if (empty($month2)) {
         $month2 = date('m');
     }
     $result = HotelHelper::_get_full_ordered($room_id, $month, $month2, $year, $year2);
     $number_room = get_post_meta($room_id, 'number_room', true);
     $min_max = HotelHelper::_get_min_max_date_ordered($room_id, $year, $year2);
     if (is_array($min_max) && count($min_max) && is_array($result) && count($result)) {
         $disable = array();
         for ($i = intval($min_max['min_date']); $i <= intval($min_max['max_date']); $i = strtotime('+1 day', $i)) {
             $num_room = 0;
             foreach ($result as $key => $date) {
                 if ($allow_full_day == 'on') {
                     if ($i >= intval($date['check_in_timestamp']) && $i <= intval($date['check_out_timestamp'])) {
                         $num_room += $date['number_room'];
                     }
                 } else {
                     if ($i > intval($date['check_in_timestamp']) && $i < intval($date['check_out_timestamp'])) {
                         $num_room += $date['number_room'];
                     }
                 }
             }
             $disable[$i] = $num_room;
         }
         if (count($disable)) {
             foreach ($disable as $key => $num_room) {
                 if (intval($num_room) >= $number_room) {
                     $list_date[] = date(TravelHelper::getDateFormat(), $key);
                 }
             }
         }
     }
     $list_date_2 = AvailabilityHelper::_getDisableCustomDate($room_id, $month, $month2, $year, $year2);
     $date1 = strtotime($year . '-' . $month . '-01');
     $date2 = strtotime($year2 . '-' . $month2 . '-01');
     $date2 = strtotime(date('Y-m-t', $date2));
     $today = strtotime(date('Y-m-d'));
     $return = array();
     $booking_period = intval(get_post_meta($hotel_id, 'hotel_booking_period', true));
     for ($i = $date1; $i <= $date2; $i = strtotime('+1 day', $i)) {
         $period = TravelHelper::dateDiff(date('Y-m-d', $today), date('Y-m-d', $i));
         $d = date(TravelHelper::getDateFormat(), $i);
         if (in_array($d, $list_date)) {
             $return[] = array('start' => date('Y-m-d', $i), 'date' => date('Y-m-d', $i), 'day' => date('d', $i), 'status' => 'booked');
         } else {
             if ($i < $today) {
                 $return[] = array('start' => date('Y-m-d', $i), 'date' => date('Y-m-d', $i), 'day' => date('d', $i), 'status' => 'past');
             } else {
                 if (in_array($d, $list_date_2)) {
                     $return[] = array('start' => date('Y-m-d', $i), 'date' => date('Y-m-d', $i), 'day' => date('d', $i), 'status' => 'disabled');
                 } else {
                     if ($period < $booking_period) {
                         $return[] = array('start' => date('Y-m-d', $i), 'date' => date('Y-m-d', $i), 'day' => date('d', $i), 'status' => 'disabled');
                     } else {
                         $return[] = array('start' => date('Y-m-d', $i), 'date' => date('Y-m-d', $i), 'day' => date('d', $i), 'status' => 'avalable', 'price' => TravelHelper::format_money(STPrice::getRoomPriceOnlyCustomPrice($room_id, $i, strtotime('+1 day', $i), 1)));
                     }
                 }
             }
         }
     }
     echo json_encode($return);
     die;
 }
示例#18
0
 static function get_price_html($post_id = false, $get = false, $st_mid = '', $class = '')
 {
     if (!$post_id) {
         $post_id = get_the_ID();
     }
     $html = '';
     $show_price_free = st()->get_option('show_price_free', 'on');
     $prices = self::get_price_person($post_id);
     $adult_html = '';
     $adult_new_html = '<span class="text-lg lh1em  ">' . TravelHelper::format_money($prices['adult_new']) . '</span>';
     // Check on sale
     if (isset($prices['adult']) and $prices['adult'] and $prices['discount']) {
         if ($show_price_free == 'on' or $adult_new_html) {
             $adult_html = '<span class="text-small lh1em  onsale">' . TravelHelper::format_money($prices['adult']) . '</span>&nbsp;&nbsp;';
             $html .= sprintf(__('Adult: %s %s', ST_TEXTDOMAIN), $adult_html, $adult_new_html);
         }
     } elseif (!empty($prices['adult_new'])) {
         if ($show_price_free == 'on' or $adult_new_html) {
             $html .= sprintf(__('Adult: %s', ST_TEXTDOMAIN), $adult_new_html);
         }
     }
     $child_new_html = '<span class="text-lg lh1em  ">' . TravelHelper::format_money($prices['child_new']) . '</span>';
     /*// Price for child
                     if($prices['child_new'])
                     {
                         $html.=' '.$st_mid.' ';
     
                         // Check on sale
                         if(isset($prices['child']) and $prices['child'] and $prices['discount'])
                         {
                             if($show_price_free=='on' or $child_new_html) {
     
                                 $child_html = '<span class="text-small lh1em  onsale">' . TravelHelper::format_money($prices['child']) . '</span>&nbsp;&nbsp;';
     
                                 $html .= sprintf(__('Children: %s %s', ST_TEXTDOMAIN), $child_html, $child_new_html);
                             }
                         }else{
                             if($show_price_free=='on' or $child_new_html) {
                                 $html.=sprintf(__('Children: %s',ST_TEXTDOMAIN),$child_new_html);
                             }
                         }
     
                     }
                     $infant_html = '';
                     $infant_new_html='<span class="text-lg lh1em  ">'.TravelHelper::format_money($prices['infant_new']).'</span>';
                     // Price for infant
                     
                     if($prices['infant_new'])
                     {
                         $html.=' '.$st_mid.' ';
     
                         // Check on sale
                         if(isset($prices['infant']) and $prices['infant'] and $prices['discount'])
                         {
                             if($show_price_free=='on' or $infant_new_html) {
     
                                 $infant_html = '<span class="text-small lh1em  onsale">' . TravelHelper::format_money($prices['infant']) . '</span>&nbsp;&nbsp;';
     
                                 $html .= sprintf(__('Infant: %s %s', ST_TEXTDOMAIN), $infant_html, $infant_new_html);
                             }
                         }else{
                             if($show_price_free=='on' or $infant_new_html) {
                                 $html.=sprintf(__('Infant: %s',ST_TEXTDOMAIN),$infant_new_html);
                             }
                         }
     
                     }*/
     return apply_filters('st_get_holiday_price_html', $html);
 }
 /**
  *
  *
  * @since 1.1.1
  * */
 function _change_default_price($return, $price, $arg = array())
 {
     return TravelHelper::format_money($price);
 }
示例#20
0
 static function get_price_html($post_id = false, $get = false, $st_mid = '', $class = '')
 {
     /*
      * since 1.1.3
      * filter hook get_price_html
      */
     if (!$post_id) {
         $post_id = get_the_ID();
     }
     $html = '';
     $type_price = get_post_meta($post_id, 'type_price', true);
     if ($type_price == 'people_price') {
         $prices = self::get_price_person($post_id);
         $adult_html = '';
         $adult_new_html = '<span class="text-lg lh1em item ">' . TravelHelper::format_money($prices['adult_new']) . '</span>';
         // Check on sale
         if (isset($prices['adult']) and $prices['adult'] and $prices['discount']) {
             $adult_html = '<span class="text-small lh1em  onsale">' . TravelHelper::format_money($prices['adult']) . '</span>&nbsp;&nbsp;<i class="fa fa-long-arrow-right"></i>';
             $html .= sprintf(__('Adult: %s %s', ST_TEXTDOMAIN), $adult_html, $adult_new_html);
         } else {
             $html .= sprintf(__('Adult: %s', ST_TEXTDOMAIN), $adult_new_html);
         }
         $child_new_html = '<span class="text-lg lh1em item ">' . TravelHelper::format_money($prices['child_new']) . '</span>';
         // Price for child
         if ($prices['child_new']) {
             $html .= ' ' . $st_mid . ' ';
             // Check on sale
             if (isset($prices['child']) and $prices['child'] and $prices['discount']) {
                 $child_html = '<span class="text-small lh1em  onsale">' . TravelHelper::format_money($prices['child']) . '</span>&nbsp;&nbsp;<i class="fa fa-long-arrow-right"></i>';
                 $html .= sprintf(__('Children: %s %s', ST_TEXTDOMAIN), $child_html, $child_new_html);
             } else {
                 $html .= sprintf(__('Children: %s', ST_TEXTDOMAIN), $child_new_html);
             }
         }
     } else {
         $prices = self::get_info_price($post_id);
         if (isset($prices['price_old']) and $prices['price_old'] and $prices['discount']) {
             $html .= '<span class="text-small lh1em  onsale">' . TravelHelper::format_money($prices['price_old']) . '</span>&nbsp;&nbsp;<i class="fa fa-long-arrow-right"></i>';
             $html .= '<span class="text-lg lh1em  ' . $class . '">' . TravelHelper::format_money($prices['price']) . '</span>';
         } else {
             $html .= '<span class="text-lg lh1em  ' . $class . '">' . TravelHelper::format_money($prices['price']) . '</span>';
         }
     }
     return apply_filters('st_get_tour_price_html', $html);
 }
 function add_col_content($column_name, $post_ID)
 {
     if ($column_name == 'activity_date') {
         $check_in = get_post_meta($post_ID, 'check_in', true);
         $check_out = get_post_meta($post_ID, 'check_out', true);
         $date = mysql2date('d/m/Y', $check_in) . ' <i class="fa fa-long-arrow-right"></i> ' . mysql2date('d/m/Y', $check_out);
         if (!empty($check_in) and !empty($check_out)) {
             echo balanceTags($date);
         } else {
             _e('none', ST_TEXTDOMAIN);
         }
     }
     if ($column_name == 'duration') {
         $parent = get_post_meta($post_ID, 'duration', true);
         if ($parent) {
             echo esc_html($parent);
         }
     }
     if ($column_name == 'price') {
         $price = get_post_meta($post_ID, 'price', true);
         $type_price = get_post_meta($post_ID, 'type_price', true);
         if ($type_price != 'people_price') {
             echo '<strong>' . TravelHelper::format_money($price) . '</strong>';
         } else {
             $adult_price = get_post_meta($post_ID, 'adult_price', true);
             $child_price = get_post_meta($post_ID, 'child_price', true);
             echo '<span>' . __('Adult Price', ST_TEXTDOMAIN) . ' : ' . TravelHelper::format_money($adult_price) . '</span><br>';
             echo '<span>' . __('Child Price', ST_TEXTDOMAIN) . ' : ' . TravelHelper::format_money($child_price) . '</span><br>';
         }
     }
     if ($column_name == 'activity_time') {
         $time = get_post_meta($post_ID, 'activity-time', true);
         if ($time) {
             echo esc_html($time);
         }
     }
 }
                echo st_get_language('hotels');
            }
            if ($key == "st_activity") {
                echo st_get_language('activities');
            }
            if ($key == "st_rental") {
                echo st_get_language('rentals');
            }
            ?>
 </a>
						<?php 
            echo __("from", ST_TEXTDOMAIN);
            ?>
 <a href="<?php 
            echo get_permalink($value['item_has_min']);
            ?>
">
						<?php 
            echo TravelHelper::format_money($value['from']);
            ?>
 
						</a>
						<br>
					</li>
				<?php 
        }
    }
}
?>
	</ul>
示例#23
0
 static function getRentalInfo()
 {
     $rental_id = intval(STInput::request('rental_id', ''));
     $data = array('price' => '', 'extras' => 'None', 'adult_html' => '', 'child_html' => '');
     if ($rental_id <= 0 || get_post_type($rental_id) != 'st_rental') {
         echo json_encode($data);
     } else {
         $adult_number = intval(get_post_meta($rental_id, 'rental_max_adult', true));
         if ($adult_number <= 0) {
             $adult_number = 1;
         }
         $adult_html = '<select name="adult_number" class="form-control" style="width: 100px;">';
         for ($i = 1; $i <= $adult_number; $i++) {
             $adult_html .= '<option value="' . $i . '">' . $i . '</option>';
         }
         $adult_html .= '</select>';
         $child_number = intval(get_post_meta($rental_id, 'rental_max_children', true));
         if ($child_number <= 0) {
             $child_number = 0;
         }
         $child_html = '<select name="child_number" class="form-control" style="width: 100px;">';
         for ($i = 0; $i <= $child_number; $i++) {
             $child_html .= '<option value="' . $i . '">' . $i . '</option>';
         }
         $child_html .= '</select>';
         $html = '';
         $price = floatval(get_post_meta($rental_id, 'price', true));
         $extras = get_post_meta($rental_id, 'extra_price', true);
         if (is_array($extras) && count($extras)) {
             $html = '<table class="table">';
             foreach ($extras as $key => $val) {
                 $html .= '
             <tr>
                 <td width="80%">
                     <label for="' . $val['extra_name'] . '" class="ml20">' . $val['title'] . ' (' . TravelHelper::format_money($val['extra_price']) . ')' . '</label>
                     <input type="hidden" name="extra_price[price][' . $val['extra_name'] . ']" value="' . $val['extra_price'] . '">
                     <input type="hidden" name="extra_price[title][' . $val['extra_name'] . ']" value="' . $val['title'] . '">
                 </td>
                 <td width="20%">
                     <select style="width: 100px" class="form-control" name="extra_price[value][' . $val['extra_name'] . ']" id="">';
                 $max_item = intval($val['extra_max_number']);
                 if ($max_item <= 0) {
                     $max_item = 1;
                 }
                 for ($i = 0; $i <= $max_item; $i++) {
                     $html .= '<option value="' . $i . '">' . $i . '</option>';
                 }
                 $html .= '
                     </select>
                 </td>
             </tr>';
             }
             $html .= '</table>';
         }
         $data['price'] = TravelHelper::format_money_from_db($price, false);
         $data['extras'] = $html;
         $data['adult_html'] = $adult_html;
         $data['child_html'] = $child_html;
         echo json_encode($data);
     }
     die;
 }
示例#24
0
        ?>
        <?php 
    }
    ?>
</p></li>
    <?php 
}
?>
    <?php 
if (isset($item_data['_line_tax'])) {
    $data = st_wc_parse_order_item_meta($item_data['_line_tax']);
    ?>
            <?php 
    if (!empty($data)) {
        ?>
<li><p>
            <?php 
        echo __("Tax", ST_TEXTDOMAIN) . ": ";
        ?>
            <?php 
        echo TravelHelper::format_money($data);
        ?>
        <?php 
    }
    ?>
</p></li>
    <?php 
}
?>
    
</ul>
    ?>
                        </td>
                    </tr>
                    <?php 
}
?>
                    <tr>
                        <td  style="border-bottom: 1px dashed #ccc;padding:10px;">
                            <strong><?php 
echo __('Pay Amount :', ST_TEXTDOMAIN);
?>
</strong>
                        </td>
                        <td style="border-bottom: 1px dashed #ccc;padding:10px;">
                            <?php 
echo TravelHelper::format_money($total_price);
?>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>

    </tfoot>


            </table>
            <?php 
echo st()->load_template('email/booking_customer_infomation', null, array('order_id' => $order_id));
?>
        </td>
示例#26
0
                }
            }
        }
    }
}
?>
            </ul>
            <div>
                <?php 
if (!empty($count_sale)) {
    ?>
                    <span class="text-small lh1em  onsale">
                                    <?php 
    echo TravelHelper::format_money($price_sale);
    ?>
                                </span>
                    <i class="fa fa-long-arrow-right"></i>
                <?php 
}
?>
                <?php 
if (!empty($price)) {
    echo '<span class="text-darken mb0 text-color">' . TravelHelper::format_money($price) . '<small> /' . strtolower(STCars::get_price_unit('label')) . '</small></span>';
}
?>
            </div>
        </div>
    </div>
    <div class="gap"></div>
</div>
示例#27
0
 function st_get_discount_value($number, $percent = 0, $format_money = true)
 {
     if ($percent > 100) {
         $percent = 100;
     }
     $rs = $number - $number / 100 * $percent;
     if ($format_money) {
         return TravelHelper::format_money($rs);
     }
     return $rs;
 }
示例#28
0
            $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_tours&location_id=' . get_the_ID()));
        }
        if ($offer < 2) {
            $offer = $offer . " " . __("Tour from", ST_TEXTDOMAIN);
        } else {
            $offer = $offer . " " . __("Tours from", ST_TEXTDOMAIN);
        }
        echo '<li><a href="' . $link . '"><i class="fa fa-bolt"></i> ' . $offer . ' ' . $min_price . '</a></li>';
    }
}
$activity = new STActivity();
if ($activity->is_available()) {
    $min_price = get_post_meta(get_the_ID(), 'min_price_st_activity', true);
    $min_price = TravelHelper::format_money($min_price);
    $offer = get_post_meta(get_the_ID(), 'offer_st_activity', true);
    if (!empty($offer)) {
        $page_search = st_get_page_search_result('st_activity');
        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_activity&location_id=' . get_the_ID()));
        }
        if ($offer < 2) {
            $offer = $offer . " " . __("Activity this Week", ST_TEXTDOMAIN);
        } else {
            $offer = $offer . " " . __("Activities this Week", ST_TEXTDOMAIN);
        }
        echo '<li><a href="' . $link . '"><i class="fa fa-bolt"></i> ' . $offer . '</a></li>';
    }
示例#29
0
    ?>
            <?php 
}
?>

            <p class="mb0 text-darken item_price_map">
                <?php 
if ($is_sale) {
    echo "<span class='booking-item-old-price'>" . TravelHelper::format_money($orgin_price) . "</span>";
}
?>
                <?php 
if ($show_price == 'on' || $price) {
    ?>
                    <span class="text-lg lh1em text-color"><?php 
    echo TravelHelper::format_money($price);
    ?>
</span><small> /<?php 
    st_the_language('rental_night');
    ?>
</small>
                <?php 
}
?>
            </p>
            <a class="btn btn-primary btn_book" href="<?php 
echo esc_url($link);
?>
"><?php 
_e("Book Now", ST_TEXTDOMAIN);
?>
示例#30
0
                                    <label class="form-label" for=""><?php 
_e('Price', ST_TEXTDOMAIN);
?>
</label>
                                    <div class="controls">
                                    <?php 
$item_price = floatval(get_post_meta($item_id, 'item_price', true));
if ($section == 'edit_order_item') {
    ?>
                                        <input readonly class="form-control form-control-admin" type="text" name="item_price" id="item_price" value="<?php 
    echo TravelHelper::format_money_from_db($item_price, $currency, $rate);
    ?>
">
                                    <?php 
} else {
    $item_price = isset($_POST['item_price']) ? $_POST['item_price'] : TravelHelper::format_money(0);
    ?>
                                        <input id="item_price" readonly type="text" name="item_price" value="<?php 
    echo $item_price;
    ?>
" class="form-control form-control-admin">
                                        <span class="spinner item_price"></span>
                                    <?php 
}
?>
   
                                    </div>
                                </div>
                                <div class="form-row">
                                    <label class="form-label" for=""><?php 
_e('No. Adults', ST_TEXTDOMAIN);