Add the following custom CSS:
.em-tickets * {
box-sizing: border-box;
}
/* Create three equal columns that floats next to each other */
.ticket-column {
float: left;
width: 33.33%;
padding: 10px;
}
/* Clear floats after the columns */
.ticket-row:after {
content: "";
display: table;
clear: both;
}
/* Responsive layout - makes the three columns stack on top of each other instead of next to each other */
@media screen and (max-width: 600px) {
.ticket-column {
width: 100%;
}
}
Then create the directory wp-content/plugin-templates/events-manager/forms/bookingform and in that directory create a file called tickets-list.php and that file should contain the following code:
<?php
/*
* This file generates a tabular list of tickets for the event booking forms with input values for choosing ticket spaces.
* If you want to add to this form this, you'd be better off hooking into the actions below.
*/
/* @var $EM_Event EM_Event */
global $allowedposttags;
$EM_Tickets = $EM_Event->get_bookings()->get_tickets(); //already instantiated, so should be a quick retrieval.
/*
* This variable can be overridden, by hooking into the em_booking_form_tickets_cols filter and adding your collumns into this array.
* Then, you should create a em_booking_form_tickets_col_arraykey action for your collumn data, which will pass a ticket and event object.
*/
$collumns = $EM_Tickets->get_ticket_collumns(); //array of collumn type => title
?>
<div class="em-tickets">
<?php foreach( $EM_Tickets->tickets as $EM_Ticket ): /* @var $EM_Ticket EM_Ticket */ ?>
<?php if( $EM_Ticket->is_displayable() ): ?>
<?php do_action('em_booking_form_tickets_loop_header', $EM_Ticket); //do not delete ?>
<div class="ticket-row">
<?php foreach( $collumns as $type => $name ): ?>
<?php
//output collumn by type, or call a custom action
switch($type){
case 'type':
?>
<div class="ticket-column"><?php echo wp_kses_data($EM_Ticket->ticket_name); ?><?php if(!empty($EM_Ticket->ticket_description)) :?><br><span class="ticket-desc"><?php echo wp_kses($EM_Ticket->ticket_description,$allowedposttags); ?></span><?php endif; ?></div>
<?php
break;
case 'price':
?>
<div class="ticket-column"><?php echo $EM_Ticket->get_price(true); ?></div>
<?php
break;
case 'spaces':
?>
<div class="ticket-column">
<?php
$default = !empty($_REQUEST['em_tickets'][$EM_Ticket->ticket_id]['spaces']) ? $_REQUEST['em_tickets'][$EM_Ticket->ticket_id]['spaces']:0;
$spaces_options = $EM_Ticket->get_spaces_options(true,$default);
echo ( $spaces_options ) ? $spaces_options:"<strong>".__('N/A','events-manager')."</strong>";
?>
</div>
<?php
break;
default:
do_action('em_booking_form_tickets_col_'.$type, $EM_Ticket, $EM_Event);
break;
}
?>
<?php endforeach; ?>
</div>
<?php do_action('em_booking_form_tickets_loop_footer', $EM_Ticket); //do not delete ?>
<?php endif; ?>
<?php endforeach; ?>
</div>
Thanks so much! Mobile now looks a lot better, need to fix a bit the desktop’s view by differentiating the 3 columns, I should be able to do it 🙂