cotumize the booking-view.php

  • This topic has 3 replies, 2 voices, and was last updated 6 months ago by Andre Flores.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1015689
    Citibay
    Participant

    Hi,

    i need to customize the booking-view.php in
    / wp-content / plugins / motopress-hotel-booking / includes / views /
    at this section.

    <?php foreach ( $roomBreakdown['room']['list'] as $date => $datePrice ) : ?>
                                   <tr class="<?php echo esc_attr("{$foldedClass} mphb-price-breakdown-date"); ?>">
    									<td colspan="<?php echo ( $useThreeColumns ? 2 : 1 ); ?>"><?php echo \MPHB\Utils\DateUtils::formatDateWPFront( \DateTime::createFromFormat( 'Y-m-d', $date ) ); ?></td>
    									<td class="mphb-table-price-column"><?php echo mphb_format_price( $datePrice ); ?></td>
    								</tr>
    							<?php endforeach; ?>

    actual behavior is that all the Dates and the Prices are getting listed in the price details.
    some guests are booking 21 Nights and more. Having 21 Days with prices listed in the Price break down is kind of confusing.

    how can i change this code to to sum up the nights and get something like:

    Nights 21
    14 Nights for 200€ (the price of main season)
    7 Nights for 250€ (the price of second season)

    Subtotal 4550€

    best regards

    #1015692
    Citibay
    Participant

    as an example

    View post on imgur.com

    2 Nights x 320€
    1 Night x 190€

    subtotal 830€

    without listing the Dates

    #1016761
    Citibay
    Participant

    i was trying to create a function that return the results i need but i am struggle on creating an array with the prices.

    what i think would work is the following, from the example above:

    <?PHP
    
    $prices = array ( 320, 320, 190 ); //this array must be created with some loop
    
    $count = array_count_values ( $prices );
    
    while ( list ( $key, $val ) = each ( $count ) )
    {
        echo $val . ' x Nights for ' . $key . '€ <br>';
    }
    
    ?>

    output is:
    2 x Nights for 320€
    1 x Nights for 190€

    But my problem now is how to create this array ( 320, 320, 190 ) with the room prices.

    i would be thankful for any help

    best regards

    #1017300
    Andre Flores
    Moderator

    Hello there!

    I must say that requested changes appear to be a matter of custom coding, which requires performing major changes to the plugin code and is beyond our support scope. Unfortunately, our developers are currently busy with other priority tasks, so I am afraid they will not be able to to look into this matter for you within our paid services.
    Thank you for comprehension.

    Regards,
    Andre

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