Check-in range Hours

  • This topic has 3 replies, 2 voices, and was last updated 3 weeks, 1 day ago by Andre Flores.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #763481
    fabrizio anichini
    Participant

    Hi, Int the checkout page the check-in is formated in this way:
    Check-in: January 25, 2019, from 11:00 am

    I want to change for show the details in this way:
    Check-in: January 25, 2019,from 15:00 am to 19:30 am

    Is there any way to do this?

    #765617
    J. Davis
    Keymaster

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

    #978695
    Michal Popelka
    Participant

    Hi, where to insert this code? In function.php?

    #979081
    Andre Flores
    Moderator

    Hello, 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,
    Andre

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