- Posts: 35
- Home
- Forum
- Community Forum
- General discussions
- feedback payment by PayPal
Public holidays
- aries_max
- Topic Author
- Offline
Less
More
9 years 2 months 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
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.
- vietvh
- Offline
Less
More
- Posts: 1553
9 years 2 months 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,
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.
- aries_max
- Topic Author
- Offline
Less
More
- Posts: 35
9 years 2 months 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).
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.
- vietvh
- Offline
Less
More
- Posts: 1553
9 years 2 months 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,
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.
- aries_max
- Topic Author
- Offline
Less
More
- Posts: 35
9 years 2 months 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
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.
- vietvh
- Offline
Less
More
- Posts: 1553
9 years 2 months 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:
Regards,
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