Free and Premium WordPress Plugins & Themes Forums WordPress Plugins Hotel Booking Check-in range Hours
- This topic has 7 replies, 4 voices, and was last updated 1 year, 11 months ago by J. Davis.
-
AuthorPosts
-
January 21, 2019 at 3:37 pm #763481fabrizio anichiniParticipant
Hi, Int the checkout page the check-in is formated in this way:
Check-in: January 25, 2019, from 11:00 amI want to change for show the details in this way:
Check-in: January 25, 2019,from 15:00 am to 19:30 amIs there any way to do this?
January 25, 2019 at 3:27 pm #765617J. DavisKeymasterHello Fabrizio,
As there is no option to indicate the time-frame for Check-In you may add this information as text to Booking Confirmation page before [mphb_checkout] shortcode.
or override initial function hardcording with your custom text e.g.:
add_action( 'wp_head', 'remove_my_class_action' ); function remove_my_class_action(){ remove_action( 'mphb_sc_checkout_form_booking_details', array( '\MPHB\Views\Shortcodes\CheckoutView', 'renderCheckInDate' ) ); } add_action( 'mphb_sc_checkout_form_booking_details', 'renderCheckInDate' ); function 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>, <span> <?php _ex( 'from', 'from 10:00 am', 'motopress-hotel-booking' ); ?> </span> <time datetime="<?php echo MPHB()->settings()->dateTime()->getCheckInTime(); ?>"> <?php echo MPHB()->settings()->dateTime()->getCheckInTimeWPFormatted() . ' to 19:30'; ?> </time> </p> <?php }
You may adjust time format at WordPress settings.
best regards,
J. DavisJuly 13, 2020 at 8:40 am #978695Michal PopelkaParticipantHi, where to insert this code? In function.php?
July 14, 2020 at 6:18 am #979081Andre FloresModeratorHello, Michal!
If you would like to overwrite the function itself, then yes, the code should be added to your child theme functions.php file.
Regards,
AndreDecember 20, 2022 at 11:52 am #1392533Massimo CliniParticipantHi, I’m your Pro customer, I used your code and it changed the check-in data type perfectly, but it didn’t change the check-out data type, how can I do it?
December 20, 2022 at 2:48 pm #1392648J. DavisKeymasterHi Massimo,
Thanks for your question. You may use the code below:
add_action( 'wp_head', 'remove_renderCheckOutDate' ); function remove_renderCheckOutDate(){ remove_action( 'mphb_sc_checkout_form_booking_details', array( '\MPHB\Views\Shortcodes\CheckoutView', 'renderCheckOutDate' ) ); } add_action( 'mphb_sc_checkout_form_booking_details', 'renderCheckOutDate' ); function renderCheckOutDate( $booking ){ ?> <p class="mphb-check-out-date"> <span><?php esc_html_e( 'Check-out:', 'motopress-hotel-booking' ); ?></span> <time datetime="<?php echo esc_attr( $booking->getCheckOutDate()->format( 'Y-m-d' ) ); ?>"> <strong> <?php echo esc_html( \MPHB\Utils\DateUtils::formatDateWPFront( $booking->getCheckOutDate() ) ); ?> </strong> </time>, <span> <?php echo esc_html_x( 'until', 'until 10:00 am', 'motopress-hotel-booking' ); ?> </span> <time datetime="<?php echo esc_attr( MPHB()->settings()->dateTime()->getCheckOutTime() ); ?>"> <?php echo esc_html( MPHB()->settings()->dateTime()->getCheckOutTimeWPFormatted() ); ?> </time> </p> <?php }
best regards,
John DavisDecember 20, 2022 at 3:03 pm #1392664Massimo CliniParticipantThanks, but sadly even after pasting it in
function.php does not give me the requested result, unfortunately the time in 12 hours continues to appear.
Furthermore, even removing the AM writing from the code, it continues to appear on the wording and the time, while it has changed on check-in, has not changed on check-out.
I attach an image to be clearer.
Thank you so much for your kindness.December 20, 2022 at 10:17 pm #1392751J. DavisKeymasterHi Massimo,
Thanks for your question. If you need to change the time format you may do this at Dashboard – Settings – General (WordPress settings). The plugin inherits the time format from WordPress settings.
best regards,
John Davis -
AuthorPosts
- You must be logged in to reply to this topic.