I have a channel to create an event. I also have a CartThrob Price Modifier field to add tickets if they are available.
On the single entry page, I only wish to show the exp:cartthrob:multi_add_to_cart_form if the single entry has available tickets.
I'm using the following code;
{if event_tickets:total_results}
<div id="event_tickets" class="box toptagorange buybox">
<h2>Buy Tickets</h2>
{exp:cartthrob:multi_add_to_cart_form
return="shop/basket"
}
<fieldset>
<table>
<tbody>
<tr>
<th class="ticket">Ticket</th>
<th>Qty</th>
</tr>
{event_tickets}
<tr>
<td>{option_name} <span class="price">{exp:cartthrob:view_formatted_number number="{price:plus_tax}" prefix="£" decimals="2"}</span></td>
<td><input type="text" name="quantity[{row_id}]" value="" class="tiny" /></td>
<input type="hidden" name="item_options[{row_id}][event_tickets]" value="{option_value}" />
<input type="hidden" name="entry_id[{row_id}]" value="{entry_id}" />
</tr>
{/event_tickets}
</tbody>
</table>
</fieldset>
<input type="submit" value="Buy Tickets">
{/exp:cartthrob:multi_add_to_cart_form}
</div>
{/if}
This works fine for an event that has tickets. However, if an event doesn't have any tickets then the page just goes to a 404. I was wondering if someone might be able to help figure this out?
Thanks, Neil