0

I'm running Drupal Commerce and Commerce Event Tickets on a client site. I'm trying to figure out how to customize the content of the ticket PDF that is generated by the module, and I'm stumped. It's not managed by any of the generated views. Has anyone done this before?

0

You can customize the PDF content by using the HOOK function <YourCustomModule>_commerce_event_ticket_pdf_alter($pdf, $ticket, $context) or for simpler manipulation use <YourCustomModule>_commerce_preprocess_commerce_event_ticket_pdf_info(&$variables).

Take a look at: https://www.drupal.org/node/2407879 and https://www.drupal.org/node/2269659

It's also possible to replace the theme function by altering the theme registry:

function <YourCustomModule>_commerce_theme_registry_alter(&$theme_registry) {
  if (!empty($theme_registry['commerce_event_ticket_pdf_info']['function'])) {
    $theme_registry['commerce_event_ticket_pdf_info']['function'] = '<YourCustomModule>_commerce_commerce_event_ticket_pdf_info'; // Your function to alter the content...
}

You should also have a look at the repository on GitHub -> gausie/commerce_event_ticket

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.