Menu Content

Support

> Forums, FAQs & Paid Support
Welcome, Guest
Username Password: Remember me

Change reservations to 48 hours in front
(1 viewing) (1) Guest
Universal booking and reservations component for Joomla!.

NOTE: This category has been locked. If you have purchased paid version, please, use our Support Ticket system instead. If you are using free edition, please see the Community Support section.
  • Page:
  • 1

TOPIC: Change reservations to 48 hours in front

Change reservations to 48 hours in front 12 years, 8 months ago #29596

  • LAMF
  • OFFLINE
  • Posts: 72
How can I change reservations to be allowed not earlier than 48 hours in before event takes place?
Now there is only an option to allow or not allow reservation current day or is there some options to set this up?
It is rellay important that I can set this up, I need it on all objects on my site.
If it's not possible can you customize it for me?
The topic has been locked.

Re: Change reservations to 48 hours in front 12 years, 8 months ago #29619

  • jitr
  • OFFLINE
  • ARTIO Support
  • Posts: 1432
It can be very easy.
Look at the administrator/components/com_booking/helpers/booking.php.

There is row (651) looks like:

if (($config->bookCurrentDay ? ($timeDay > $service->fromUts) : ($time > $service->fromUts)) || $service->alreadyReserved>=$subject->total_capacity)

You can improve it e.g. to make time offset:

if (($config->bookCurrentDay ? ($timeDay > $service->fromUts) : (($time + DAY_LENGTH) > $service->fromUts)) || $service->alreadyReserved>=$subject->total_capacity)
ARTIO Support Team
The topic has been locked.

Re: Change reservations to 48 hours in front 12 years, 8 months ago #29631

  • LAMF
  • OFFLINE
  • Posts: 72
I don't think I totally understand.
I have edited the file as you told me but nothing seems to affect the reservation time before you can book an object.

Should I edit line 651 like this?

if (($config->bookCurrentDay ? ($timeDay > $service->fromUts) : (($time + DAY_LENGTH) > $service->fromUts)) || $service->alreadyReserved>=$subject->total_capacity)

Or should I add something on the DAY_LENGTH parameter?
The topic has been locked.

Re: Change reservations to 48 hours in front 12 years, 8 months ago #29678

  • jitr
  • OFFLINE
  • ARTIO Support
  • Posts: 1432
Hello, DAY_LENGTH is constant where is length of day in seconds.
This hack shifts current day for one day into future.
In property $time is output of PHP function time().
ARTIO Support Team
The topic has been locked.

Re: Change reservations to 48 hours in front 12 years, 8 months ago #29683

  • LAMF
  • OFFLINE
  • Posts: 72
Yes it did effect as I wanted so now I can only book 48 hrs in advance, great!!!
The topic has been locked.
  • Page:
  • 1
User Login Empty