< Back to Switches

Quantity Reservation Calendars

The quantity reservation calendar switch enables a system where each topic becomes an object which can be reserved for certain dates. The topic owner will be able to set a quantity of the object available for each date. A calendar will appear on the topic details page displaying availability.

To enable visitors to search to find what topics are available on a given date, you can use this search form:
<form action="search.php?action=filter&filled=1&whichtype=links" method="post">
Find topics that are available on the date <input type="text" name="eventdate" class="datepicker">
<button type="submit" class="gobutton">Find</button>
</form>


If you have the shopping cart switch enabled, you can integrate this with that. For the search results page, you can add this cart button code:
<IF {SWITCH_CART}>
<?php if ($_REQUEST['eventdate']) echo '
<input type="hidden" name="cartoption1label" value="Reservation" >
<input type="hidden" name="cartoption1" value="'.$_REQUEST['eventdate'].'" >';
?>
<a id="cartadd{LINKID}" class="addtocart" onclick="addtocart({LINKID}, {THISMEMBERID})"><img src="{IMAGESURL}/cart.png" > Add To Cart</a>
<br >
</IF>

That code will record the date which they've reserved it for in the purchase details, and the quantity available on that date will automatically be reduced by one after the purchase processes.

If you have further inquiries or special needs relating to this feature, please contact support.