Free and Premium WordPress Plugins & Themes Forums WordPress Plugins Hotel Booking cotumize the booking-view.php
- This topic has 3 replies, 2 voices, and was last updated 4 years, 1 month ago by Andre Flores.
- AuthorPosts
- October 10, 2020 at 7:36 pm #1015689KhaledParticipant
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
October 10, 2020 at 7:50 pm #1015692KhaledParticipantas an example
2 Nights x 320€
1 Night x 190€subtotal 830€
without listing the Dates
October 13, 2020 at 7:02 pm #1016761KhaledParticipanti 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
October 15, 2020 at 6:52 am #1017300Andre FloresModeratorHello 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 - AuthorPosts
- You must be logged in to reply to this topic.