Free and Premium WordPress Plugins & Themes Forums WordPress Plugins Hotel Booking Set taxes per person in percentage
- This topic has 6 replies, 3 voices, and was last updated 1 week ago by
Christophe CONDUCHE.
- AuthorPosts
- April 28, 2022 at 5:17 am #1296593
David Mussard
ParticipantHi,
In my area tourist tax is 5% of the room rent/adult/day . How can I set this please ?
I could have done a general 5% tax but children are not concerned by this tax.Regards,
DavidApril 29, 2022 at 4:08 am #1297050David Mussard
ParticipantIn fact their formula is worst :
$roomPrice / $adults * ($tax['amount']['adults']/100) + $roomPrice / $children * ($tax['amount']['children ']/100);
It looks like I’ll need to hardcode this into the
motopress-hotel-booking/includes/entities/reserved-room.phpand replace the line 434.
Please notify me if you add this natively into your code.
Thanks.April 29, 2022 at 7:27 am #1297169J. Davis
KeymasterHi David,
Unfortunately, there is no possibility to add a percentage tax that should be applied to adults only. Also there is no option to override the function safely from updates so you might need to modify the files of the plugin directly.
best regards,
J. DavisJune 30, 2025 at 1:53 pm #1777569Christophe CONDUCHE
ParticipantCan you confirm us where it is now in the source code ?
The files structer has changed a bit. I tried to modify it in the file taxesandfees.php in includes/taxandfees(www/wp/wp-content/plugins/motopress-hotel-booking/includes/taxes-and-fees)
I need a formula of type :
($roomPrice / ($adults+ $children)) * ($tax[‘amount’][‘adults’]/100) * 1.44 * $adults
I tried this :
$feePrice = ($this->roomPrice / ($this->atts[‘adults_amount’] + $this->atts[‘children_amount’]))
*( $fee[‘amount’][‘adults’]/100 ) * 1.44 * $this->atts[‘adults_amount’] ;I tried also to do the appropriate change to tax switch a few lines upper but it seems that the “Taxe de sejour (Accomodotaito n rate) is neithe a tax ort a fee of this function/file.
Where can I look at to change it ?
I tried to look in the suggested file motopress-hotel-booking/includes/entities/reserved-room.php but didn’t found the AccomadationTax calculation.Where it is ?
June 30, 2025 at 10:02 pm #1777591Christophe CONDUCHE
Participantprivate function calcTaxes() { if ( ! empty( $this->taxes ) ) { foreach ( $this->taxes as $tax ) { $taxPrice = 0; switch ( $tax['type'] ) { case 'per_guest_per_day': $taxPrice = $this->atts['adults_amount'] * $tax['amount']['adults'] + $this->atts['children_amount'] * $tax['amount']['children']; if ( $tax['limit'] == 0 ) { $taxPrice *= $this->atts['period_nights']; } else { $taxPrice *= min( $tax['limit'], $this->atts['period_nights'] ); } break; case 'per_room_per_day': $taxPrice = $this->atts['accommodations_amount'] * $tax['amount']; if ( $tax['limit'] == 0 ) { $taxPrice *= $this->atts['period_nights']; } else { $taxPrice *= min( $tax['limit'], $this->atts['period_nights'] ); } break; case 'per_room_percentage': $taxPrice = $this->roomPrice / 100 * $tax['amount']; break; } if ( $tax['included'] ) { $this->taxIncludedTotal += $taxPrice; } else { $this->taxExcludedTotal += $taxPrice; } } } }
I tried to change the calculation to
$taxPrice = ($this->roomPrice / ($this->atts[‘adults_amount’] + $this->atts[‘children_amount’]))
*( $tax[‘amount’][‘adults’]/100 ) * 1.44 * $this->atts[‘adults_amount’] ;or
$feePrice = ($this->roomPrice / ($this->atts[‘adults_amount’] + $this->atts[‘children_amount’]))
*( $fee[‘amount’][‘adults’]/100 ) * 1.44 * $this->atts[‘adults_amount’] ;in both switch ccase ‘per_guest_per_day’:
but without the expected effect
July 4, 2025 at 5:55 am #1778416J. Davis
KeymasterHi Christophe,
Unfortunately, we do not provide customization services or consultation of this type, as all our developers are working on new plugins and theme updates. You can search for a third-party developer who can modify the plugin according to your needs.July 16, 2025 at 1:20 am #1781632Christophe CONDUCHE
ParticipantHumm, this is not a standalone request, this is mandatory in order to be able to calculate corectly the “Taxe de séjour” in France.
without this function HB is not usable in France.
- AuthorPosts
- You must be logged in to reply to this topic.