add_action('wp_head','remove_renderRateChooser');
function remove_renderRateChooser(){
remove_action( 'mphb_sc_checkout_room_details', array( '\MPHB\Views\Shortcodes\CheckoutView', 'renderRateChooser' ), 30, 5 );
}

add_action( 'mphb_sc_checkout_room_details', 'theme_renderRateChooser' , 30, 5 );

function theme_renderRateChooser($reservedRoom, $roomIndex, $roomType, $booking, $roomDetails)
    {
        $namePrefix = 'mphb_room_details[' . esc_attr($roomIndex) . ']';
        $idPrefix = 'mphb_room_details-' . esc_attr($roomIndex);

		$allowedRates   = $roomDetails[$roomIndex]['allowed_rates'];
        $defaultRate    = reset($allowedRates);
        $selectedRateId = $defaultRate->getOriginalId();
		$adults         = $roomDetails[$roomIndex]['adults'];
		$children       = $roomDetails[$roomIndex]['children'];

        if (count($allowedRates) > 1) {
            $selectedRateId = apply_filters('mphb_sc_checkout_preset_rate_id', $selectedRateId, $reservedRoom, $booking, $allowedRates);

            ?>
            <section class="mphb-rate-chooser mphb-checkout-item-section">
                <h4 class="mphb-room-rate-chooser-title">
                    <?php esc_html_e('Choose Rate', 'motopress-hotel-booking'); ?>
                </h4>

                <?php
                foreach ($allowedRates as $rate) {
                    $rate = apply_filters('_mphb_translate_rate', $rate);
                    $rateId = $rate->getOriginalId();

                    MPHB()->reservationRequest()->setupParameters(array(
                        'adults'         => $adults,
                        'children'       => $children,
                        'check_in_date'  => $booking->getCheckInDate(),
                        'check_out_date' => $booking->getCheckOutDate()
                    ));

                    $ratePrice = mphb_format_price($rate->calcPrice($booking->getCheckInDate(), $booking->getCheckOutDate()));

                    $inputId = $idPrefix . '-rate-id-' . $rateId;
                    $inputName = $namePrefix . '[rate_id]';

                    ?>
                    <p class="mphb-room-rate-variant">
                        <label for="<?php echo esc_attr($inputId); ?>">
                            <input type="radio" id="<?php echo esc_attr($inputId); ?>" name="<?php echo esc_attr($inputName); ?>" class="mphb_sc_checkout-rate mphb_checkout-rate mphb-radio-label" value="<?php echo esc_attr($rateId); ?>" <?php checked($selectedRateId, $rateId); ?>>
                            <strong>
                                <?php // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
								echo esc_html( $rate->getTitle() ) . ', ' . $ratePrice; ?>
                            </strong>
                        </label>
                        <br>
                        <?php echo  wp_kses_post($rate->getDescription()); ?>
                    </p>
                <?php } // For each allowed rate ?>
            </section>
        <?php } else { ?>
            <input type="hidden" name="<?php echo esc_attr($namePrefix); ?>[rate_id]" value="<?php echo esc_attr($selectedRateId); ?>">
        <?php }
    }
