Prices start at:

  • This topic has 5 replies, 1 voice, and was last updated 12 months ago by J. Davis.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #786537
    Nick Shemenski
    Participant

    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

    #787079
    Stacy Lind
    Keymaster

    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.

    #787250
    Nick Shemenski
    Participant

    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

    #787932
    Stacy Lind
    Keymaster

    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(); ?>

    #788119
    Nick Shemenski
    Participant

    Stacy,

    Thank you.

    #943682
    Edner Zephir
    Participant

    Hello,
    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?
    Example: https://viprealtymanagers.com/alquiler/accommodation/villa-vanilla/

    Scenario

    1) Rule set only for this villa: https://prnt.sc/rynko6 > guest can select 1 day: https://prnt.sc/ryniyd. After checking for availability this villa not shown but it not make sense.
    2) Rule set for all accommodation: https://prnt.sc/rynlbk > in this case, yes it works > https://prnt.sc/rynly5 | https://prnt.sc/rynmi0

    #945559
    J. Davis
    Keymaster

    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

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