Check-in/out times for different accommodations

Free and Premium WordPress Plugins & Themes Forums WordPress Plugins Hotel Booking Check-in/out times for different accommodations

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #788654
    Chrissy Raudonis
    Participant

    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!

    #790586
    Chrissy Raudonis
    Participant

    This is still an outstanding issue. Please help.

    #790915
    J. Davis
    Keymaster

    Hi 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. Davis

    #790927
    Chrissy Raudonis
    Participant

    Worked great! Thank you.

    #1025070
    Jan Morten Tøndel
    Participant

    Where in the php file do you add this?

    #1111949
    J. Davis
    Keymaster

    Hi 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. Davis

    #1480111
    LarryM
    Participant

    A 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;
    }
    #1481083
    J. Davis
    Keymaster

    Thank you for the solution you shared here.

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.