Changeset 3493788
- Timestamp:
- 03/29/2026 11:08:20 AM (3 days ago)
- Location:
- tourfic/trunk
- Files:
-
- 1 added
- 7 edited
-
inc/Admin/Backend_Booking/TF_Apartment_Backend_Booking.php (modified) (1 diff)
-
inc/Admin/Backend_Booking/TF_Hotel_Backend_Booking.php (modified) (1 diff)
-
inc/Admin/Backend_Booking/TF_Tour_Backend_Booking.php (modified) (1 diff)
-
inc/Admin/Emails/TF_Handle_Emails.php (modified) (3 diffs)
-
inc/Classes/Room/Availability.php (added)
-
inc/functions/woocommerce/wc-hotel.php (modified) (5 diffs)
-
readme.txt (modified) (2 diffs)
-
tourfic.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tourfic/trunk/inc/Admin/Backend_Booking/TF_Apartment_Backend_Booking.php
r3354901 r3493788 459 459 460 460 $order_id = Helper::tf_set_order( $order_data ); 461 if ( function_exists( 'is_tf_pro' ) && is_tf_pro() && ! empty( $order_id ) ) { 462 do_action( 'tf_offline_payment_booking_confirmation', $order_id, $order_data ); 463 } 461 464 462 465 if ( ! empty( Helper::tf_data_types( Helper::tfopt( 'tf-integration' ) )['tf-new-order-google-calendar'] ) && Helper::tf_data_types( Helper::tfopt( 'tf-integration' ) )['tf-new-order-google-calendar'] == "1" ) { -
tourfic/trunk/inc/Admin/Backend_Booking/TF_Hotel_Backend_Booking.php
r3354901 r3493788 548 548 549 549 $order_id = Helper::tf_set_order( $order_data ); 550 if ( function_exists( 'is_tf_pro' ) && is_tf_pro() && ! empty( $order_id ) ) { 551 do_action( 'tf_offline_payment_booking_confirmation', $order_id, $order_data ); 552 } 550 553 551 554 $rooms = Room::get_hotel_rooms( intval( $field['tf_available_hotels'] ) ); -
tourfic/trunk/inc/Admin/Backend_Booking/TF_Tour_Backend_Booking.php
r3485880 r3493788 361 361 if ( ! array_key_exists( 'errors', $res['response'] ) || count( $res['response']['errors'] ) == 0 ) { 362 362 $order_id = Helper::tf_set_order( $order_data ); 363 if ( function_exists( 'is_tf_pro' ) && is_tf_pro() && ! empty( $order_id ) ) { 364 do_action( 'tf_offline_payment_booking_confirmation', $order_id, $order_data ); 365 } 363 366 364 367 if ( ! empty( Helper::tf_data_types( Helper::tfopt( 'tf-integration' ) )['tf-new-order-google-calendar'] ) && Helper::tf_data_types( Helper::tfopt( 'tf-integration' ) )['tf-new-order-google-calendar'] == "1" ) { -
tourfic/trunk/inc/Admin/Emails/TF_Handle_Emails.php
r3417632 r3493788 311 311 $order_billing_state = !empty($order_data['billing_details']['billing_state']) ? $order_data['billing_details']['billing_state'] : ''; 312 312 $payment_method_title = $order_data['payment_method']; 313 $order_status = $order_data['status'];313 $order_status = ! empty( $order_data['status'] ) ? $order_data['status'] : ( ! empty( $order_data['ostatus'] ) ? $order_data['ostatus'] : '' ); 314 314 $order_date_created = $order_data['order_date']; 315 315 … … 318 318 $tf_order_details = $wpdb->get_row( $wpdb->prepare( "SELECT id FROM {$wpdb->prefix}tf_order_data WHERE order_id = %s",sanitize_key( $order_id ) ) ); 319 319 320 if('tour'==$order_data['post_type']){ 321 $order_url = esc_url(admin_url() . 'edit.php?post_type=tf_tours&page=tf_tours_booking&order_id=' . $order_id . '&book_id=' . $tf_order_details->id . '&action=preview'); 322 }elseif('car'==$order_data['post_type']){ 323 $order_url = esc_url(admin_url() . 'edit.php?post_type=tf_carrental&page=tf_carrental_booking&order_id=' . $order_id . '&book_id=' . $tf_order_details->id . '&action=preview'); 324 }elseif('hotel'==$order_data['post_type']){ 325 $order_url = esc_url(admin_url() . 'edit.php?post_type=tf_hotel&page=tf_hotel_booking&order_id=' . $order_id . '&book_id=' . $tf_order_details->id . '&action=preview'); 326 }else{ 327 $order_url = '#'; 328 } 320 if('tour'==$order_data['post_type']){ 321 $order_url = esc_url(admin_url() . 'edit.php?post_type=tf_tours&page=tf_tours_booking&order_id=' . $order_id . '&book_id=' . $tf_order_details->id . '&action=preview'); 322 }elseif('car'==$order_data['post_type']){ 323 $order_url = esc_url(admin_url() . 'edit.php?post_type=tf_carrental&page=tf_carrental_booking&order_id=' . $order_id . '&book_id=' . $tf_order_details->id . '&action=preview'); 324 }elseif('hotel'==$order_data['post_type']){ 325 $order_url = esc_url(admin_url() . 'edit.php?post_type=tf_hotel&page=tf_hotel_booking&order_id=' . $order_id . '&book_id=' . $tf_order_details->id . '&action=preview'); 326 }elseif('apartment'==$order_data['post_type']){ 327 $order_url = esc_url(admin_url() . 'edit.php?post_type=tf_apartment&page=tf_apartment_booking&order_id=' . $order_id . '&book_id=' . $tf_order_details->id . '&action=preview'); 328 }else{ 329 $order_url = '#'; 330 } 329 331 330 332 $booking_details = '<table width="100%" style="max-width: 600px;border-collapse: collapse; color: #5A5A5A; font-family: Inter,sans-serif;"><thead><tr><th align="left" style="color:#0209AF;">Item Name</th><th align="center" style="color:#0209AF;">Quantity</th><th align="right" style="color:#0209AF;">Price</th></tr></thead><tbody style="border-bottom: 1px solid #D9D9D9">'; … … 648 650 foreach ( $meta_data as $meta ) { 649 651 if ( $meta->key == '_post_author' ) { 650 $vendor_id = $meta->value; 651 $vendor = get_userdata( $vendor_id ); 652 $vendor_emails[] = $vendor->user_email; 652 $vendor_id = $meta->value; 653 $vendor = get_userdata( $vendor_id ); 654 if ( $vendor && ! empty( $vendor->user_email ) ) { 655 $vendor_emails[] = $vendor->user_email; 656 } 653 657 } 654 658 } -
tourfic/trunk/inc/functions/woocommerce/wc-hotel.php
r3485880 r3493788 265 265 */ 266 266 if ( ! array_key_exists( 'errors', $response ) || count( $response['errors'] ) == 0 ) { 267 268 /** 269 * Hook: tf_hotel_booking_after_validation 270 * Fires after validation passes and before processing the booking. 271 * 272 * @since 2.3.0 273 * @hook tf_hotel_booking_after_validation 274 * @param int $post_id The hotel post ID. 275 * @param int $room_id The room post ID. 276 * @param string $check_in Check-in date. 277 * @param string $check_out Check-out date. 278 * @param int $adult Number of adults. 279 * @param int $child Number of children. 280 * @param int $room_selected Number of rooms selected. 281 */ 282 do_action( 'tf_hotel_booking_after_validation', $post_id, $room_id, $check_in, $check_out, $adult, $child, $room_selected ); 267 283 268 284 if (3 == $tf_booking_type) { … … 800 816 } 801 817 } else { 818 /** 819 * Hook: tf_hotel_before_booking_added_to_cart 820 * Fires before a hotel booking is added to the WooCommerce cart. 821 * 822 * @since 2.3.0 823 * @hook tf_hotel_before_booking_added_to_cart 824 * @param int $post_id The hotel post ID. 825 * @param array $tf_room_data The room booking data array. 826 * @param int $post_id The hotel post ID. 827 * @param int $product_id The WooCommerce product ID. 828 */ 829 do_action( 'tf_hotel_before_booking_added_to_cart', $post_id, $tf_room_data, $post_id, $product_id ); 830 802 831 # Add product to cart with the custom cart item data 803 832 $added_to_cart = WC()->cart->add_to_cart( $post_id, 1, '0', array(), $tf_room_data ); … … 806 835 $response['errors'][] = esc_html__( 'Unable to add this hotel booking to cart. Please try again.', 'tourfic' ); 807 836 } else { 837 /** 838 * Hook: tf_hotel_after_booking_added_to_cart 839 * Fires after a hotel booking is successfully added to the WooCommerce cart. 840 * 841 * @since 2.3.0 842 * @hook tf_hotel_after_booking_added_to_cart 843 * @param int $post_id The hotel post ID. 844 * @param array $tf_room_data The room booking data array. 845 * @param int $post_id The hotel post ID. 846 * @param int $product_id The WooCommerce product ID. 847 * @param string $added_to_cart The cart item key or false. 848 */ 849 do_action( 'tf_hotel_after_booking_added_to_cart', $post_id, $tf_room_data, $post_id, $product_id, $added_to_cart ); 850 808 851 $response['product_id'] = $product_id; 809 852 $response['add_to_cart'] = 'true'; … … 1306 1349 ) 1307 1350 ); 1351 1352 /** 1353 * Hook: tf_hotel_booking_processed 1354 * Fires when a hotel booking is processed (WooCommerce order is placed). 1355 * 1356 * @since 2.3.0 1357 * @hook tf_hotel_booking_processed 1358 * @param int $order_id The WooCommerce order ID. 1359 * @param WC_Order $order The WooCommerce order object. 1360 * @param int $item_id The item ID. 1361 * @param array $item The item data. 1362 * @param array $billinginfo The billing information. 1363 * @param array $shippinginfo The shipping information. 1364 * @param array $iteminfo The item information. 1365 */ 1366 do_action( 'tf_hotel_booking_processed', $order_id, $order, $item_id, $item, $billinginfo, $shippinginfo, $iteminfo ); 1308 1367 } 1309 1368 … … 1541 1600 ) 1542 1601 ); 1602 1603 /** 1604 * Hook: tf_hotel_booking_processed 1605 * Fires when a hotel booking is processed (WooCommerce order is placed). 1606 * 1607 * @since 2.3.0 1608 * @hook tf_hotel_booking_processed 1609 * @param int $order_id The WooCommerce order ID. 1610 * @param WC_Order $order The WooCommerce order object. 1611 * @param int $item_id The item ID. 1612 * @param array $item The item data. 1613 * @param array $billinginfo The billing information. 1614 * @param array $shippinginfo The shipping information. 1615 * @param array $iteminfo The item information. 1616 */ 1617 do_action( 'tf_hotel_booking_processed', $order_id, $order, $item_id, $item, $billinginfo, $shippinginfo, $iteminfo ); 1543 1618 } 1544 1619 -
tourfic/trunk/readme.txt
r3493305 r3493788 4 4 Requires at least: 5.4 5 5 Tested up to: 6.9 6 Stable tag: 2.21. 66 Stable tag: 2.21.7 7 7 Requires PHP: 7.4 8 8 License: GPLv2 or later … … 418 418 == Changelog == 419 419 420 = 2.21.7 – Mar 29, 2026 = 421 422 - Tweak: Backend booking and email functionality. 423 - Improved: Hooks and overall system stability. 424 420 425 = 2.21.6 – Mar 28, 2026 = 421 426 -
tourfic/trunk/tourfic.php
r3493305 r3493788 8 8 * Text Domain: tourfic 9 9 * Domain Path: /lang/ 10 * Version: 2.21. 610 * Version: 2.21.7 11 11 * Tested up to: 6.9 12 12 * WC tested up to: 10.4 … … 28 28 */ 29 29 30 const VERSION = '2.21. 6';30 const VERSION = '2.21.7'; 31 31 32 32 /**
Note: See TracChangeset
for help on using the changeset viewer.