Public holidays

More
9 years 1 month ago #5259 by aries_max
Public holidays was created by aries_max
Hello,
I would like to have special rates for public holidays in my tariffs.
I can think of one way to do this by manually creating tariffs valid on the holidays dates only, but it would be very fastidious.
Is there a smarter way to do that ? I am thinking of overriding the day of week and put sunday in case of a public holiday taken from an external source. Where could I start ?
Thanks
Max

Please Log in or Create an account to join the conversation.

More
9 years 1 month ago #5260 by vietvh
Replied by vietvh on topic Public holidays
Hi,

Could you elaborate more on " I am thinking of overriding the day of week and put sunday in case of a public holiday taken from an external source." ?

Regards,

Please Log in or Create an account to join the conversation.

More
9 years 1 month ago #5261 by aries_max
Replied by aries_max on topic Public holidays
I guess there is a function returning the day of week in the computation of the room price, before retrieving the cost from the complex tariff.
If I override this function and return a sunday in case the day is public holiday, it will use the correct tarriff (ie sunday tariff).

Please Log in or Create an account to join the conversation.

More
9 years 1 month ago #5264 by vietvh
Replied by vietvh on topic Public holidays
Hi,

You may want to check this file:

/libraries/solidres/roomtype/roomtype.php

Method: calculateCostPerDay()

Regards,
The following user(s) said Thank You: aries_max

Please Log in or Create an account to join the conversation.

More
9 years 1 month ago #5273 by aries_max
Replied by aries_max on topic Public holidays
Thanks, I found what I needed in this file and in /administrator/components/com_solidres/models/reservationasset.php

now I would like to have a function isHoliday($date) defined somewhere else, that can be called from those 2 different files.

Where should I define this function?

Thanks
Max

Please Log in or Create an account to join the conversation.

More
9 years 1 month ago #5274 by vietvh
Replied by vietvh on topic Public holidays
Hi,

If a method is shared between multiple files, it is better to put it into a library like SRRoomType or SRUtilities

/libraries/solidres/utilities/utilities.php

Then you can call it like this:
$solidresUtilities = SRFactory::get('solidres.utilities.utilities');
$result = $solidresUtilities->isHoliday($date);

Regards,
The following user(s) said Thank You: aries_max

Please Log in or Create an account to join the conversation.

Moderators: solidres
Powered by Kunena Forum

All the things you need to make your work easier. Did you like Solidres?