Page 1 of 1

Restricting dropdowns

Posted: Thu Jul 31, 2014 10:24 pm
by AJMegaughin
Is there away of passing a parameter to /instant_booking_tpl.php or /availability_tpl.php
to force them to only show availability for a specific rate type ?
(Rather than showing all types in the dropdown?)

For example, if I have one webpage per apartment, I'd like to take the client to a booking form which only shows them the Apartment for the page they were looking at.

Re: Restricting dropdowns

Posted: Mon Aug 18, 2014 8:29 pm
by AJMegaughin
SOLVED ! SOLVED ! SOLVED !
(And without having to pass any parameters, all thanks to Marco's flexible code.)


As you probably know, it's possible to determine which rates are displayed on the normal availability page.
( Configure > Website > Website pages > Availability Page ) You simply use the checkboxes beside each rate before creating availability_tpl.php

What I wanted was to have multiple versions of availability_tpl.php available, at the same time, each showing different rates.

This is possible, if you self-host, by creating the file multiple times and keep renaming it, but I couldn't see a way of doing it with the digital druid hosting option.

As with may things, it's possible, but only if you can find the the right bit to edit !-)


Under Menu > Configure & Customise is the option "Directories where website pages are created:"
By default, everything is created in /pub folder, but it's possible to create others here
e.g. enter /,DEV/,Apartment_1/,Apartment_2/ then press <change>
This creates a DEV sub-folder for testing purposes and a sub-folder for 2 apartments.

When you navigate back to Configure > Website > Website pages , you will see that the page has changed.

A new "Directory" option now exists with a drop-down
pub
pub/Dev
pub/Apartment_1
pub/Apartment_2 etc. etc.

By selecting the appropriate folder in the drop-down you can determine where the availability_tpl.php will be created. So you can create multiple versions , with different rates displaying via the check-boxes, in multiple folders.

So now I have one webpage linking to pub/Apartment_1/availability_tpl.php , another to pub/Apartment_2/availability_tpl.php etc. etc.


Apologies if that's not 100% clear, but hopefully it will help someone with the same problem I had.
AJM.

Re: Restricting dropdowns

Posted: Thu Aug 21, 2014 4:10 pm
by bluealmondhostel
I have done something similar, but manually, this solution is wayyyyyyyyyyy easier and better!
thanks for sharing.

Multiple Availability Pages ... was Re: Restricting dropdown

Posted: Sun Mar 15, 2015 11:22 pm
by CutNGlass
Thanks for sharing. I am going to try this.