Prices start at:

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
  • #786537
    Nick Shemenski

    Currently on the availability page it shows:

    Prices start at: $447 for 3 nights

    I would like it to show the rate for one night, not 3 nights.
    In the settings I have a minimum stay set to 3 nights.
    How can I have it show a single night rate?

    Thank you

    Stacy Lind

    Our plugin cannot display prices per one night if you have minimum stay rules. This would require a custom solution. Here is how you can customize it:
    1. Add the following to wp-content\themes\your-child-theme\functions.php:

    function custom_mphb_tmpl_the_room_type_default_price( $id = null ){
     $roomType = $id ? MPHB()->getRoomTypeRepository()->findById( $id ) : MPHB()->getCurrentRoomType();
     $nights = 1;
     $price  = $roomType->getDefaultPrice();
     $defaultPriceForNights = $price * $nights;
     $title = __( 'Choose dates to see relevant prices', 'motopress-hotel-booking' );
     $formattedPrice = mphb_format_price( $defaultPriceForNights, array(
      'period'   => true,
      'period_nights'  => $nights,
      'period_title'  => $title
     echo $formattedPrice;

    2. Copy wp-content\plugins\motopress-hotel-booking\templates\loop-room-type\price.php into wp-content\themes\your-child-theme\hotel-booking\loop-room-type\price.php.
    3. In wp-content\themes\your-child-theme\hotel-booking\loop-room-type\price.php change the line 19 to the following:
    <?php custom_mphb_tmpl_the_room_type_default_price(); ?>
    It will always display prices per night unless your customer searchers for specific dates. We could also customize the code for you with the extended support offer.

    Nick Shemenski

    Thank you. That worked great.

    Can I also change it on the accommodation/beach-cottage/ page?
    Beach Cottage is the name of my accommodation.

    It still shows the 3 nights price there.

    Thank you

    Stacy Lind

    Hi Nick,

    1. Copy \wp-content\plugins\motopress-hotel-booking\templates\single-room-type\price.php into wp-content\themes\your-child-theme\hotel-booking\single-room-type\price.php.
    2. In wp-content\themes\your-child-theme\hotel-booking\single-room-type\price.php change the line 19 to the following:
    <?php custom_mphb_tmpl_the_room_type_default_price(); ?>

    Nick Shemenski


    Thank you.

    Edner Zephir

    I enjoyed this post. Thanks to Stacy and Nick

    So, with this trick how can Stacy help me achieve the following:

    Minimum stay works in calendar only when I select all accommodation?


    1) Rule set only for this villa: > guest can select 1 day: After checking for availability this villa not shown but it not make sense.
    2) Rule set for all accommodation: > in this case, yes it works > |

    J. Davis

    Hi Edner,

    In order to display and reflect the booking rules of certain accommodation type you should enable Skip Search results option at Accommodation > Settings. Then the date pick calendar will display available and not available dates of each accommodation type.

    best regards,
    J. Davis

    William Jepson

    How can I also show the 1 night price on the homepage slider widget? Above code worked on 3 column accomodation but still shows 3 night price on slider widget.

    J. Davis

    Hi William,

    You may try to add a custom function name custom_mphb_tmpl_the_room_type_default_price in the following file \wp-content\plugins\motopress-hotel-booking\templates\widgets\rooms\room-content.php

    instead of


    best regards,
    J. Davis

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