Free and Premium WordPress Plugins & Themes Forums WordPress Plugins Hotel Booking Check-in/out times for different accommodations
- This topic has 7 replies, 3 voices, and was last updated 1 year, 5 months ago by J. Davis.
- AuthorPosts
- March 28, 2019 at 4:54 pm #788654Chrissy RaudonisParticipant
I’m using the plugin to manage a property with several different vacation rentals that all have different check-in/out times. Is there a way to display different times for each accommodation type? If not, how could I hide them both from webpages and e-mails?
Thank you!
April 3, 2019 at 7:50 pm #790586Chrissy RaudonisParticipantThis is still an outstanding issue. Please help.
April 4, 2019 at 3:22 pm #790915J. DavisKeymasterHi Chissy,
It is possible to set general Check-in and Check-out time for all properties only. So you may hide the time from booking confirmation page adding the code below to functions.php file of your theme:
add_action( 'wp_head', 'remove_renderCheckInDate_and_renderCheckOutDate' ); function remove_renderCheckInDate_and_renderCheckOutDate(){ remove_action( 'mphb_sc_checkout_form_booking_details', array( '\MPHB\Views\Shortcodes\CheckoutView', 'renderCheckInDate' ) ); remove_action( 'mphb_sc_checkout_form_booking_details', array( '\MPHB\Views\Shortcodes\CheckoutView', 'renderCheckOutDate' ) ); } add_action( 'mphb_sc_checkout_form_booking_details', 'my_renderCheckInDate' ); function my_renderCheckInDate($booking){ ?> <p class="mphb-check-in-date"> <span><?php _e( 'Check-in:', 'motopress-hotel-booking' ); ?></span> <time datetime="<?php echo $booking->getCheckInDate()->format( 'Y-m-d' ); ?>"> <strong> <?php echo \MPHB\Utils\DateUtils::formatDateWPFront( $booking->getCheckInDate() ); ?> </strong> </time> </p> <?php } add_action( 'mphb_sc_checkout_form_booking_details', 'my_renderCheckOutDate' ); function my_renderCheckOutDate($booking){ ?> <p class="mphb-check-out-date"> <span><?php _e( 'Check-out:', 'motopress-hotel-booking' ); ?></span> <time datetime="<?php echo $booking->getCheckOutDate()->format( 'Y-m-d' ); ?>"> <strong> <?php echo \MPHB\Utils\DateUtils::formatDateWPFront( $booking->getCheckOutDate() ); ?> </strong> </time> </p> <?php }
Also you may remove the check in and out time from emails by editing translation of the Hotel Booking plugin.
best regards,
J. DavisApril 4, 2019 at 3:50 pm #790927Chrissy RaudonisParticipantWorked great! Thank you.
November 3, 2020 at 2:16 pm #1025070Jan Morten TøndelParticipantWhere in the php file do you add this?
April 26, 2021 at 7:14 am #1111949J. DavisKeymasterHi Jan,
It can be added at the end of the functions.php file of the parent or child theme or added as a custom plugin.
best regards,
J. DavisJuly 17, 2023 at 12:56 pm #1480111LarryMParticipantA less technical solution to hide the booking form checkin/checkout times using CSS only:
.mphb_sc_checkout-wrapper .mphb-check-in-date, .mphb_sc_checkout-wrapper .mphb-check-out-date{ font-size: 0 !important; } .mphb_sc_checkout-wrapper .mphb-check-in-date span:first-of-type, .mphb_sc_checkout-wrapper .mphb-check-in-date time:first-of-type strong, .mphb_sc_checkout-wrapper .mphb-check-out-date span:first-of-type, .mphb_sc_checkout-wrapper .mphb-check-out-date time:first-of-type strong{ font-size: 1rem !important; }
July 19, 2023 at 2:08 pm #1481083J. DavisKeymasterThank you for the solution you shared here.
- AuthorPosts
- You must be logged in to reply to this topic.