How to Customize Template of Invoice
Customize Invoice Template
- Create directory under your active theme directory and name it “wpcargo”. (e.g. child-theme/wpcargo/ ).
- Create a new file and name it invoice.tpl.php under the theme_folder/wpcargo/ file directory. Note: This will return an empty template.
- If you just need a little changes in your template, you can copy below code and update desired section or you can create a new template based on your desired design.
Default invoice template layout
<?php do_action( 'wpcfe_before_invoice_content', $shipmentDetails ); ?> <table style="width:100%;"> <?php do_action( 'wpcfe_start_invoice_section', $shipmentDetails ); ?> <tr> <td style="width:50%; vertical-align: middle !important; text-align: center !important;" class="border-bottom"> <?php do_action( 'wpcfe_invoice_site_info', $shipmentDetails ); ?> </td> <td style="width:50%; vertical-align: middle !important; text-align: center !important;" class="border-bottom"> <?php do_action( 'wpcfe_invoice_barcode_info', $shipmentDetails ); ?> </td> </tr> <?php do_action( 'wpcfe_middle_invoice_section', $shipmentDetails ); ?> <tr> <td style="width:50%;" class="space-topbottom"> <?php do_action( 'wpcfe_invoice_shipper_info', $shipmentDetails ); ?> </td> <td style="width:50%;" class="space-topbottom"> <?php do_action( 'wpcfe_invoice_receiver_info', $shipmentDetails ); ?> </td> </tr> <?php do_action( 'wpcfe_end_invoice_section', $shipmentDetails ); ?> </table> <?php do_action( 'wpcfe_after_invoice_content', $shipmentDetails ); ?>
Note:
If you have Invoice Addon installed and activated, copy and paste the following code in the functions.php of your current theme
remove_filter( 'wpcfe_print_template_path_invoice', 'wpcinvoice_template_path_callback', 999 );