Plugin Contributor
Ewout
(@pomegranate)
Hi!
The payment method is already part of the default template:
http://i.imgur.com/IIwaqJ4.png
You can remove ‘invoice-‘ from the filename by adding the following code to your theme functions:
// remove 'invoice-' from filename;
add_filter( 'wpo_wcpdf_filename', 'wpo_wcpdf_custom_filename', 10, 4 );
function wpo_wcpdf_custom_filename( $filename, $template_type, $order_ids, $context ) {
$invoice_string = _n( 'invoice', 'invoices', count($order_ids), 'wpo_wcpdf' );
$new_filename = str_replace($invoice_string.'-', '', $filename);
return $new_filename;
}
If you haven’t edited your theme functions before, make sure to read this.
Hope that helps!
Thread Starter
dinigi
(@dinigi)
Hi Ewout, thanks for your answer!
We are not using the default template. We are using the premium extension template Business.
Can you tell me which attribute i have to add to make the payment method visible?
Thanks in advance
Plugin Contributor
Ewout
(@pomegranate)
Hi!
For questions about premium extensions, you can always contact us at support@wpovernight.com (officially we’re not allowed to use these forums for premium support).
Either way, you can add it by adding the following to your theme functions:
add_action( 'wpo_wcpdf_after_order_data', 'wpo_wcpdf_business_payment_method', 10, 2 );
function wpo_wcpdf_business_payment_method ($template_type, $order) {
global $wpo_wcpdf;
if ($template_type == 'invoice') {
?>
<tr class="payment-method">
<th><?php _e( 'Payment method', 'wpo_wcpdf' ); ?>:</th>
<td><?php $wpo_wcpdf->payment_method(); ?></td>
</tr>
<?php
}
}
Contact us via support@wpovernight.com for any follow-up questions 🙂
Have a great day!
Ewout
Thread Starter
dinigi
(@dinigi)
Thank you so much for the quick support! Everything works fine!
Have a great weekend