I've spent the better part of my day trying to figure out how to change the layout of the ticket_type fields at node/1/registration. Because I have numerous ticket types, I'd like to show fields in a table.

My problem is that the quantity input isn't represented on the display settings page (/admin/structure/ticket_type/display), so I can't position it relative to other content. Any suggestions?

You can see that page I'm working on at http://east.usworker.coop/2015-conference/registration

Comments

squidliberty’s picture

I was able to achieve the layout I want using a custom view (see http://east.usworker.coop/catalog/tickets) with the Commerce Add to Cart Extras module (https://www.drupal.org/project/commerce_add_to_cart_extras), but the result is an order form that sends the user directly to checkout, skipping the critical Ticket Registrant / Ticket Registration page that collects attendee information. What am I missing?

aajones’s picture

The layout of that registration page is handled via the ticket module. Specifically, you need to edit:
ticket/theme/ticket-type.tpl.php

I'd like to take a moment to credit IRC users japerry and DyannNova for helping with this issue.

<?php
/**
 * @file
 * A basic template for ticket type entities
 *
 * Available variables:
 *   TODO: Add documentation.
 *
 * @see template_preprocess()
 * @see template_preprocess_entity()
 * @see template_process()
 */
?>
<?php 
$quantity = array_slice($content, 1, 1, true);
$quantity = implode(array_keys($quantity));
?>
 
<table class="<?php print $classes; ?> clearfix"<?php print $attributes; ?>>
  <thead>
    <tr>
      <th width="10%">Quantity</th>
      <th width="20%">Type</th>
      <th width="20%">Price</th>
      <th width="50%">Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><?php print render($content[$quantity]); ?></td>
      <td><?php print render($content['ticket_type_label']); ?></td>
      <td><?php print render($content['product:commerce_price']); ?></td>
      <td><?php print render($content['ticket_type_description']); ?></td>
    </tr>
  </tbody>
</table>
squidliberty’s picture

Brilliant! This worked flawlessly.

squidliberty’s picture

Status: Active » Closed (fixed)