Plugin Directory

Changeset 3493788


Ignore:
Timestamp:
03/29/2026 11:08:20 AM (3 days ago)
Author:
themefic
Message:

2.21.7

Location:
tourfic/trunk
Files:
1 added
7 edited

Legend:

Unmodified
Added
Removed
  • tourfic/trunk/inc/Admin/Backend_Booking/TF_Apartment_Backend_Booking.php

    r3354901 r3493788  
    459459
    460460            $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            }
    461464
    462465            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  
    548548
    549549            $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            }
    550553
    551554            $rooms     = Room::get_hotel_rooms( intval( $field['tf_available_hotels'] ) );
  • tourfic/trunk/inc/Admin/Backend_Booking/TF_Tour_Backend_Booking.php

    r3485880 r3493788  
    361361            if ( ! array_key_exists( 'errors', $res['response'] ) || count( $res['response']['errors'] ) == 0 ) {
    362362                $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                }
    363366
    364367                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  
    311311        $order_billing_state = !empty($order_data['billing_details']['billing_state']) ? $order_data['billing_details']['billing_state'] : '';
    312312        $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'] : '' );
    314314        $order_date_created     = $order_data['order_date'];
    315315
     
    318318        $tf_order_details = $wpdb->get_row( $wpdb->prepare( "SELECT id FROM {$wpdb->prefix}tf_order_data WHERE order_id = %s",sanitize_key( $order_id ) ) );
    319319
    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        }
    329331
    330332        $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">';
     
    648650            foreach ( $meta_data as $meta ) {
    649651                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                    }
    653657                }
    654658            }
  • tourfic/trunk/inc/functions/woocommerce/wc-hotel.php

    r3485880 r3493788  
    265265     */
    266266    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 );
    267283
    268284        if (3 == $tf_booking_type) {
     
    800816            }
    801817        } 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
    802831            # Add product to cart with the custom cart item data
    803832            $added_to_cart = WC()->cart->add_to_cart( $post_id, 1, '0', array(), $tf_room_data );
     
    806835                $response['errors'][] = esc_html__( 'Unable to add this hotel booking to cart. Please try again.', 'tourfic' );
    807836            } 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
    808851                $response['product_id']  = $product_id;
    809852                $response['add_to_cart'] = 'true';
     
    13061349                )
    13071350            );
     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 );
    13081367        }
    13091368
     
    15411600                )
    15421601            );
     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 );
    15431618        }
    15441619
  • tourfic/trunk/readme.txt

    r3493305 r3493788  
    44Requires at least: 5.4
    55Tested up to: 6.9
    6 Stable tag: 2.21.6
     6Stable tag: 2.21.7
    77Requires PHP: 7.4
    88License: GPLv2 or later
     
    418418== Changelog ==
    419419
     420= 2.21.7 – Mar 29, 2026 =
     421
     422- Tweak: Backend booking and email functionality.
     423- Improved: Hooks and overall system stability.
     424
    420425= 2.21.6 – Mar 28, 2026 =
    421426
  • tourfic/trunk/tourfic.php

    r3493305 r3493788  
    88 * Text Domain:     tourfic
    99 * Domain Path:     /lang/
    10  * Version:         2.21.6
     10 * Version:         2.21.7
    1111 * Tested up to:    6.9
    1212 * WC tested up to: 10.4
     
    2828     */
    2929
    30     const VERSION = '2.21.6';
     30    const VERSION = '2.21.7';
    3131
    3232    /**
Note: See TracChangeset for help on using the changeset viewer.