Skip to content

Commit

Permalink
Merge pull request #130 from Themefic-Team/fixing/qr-code-api
Browse files Browse the repository at this point in the history
= 2.11.26 - 08 May 2024 =
  • Loading branch information
Ashik384 authored May 8, 2024
2 parents f3d673c + c897d05 commit 6075c9c
Show file tree
Hide file tree
Showing 26 changed files with 230 additions and 170 deletions.
6 changes: 5 additions & 1 deletion assets/app/css/tourfic-style.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion assets/app/css/tourfic-style.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/app/css/tourfic-style.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/app/css/tourfic-style.min.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/app/js/tourfic-scripts.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/app/js/tourfic-scripts.min.js

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions inc/booking-details/booking_details.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,22 @@ function tf_checkinout_details_edit_function() {

global $wpdb;
$tf_order = $wpdb->get_row( $wpdb->prepare( "SELECT id FROM {$wpdb->prefix}tf_order_data WHERE id = %s",sanitize_key( $tf_order_id ) ) );
$tf_woo_order_id = $wpdb->get_row( $wpdb->prepare( "SELECT order_id FROM {$wpdb->prefix}tf_order_data WHERE id = %s",sanitize_key( $tf_order_id ) ) );

$tf_order_uni_id = !empty($tf_woo_order_id) ? get_option("tf_order_uni_" . $tf_woo_order_id->order_id) : "";

// Checkinout Status Update into Database
if(!empty($tf_order)){
$wpdb->query(
$wpdb->prepare("UPDATE {$wpdb->prefix}tf_order_data SET checkinout=%s, checkinout_by=%s WHERE id=%s", sanitize_title( $tf_checkinout ), wp_json_encode( $ft_checkinout_by ), sanitize_key($tf_order_id))
);
if(!empty( $tf_order_uni_id )){
if($tf_checkinout == "in") {
update_option("tf_" . $tf_order_uni_id, "in");
} else {
update_option("tf_" . $tf_order_uni_id, "");
}
}
}
die();
}
Expand Down
4 changes: 2 additions & 2 deletions inc/booking-details/tour/single-booking-details.php
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ function tf_get_payment_method_full_name( $sort_name ) {
<?php } ?>
<h5><?php esc_html_e("Address:", "tourfic"); ?> <b style="color: #002043;"><?php echo esc_html( $location ) ?></b></h5>
</div>
<img style="border: 1px solid #ccc;" src="//chart.apis.google.com/chart?cht=qr&chs=<?php echo esc_attr($width);?>x<?php echo esc_attr($height); ?>&chl=<?php echo esc_url($uri); ?>&choe=UTF-8" alt="<?php echo esc_attr( $title ); ?>"/>
<img style="border: 1px solid #ccc;" src="//quickchart.io/qr?size=<?php echo esc_attr($width);?>&format=png&text=<?php echo (string) esc_html($uri); ?>" alt="<?php echo esc_attr( $title ); ?>"/>
</div>
<div class="tf-voucher-billing-info">
<div class="tf-billing-details">
Expand Down Expand Up @@ -750,7 +750,7 @@ function tf_get_payment_method_full_name( $sort_name ) {
<?php } ?>
<h5><?php esc_html_e("Address:", "tourfic"); ?> <b style="color: #002043;"><?php echo esc_html( $location ) ?></b></h5>
</div>
<img style="border: 1px solid #ccc;" src="//chart.apis.google.com/chart?cht=qr&chs=<?php echo esc_attr( $width ); ?>x<?php echo esc_attr( $height ); ?>&chl=<?php echo esc_url( htmlspecialchars( $uri ) ); ?>&choe=UTF-8" alt="<?php echo esc_attr( htmlspecialchars( $title ) ); ?>"/>
<img style="border: 1px solid #ccc;" src="//quickchart.io/qr?size=<?php echo esc_attr($width);?>&format=png&text=<?php echo (string) esc_html( $uri ); ?>" alt="<?php echo esc_attr( htmlspecialchars( $title ) ); ?>"/>
</div>
<div class="tf-voucher-billing-info">
<div class="tf-billing-details">
Expand Down
2 changes: 2 additions & 0 deletions inc/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -3378,6 +3378,8 @@ function tf_custom_wp_kses_allow_tags() {
'name' => true,
'class' => true,
'id' => true,
'data-*' => true,
'multiple' => true
);

$allowed_tags['option'] = array(
Expand Down
4 changes: 2 additions & 2 deletions inc/functions/functions-hotel.php
Original file line number Diff line number Diff line change
Expand Up @@ -2011,12 +2011,12 @@ function dateSetToFields(selectedDates, instance) {
if(selectedDates[0]){
const startDate = selectedDates[0];
$(".tf-template-3 .tf-booking-form-checkin span.tf-booking-date").html(startDate.getDate());
$(".tf-template-3 .tf-booking-form-checkin span.tf-booking-month span").html(monthNames[startDate.getMonth()+1]);
$(".tf-template-3 .tf-booking-form-checkin span.tf-booking-month span").html(monthNames[startDate.getMonth()]);
}
if(selectedDates[1]){
const endDate = selectedDates[1];
$(".tf-template-3 .tf-booking-form-checkout span.tf-booking-date").html(endDate.getDate());
$(".tf-template-3 .tf-booking-form-checkout span.tf-booking-month span").html(monthNames[endDate.getMonth()+1]);
$(".tf-template-3 .tf-booking-form-checkout span.tf-booking-month span").html(monthNames[endDate.getMonth()]);
}
}
}
Expand Down
10 changes: 7 additions & 3 deletions inc/functions/functions-tour.php
Original file line number Diff line number Diff line change
Expand Up @@ -1971,7 +1971,7 @@ function tf_booking_popup( $post_id ) {
<span class="tf-booking-form-title"><?php esc_html_e("Guests", "tourfic"); ?></span>
<div class="tf-booking-guest-and-room-wrap">
<span class="tf-guest tf-booking-date">
<?php esc_html_e("01", "tourfic"); ?>
<?php esc_html_e("00", "tourfic"); ?>
</span>
<span class="tf-booking-month">
<span><?php esc_html_e("Guest", "tourfic"); ?></span>
Expand Down Expand Up @@ -2287,6 +2287,7 @@ function tf_tour_archive_single_item( $adults = '', $child = '', $check_in_out =

// Informations
$tour_duration = ! empty( $meta['duration'] ) ? $meta['duration'] : '';
$tour_duration_time = ! empty( $meta['duration_time'] ) ? $meta['duration_time'] : '';
$group_size = ! empty( $meta['group_size'] ) ? $meta['group_size'] : '';
$features = ! empty( $meta['features'] ) ? $meta['features'] : '';

Expand Down Expand Up @@ -2739,8 +2740,11 @@ function tf_tour_archive_single_item( $adults = '', $child = '', $check_in_out =
<i class="ri-team-line"></i> <?php esc_html_e("Max", "tourfic"); ?> <?php echo esc_html($group_size); ?> <?php esc_html_e("people", "tourfic"); ?>
</li>
<?php } if(!empty($tour_duration)){ ?>
<?php
$tour_duration_time = $tour_duration > 1 ? $tour_duration_time . 's' : $tour_duration_time;
?>
<li>
<i class="ri-history-fill"></i> <?php echo esc_html($tour_duration); ?> <?php esc_html_e("days", "tourfic"); ?>
<i class="ri-history-fill"></i> <?php echo esc_html($tour_duration); ?> <?php esc_html_e($tour_duration_time, "tourfic"); ?>
</li>
<?php } ?>
<?php
Expand All @@ -2762,7 +2766,7 @@ function tf_tour_archive_single_item( $adults = '', $child = '', $check_in_out =
<li>
<?php
if ( ! empty( $feature_icon ) ) {
echo esc_attr($feature_icon);
echo wp_kses($feature_icon, array('i' => array('class' => true),));
} ?>
<?php echo !empty($features_details->name) ? esc_html($features_details->name) : ''; ?>
</li>
Expand Down
16 changes: 16 additions & 0 deletions inc/functions/woocommerce/wc-hotel.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,14 @@ function tf_hotel_booking_callback() {
$adult_price = floatval( preg_replace( '/[^\d.]/', '', number_format( (int) $adult_price - ( ( (int) $adult_price / 100 ) * (int) $hotel_discount_amount ), 2 ) ) );
$child_price = floatval( preg_replace( '/[^\d.]/', '', number_format( (int) $child_price - ( ( (int) $child_price / 100 ) * (int) $hotel_discount_amount ), 2 ) ) );
}
} elseif( $hotel_discount_type == "fixed" ) {
if($pricing_by == 1) {
$room_price = (int) $room_price - (int) $hotel_discount_amount;
}
if($pricing_by == 2) {
$adult_price = (int) $adult_price - (int) $hotel_discount_amount;
$child_price = (int) $child_price - (int) $hotel_discount_amount;
}
}

/**
Expand Down Expand Up @@ -223,6 +231,14 @@ function tf_hotel_booking_callback() {
$adult_price = floatval( preg_replace( '/[^\d.]/', '', number_format( (int) $adult_price - ( ( (int) $adult_price / 100 ) * (int) $hotel_discount_amount ), 2 ) ) );
$child_price = floatval( preg_replace( '/[^\d.]/', '', number_format( (int) $child_price - ( ( (int) $child_price / 100 ) * (int) $hotel_discount_amount ), 2 ) ) );
}
} elseif( $hotel_discount_type == "fixed" ) {
if($pricing_by == 1) {
$room_price = (int) $room_price - (int) $hotel_discount_amount;
}
if($pricing_by == 2) {
$adult_price = (int) $adult_price - (int) $hotel_discount_amount;
$child_price = (int) $child_price - (int) $hotel_discount_amount;
}
}

$total_price += $pricing_by == '1' ? $room_price : ( ( $adult_price * $adult ) + ( $child_price * $child ) );
Expand Down
22 changes: 11 additions & 11 deletions inc/functions/woocommerce/wc-product-extend.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,23 @@ class TF_Product_Data_Store_CPT extends WC_Product_Data_Store_CPT implements WC_
public function read( &$product ) {
$product->set_defaults();

if ( (! $product->get_id() || ! ( $post_object = get_post( $product->get_id() ) ) || 'product' !== $post_object->post_type) && 'tf_tours' !== $post_object->post_type && 'tf_hotel' !== $post_object->post_type && 'tf_apartment' !== $post_object->post_type ) {
if ( (! $product->get_id() || ! ( $post_object = get_post( $product->get_id() ) ) || 'product' !== $post_object->post_type) && !empty($post_object) && 'tf_tours' !== $post_object->post_type && 'tf_hotel' !== $post_object->post_type && 'tf_apartment' !== $post_object->post_type ) {
throw new Exception( esc_html__( 'Invalid product.', 'tourfic' ) );
}

$id = $product->get_id();

$product->set_props( array(
'name' => $post_object->post_title,
'slug' => $post_object->post_name,
'date_created' => 0 < $post_object->post_date_gmt ? wc_string_to_timestamp( $post_object->post_date_gmt ) : null,
'date_modified' => 0 < $post_object->post_modified_gmt ? wc_string_to_timestamp( $post_object->post_modified_gmt ) : null,
'status' => $post_object->post_status,
'description' => $post_object->post_content,
'short_description' => $post_object->post_excerpt,
'parent_id' => $post_object->post_parent,
'menu_order' => $post_object->menu_order,
'reviews_allowed' => 'open' === $post_object->comment_status,
'name' => !empty($post_object->post_title) ? $post_object->post_title : '',
'slug' => !empty($post_object->post_name) ? $post_object->post_name : '',
'date_created' => !empty($post_object->post_date_gmt) && 0 < $post_object->post_date_gmt ? wc_string_to_timestamp( $post_object->post_date_gmt ) : null,
'date_modified' => !empty( $post_object->post_modified_gmt) && 0 < $post_object->post_modified_gmt ? wc_string_to_timestamp( $post_object->post_modified_gmt ) : null,
'status' => !empty($post_object->post_status) ? $post_object->post_status : '',
'description' => !empty($post_object->post_content) ? $post_object->post_content : '',
'short_description' => !empty($post_object->post_excerpt) ? $post_object->post_excerpt : '',
'parent_id' => !empty($post_object->post_parent) ? $post_object->post_parent : '',
'menu_order' => !empty($post_object->menu_order) ? $post_object->menu_order : '',
'reviews_allowed' => !empty($post_object->comment_status) && 'open' === $post_object->comment_status,
) );

$this->read_attributes( $product );
Expand Down
44 changes: 16 additions & 28 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors: themefic, kamrul0424, jahidcse, mehedi890, mdashikul, mainulsunvi,
Tags: travel-booking, hotel-booking, tour-booking, room-booking, woocommerce-accommodation-booking
Requires at least: 5.4
Tested up to: 6.5
Stable tag: 2.11.25
Stable tag: 2.11.26
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Expand Down Expand Up @@ -322,6 +322,21 @@ We provide full support on the WordPress.org forums. In addition, please feel fr

== Changelog ==

= 2.11.26 - 08 May 2024 =

- Fixed: Tour archive page duration issue
- Fixed: Tour bottom booking bar guest sync issue
- Fixed: Tour booking popup not showing template 3
- Fixed: Hotel single-page date picker issue
- Fixed: Hotel room price fixed discount issue
- Fixed: Specific location shortcode issue
- Fixed: PHP Warning issues
- Improved: Hotel partial payment price always showing (pro)
- Improved: Voucher QR code image issue (API changed) (pro)
- Improved: Tour extra quantity issue (pro)
- Improved: Scan QR code and Update Booking Status (Pro)
- Improved: QR Code Tracking (Pro)

= 2.11.25 - 28 April 2024 =

- Improvement: System stability improved
Expand Down Expand Up @@ -503,33 +518,6 @@ We provide full support on the WordPress.org forums. In addition, please feel fr
- Improved: Booking.com, Travelpayouts full-screen popup add( Pro )
- Improved: Install and Active WooCommerce using Single Button

= 2.10.13 - 15 December 2023 =

- Improved: Itinerary builder settings
- Added: Itinerary PDF color settings
- Fixed: Itinerary Paragraph tag support

= 2.10.12 - 10 December 2023 =

- Updated: Extended Notice( Black Friday )
- Improvement: System stability Improved

= 2.10.11 - 09 December 2023 =

- Added: External booking added for Apartment(Pro)
- Added: External listing shortcode added(Pro)
- Added: Affiliate Addon release(Pro)
- Fixed: Tour Availability issue fixed
- Fixed: Location Require Error Message (Tour/Hotel/Apartment)
- Fixed: Image replace issue on frontend dashboard On Apartment(Pro)
- Fixed: External booking minor issues fixed for hotels(Pro)
- Fixed: Import Export Issue
- Improved: WooCommerce Currency Compatibility
- Improved: Compatibility Issue with ACF
- Improved: Pricing Accuracy for Tour/Hotel/Apartment
- Improved: Per Itinerary Language to Location(Pro)
- Improved: Booking.com, Travelpayouts full-screen popup add(Pro)

**Old Changelog can be found [here](https://themefic.com/tourfic/changelog/)**.

= 1.0.0 - 23/03/2021 =
Expand Down
4 changes: 4 additions & 0 deletions sass/app/css/free/hotel/_hotel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,10 @@ ul.tf-room-checkbox label{
border-right: 1px solid #c8e2fc;
}

.tf-hotel-deposit-hide {
display: none;
}

.tf-room-table .availability-table tbody tr:nth-child(odd) td {
background: #fff;
}
Expand Down
2 changes: 1 addition & 1 deletion sass/app/css/free/hotel/template2/modules/_responsive.scss
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@
.tf_tours_booking > .tf-field-group,
.tf_tours_booking > .check-in-time-div,
.tf-tour-booking-box,
.tf_tours_booking > .tf-tours-booking-btn,
.tf_tours_booking > .tf-tours-booking-btn .tf-btn,
.tf-bottom-booking-bar{
display: none !important;
}
Expand Down
7 changes: 6 additions & 1 deletion sass/app/css/pro/tour/tour.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
margin-bottom: 20px;
}
.tf-qr-code-preview{
display: none;
position: relative;
box-shadow: 0px 13px 30px 0px #e0e8ee;
padding: 10px;
Expand Down Expand Up @@ -187,4 +186,10 @@
min-width: 100% !important;
width: 100% !important;
}

.tf-scanner-section .tf-qr-code-preview #tf-video-preview {
max-width: 100%;
height: 400px;
object-fit: cover;
}
}
21 changes: 14 additions & 7 deletions sass/app/js/free/tour.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,24 @@
var tour_extra_total = [];
var tour_extra_quantity = [];

jQuery('.tour-extra-single input:checkbox:checked').each(function () {
tour_extra_total.push(jQuery(this).val());
jQuery('.tour-extra-single').each(function (e) {
let $this = jQuery(this);

if ($this.find('.tf_quantity-acrselection').hasClass('quantity-active')) {
let qty = $this.find('input[name="extra-quantity"]').val();
if ($this.find('input[name="tf-tour-extra"]').is(':checked')) {

tour_extra_quantity.push(qty)
} else {
tour_extra_quantity.push(1)
let tour_extras = $this.find('input[name="tf-tour-extra"]').val();
tour_extra_total.push(tour_extras);

if ($this.find('.tf_quantity-acrselection').hasClass('quantity-active')) {
let qty = $this.find('input[name="extra-quantity"]').val();

tour_extra_quantity.push(qty)
} else {
tour_extra_quantity.push(1)
}
}
});

formData.append('tour_extra', tour_extra_total);
formData.append('tour_extra_quantity', tour_extra_quantity);

Expand Down
4 changes: 2 additions & 2 deletions sass/app/js/free/tourfic.js
Original file line number Diff line number Diff line change
Expand Up @@ -2017,9 +2017,9 @@
$('.tf-template-3 .acr-inc , .tf-template-3 .acr-dec').on('click', function() {

if ($('input#infant').length){
var guest = Number($('input#adults').val()) + Number($('input#children').val()) + Number($('input#infant').val()) ;
var guest = Number( $('input#adults').val() ? $('input#adults').val() : 0 ) + Number( $('input#children').val() ? $('input#children').val() : 0 ) + Number( $('input#infant').val() ? $('input#infant').val() : 0 ) ;
}else{
var guest = Number($('input#adults').val()) + Number($('input#children').val());
var guest = Number( $('input#adults').val() ? $('input#adults').val() : 0 ) + Number( $('input#children').val() ? $('input#children').val() : 0 );
}
if (guest.toString().length < 2) {
guest = '0' + guest;
Expand Down
Loading

0 comments on commit 6075c9c

Please sign in to comment.