Last active
August 20, 2018 05:53
-
-
Save anhskohbo/26decf9426f3f4d82be16712b22cceab to your computer and use it in GitHub Desktop.
Custom rate
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'abrs_setup_room_rate', function ( $room_rate ) { | |
/* @var $room_rate \AweBooking\Availability\Room_Rate */ | |
$request = $room_rate->get_request(); | |
$request_adults = $request | |
->get_guest_counts() | |
->get_adults() | |
->get_count(); | |
if ( ( $extra_adults = $request_adults - 1 ) > 0 ) { | |
$custom_rate = new \AweBooking\Model\Pricing\Custom_Rate_Interval( 'extra-adult-rate', 15 * $extra_adults ); | |
$room_rate->additional( $custom_rate ); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment