- This topic has 9 replies, 2 voices, and was last updated 3 years, 9 months ago by
Support Team.
- AuthorPosts
- August 24, 2019 at 8:59 am #19214
Zamfari
ParticipantI 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/NUSec08nUnder 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)
August 26, 2019 at 4:33 am #19252Support Team
KeymasterHello
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!
August 26, 2019 at 10:41 am #19259Zamfari
ParticipantThank 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
August 26, 2019 at 11:32 am #19260Support Team
KeymasterHello
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!
August 26, 2019 at 12:41 pm #19269Zamfari
ParticipantIt’s not a feature. This is a bug. It’s common sense that the next departure date can’t be in the past.
August 27, 2019 at 3:27 am #19281Support Team
KeymasterHello
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!
August 28, 2019 at 10:31 am #19312Zamfari
ParticipantI 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
August 28, 2019 at 12:05 pm #19314Support Team
KeymasterHello
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!
August 28, 2019 at 7:22 pm #19323Zamfari
ParticipantThank you very much. Implemented. Looking forward to the next update of WP_Travel.
August 29, 2019 at 3:30 am #19330Support Team
KeymasterHello @zamfari,
Thank you for the co-operation.
We will definitely release the update soon with the fixes.
Thank you.
- AuthorPosts
- The forum ‘WP Travel Pro’ is closed to new topics and replies.