1: Customize layout
You can customize layout, fields in pdf ticket
Copy file
Plugins/eventlist/templates/pdf/template.php
to
Themes/meup-child/eventlist/pdf/template.php
We are using mPDF to make ticket pdf, so you can read here to know about mPDF: https://mpdf.github.io/
- Display Custom Field Checkout in PDF Ticket
You can add bellow code in template file:
<?php
$data_checkout_field = get_post_meta( $ticket['ticket_id'], OVA_METABOX_EVENT.'data_checkout_field', true );
if( $data_checkout_field ){
$data_checkout_field = json_decode( $data_checkout_field );
foreach ($data_checkout_field as $key => $value) {
echo '<br/>'.$key.': '.$value.'<br/>';
}
}
?>
- Display Phone of customer in pdf ticket:
You can add bellow code in template file
$booking_id = get_post_meta( $ticket['ticket_id'], OVA_METABOX_EVENT.'booking_id', true );
$phone = get_post_meta( $booking_id, OVA_METABOX_EVENT.'phone', true );
echo '<br/>Phone:'.$phone;
2: Update font
Change font size
Check language in site. example English, you can add bellow code to function.php in child theme
add_filter( 'el_pdf_font_size_en', function(){ return '14'; } );
Change font family
Check language in site. example English, you can add bellow code to function.php in child theme
add_filter( 'el_pdf_font_en', function(){ return 'Sun-ExtA'; } );
Use New font
You can add your font to themes/meup-child/font/ folder then add bellow code to function.php file in child theme
add_filter( 'el_pdf_font_en', function(){ return 'Sun-ExtA'; } );
You can find some extra fonts here: https://github.com/mpdf/mpdf/tree/development/ttfonts