Next departure in the past?

Homepage Forums WP Travel Pro Next departure in the past?

This topic contains 9 replies, has 2 voices, and was last updated by  Support Team 2 weeks, 6 days ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #19214

    Zamfari
    Participant

    I followed the instruction and it works well.

    1. On the trip page: where can I modify the “title text”: Fixed Departure in Next Departure?
    Response: Please add below-given code in your child theme funtions.php file.
    https://pastebin.com/NUSec08n

    Under next departure it is showing the first date that is listed in the database for this trip regardless if it is in the past or not. How can a validity check be included to make sure that it shows a future departure date?

    Under the tab “Booking” it is listing all dates from the database with past departures faded to grey. Is it possible to disable past departure dates and only show departures that are in the future (i.e. today’s date + 3 days)?

    https://prnt.sc/owvu8l (We are in August and it shows a July departe)

    • This topic was modified 3 weeks, 4 days ago by  Zamfari.
    #19252

    Support Team
    Keymaster

    Hello

    Actually, the dates that are faded to grey cannot be selected and shows that the dates are no more available to book. However, if you still want to completely remove the dates from the calendar, please attach the below given CSS in the Additional CSS section:

    .datepicker--cell.-disabled- {
      visibility: hidden !important;
    }

    Hope this helps

    Feel free to reach us for any further query/confusion.

    Regards!

    #19259

    Zamfari
    Participant

    Thank you for your reply.

    Actually, the dates that are faded to grey cannot be selected and shows that the dates are no more available to book. Yes, but after adding your snippet to the Additioal CSS it shows me empty boxes where the past departure dates used to be.

    In my opinion it is not a matter of hiding or showing past departure dates. The function that is selecting the dates needs to be changed in a way to ommit the past departure dates like “select departure_dates where departure_date > today()+2)”

    Please have a look at the screenshot https://prnt.sc/oxlt9s

    The date showing at Next Departure is 05/07/2019. The function selecting the date has to test if the next departure date in the future.

    Please help. Thank you very much. Daniel Schreiner

    #19260

    Support Team
    Keymaster

    Hello

    The feature that you have requested requires changes in the core plugin file. Due to this reason, if you want the feature in your side, you need to hire a professional developer.

    Please refer to the given link to hire a developer : https://wptravel.io/hire-our-customizer/

    Regards!

    #19269

    Zamfari
    Participant

    It’s not a feature. This is a bug. It’s common sense that the next departure date can’t be in the past.

    #19281

    Support Team
    Keymaster

    Hello

    We are sorry for the misunderstandings. We are not able to replicate the exact issue as for now in our side. We will inspect the issue further and come back to you.

    Hoping for your kind co-operation.

    Regards!

    #19312

    Zamfari
    Participant

    I deleted the obsolete departure dates from the backend to make sure that the available departure dates are valid and in the future.

    if ( ! function_exists( ‘wp_travel_get_trip_available_dates’ ) ) {

    /**
    * Get Available Dates for specific trip.
    *
    * @param Number $trip_id Current trip id.
    * @since 1.8.3
    */
    function wp_travel_get_trip_available_dates( $trip_id, $price_key = ” ) {

    if ( ! $trip_id ) {
    return;
    }

    $multiple_fixed_departue = get_post_meta( $trip_id, ‘wp_travel_enable_multiple_fixed_departue’, true );

    $available_dates = array();

    $fixed_departure = get_post_meta( $trip_id, ‘wp_travel_fixed_departure’, true );
    if ( ‘yes’ === $fixed_departure ) {
    if ( ‘yes’ === $multiple_fixed_departue ) {
    $available_dates = wp_travel_get_pricing_variation_start_dates( $trip_id, $price_key );
    } else {
    $date = get_post_meta( $trip_id, ‘wp_travel_start_date’, true );
    $available_dates = array( $date );
    }
    }
    return $available_dates;
    }
    }

    Is this the function to pick the next departure date? Than the available departure date has to be checked if it is in the future (available departure date > today)

    Looking forward to hearing from you again. Thank you very much. Daniel Schreiner

    #19314

    Support Team
    Keymaster

    Hello

    We have already fixed the issue and thank you for pointing it out. Our developer team are working on other enhancements for the coming update.

    However, we have created a code snippet which can solve the issue in your particular site. Please paste the given code in functions.php file of your child theme : https://pastebin.com/DDeYiXnM

    Once the update is out, do not forget to remove the code from the child theme.

    If you face any further confusion, feel free to reach back to us.

    Regards!

    #19323

    Zamfari
    Participant

    Thank you very much. Implemented. Looking forward to the next update of WP_Travel.

    #19330

    Support Team
    Keymaster

    Hello @zamfari,

    Thank you for the co-operation.

    We will definitely release the update soon with the fixes.

    Thank you.

Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.