How to Customize Template of Shipment Manifest
Customize Label Template
- Create “/wpcargo/wpcargo-shipment-container/” directory in your theme directory. (e.g. child-theme/wpcargo/wpcargo-shipment-container/).
- Create a new file and name it “delivery-manifest.tpl.php“
- If you just need a little changes in your template, you can copy below code and update desired section
delivery-manifest.tpl.php template default layout
<div id="delivery-manifest"> <div id="wpcsc-manifest-header" style="margin-bottom: 36px !important;"> <?php echo $header_data; ?> </div> <?php do_action( 'wpcsc_pdf_after_header_manifest', $containerID ); ?> <table class="container-info"> <tr> <td><?php esc_html_e( 'ROUTE', 'wpcargo-shipment-container' ); ?>:</td> <td><strong><?php echo apply_filters('wpcsc_manifest_title', __( 'DELIVERY MANIFEST', 'wpcargo-shipment-container' ) ); ?></strong></td> </tr> <tr> <td><?php esc_html_e( 'VEHICLE NO.', 'wpcargo-shipment-container' ); ?>: </td> <td><?php esc_html_e( 'NO.', 'wpcargo-shipment-container' ); ?>: <?php echo $tracknumber; ?></td> </tr> <tr> <td> </td> <td><?php esc_html_e( 'DATE', 'wpcargo-shipment-container' ); ?>: <?php echo get_post_meta( $containerID, 'date', true ); ?></td> </tr> <tr> <td> </td> <td><?php esc_html_e( 'DEVICE ID', 'wpcargo-shipment-container' ); ?>: </td> </tr> </table> <table class="container-info"> <tr> <td rowspan="4"><?php echo $acknowledgement; ?></td> <td><strong><?php esc_html_e( 'EMPLOYEE NAME', 'wpcargo-shipment-container' ); ?>:</strong></td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> <tr> <td><strong><?php esc_html_e( 'EMPLOYEE SIGNATURE', 'wpcargo-shipment-container' ); ?>:</strong></td> </tr> </table> <div id="container-shipments"> <?php if( !empty($shipments) ): ?> <table> <thead> <tr> <td><?php esc_html_e( 'No', 'wpcargo-shipment-container' ); ?></td> <td><?php esc_html_e( 'Barcode', 'wpcargo-shipment-container' ); ?></td> <?php if( !empty( $shipment_fields ) ){ foreach ( $shipment_fields as $field_label ) { $field_data = wpcsc_get_field_data($field_label); ?><td><?php echo $field_data['label']; ?></td><?php } } ?> </tr> </thead> <tbody> <?php $counter = 1; foreach( $shipments as $shipment_id ): $shipment_title = get_the_title( $shipment_id ); ?> <tr> <td><?php echo $counter; ?></td> <td> <div style="text-align: center;"> <img style="width:120px; height: 20px" src="<?php echo $url_barcode.$shipment_title; ?>"> <p><?php echo $shipment_title; ?></p> </div> </td> <?php if( !empty( $shipment_fields ) ){ foreach ( $shipment_fields as $field_label ) { $field_data = wpcsc_get_field_data($field_label); $shipment_data = get_post_meta( $shipment_id, $field_data['field_key'], true); if( $field_data['field_type'] == 'cargo_agent' && !empty( $shipment_data ) ){ $shipment_data = $wpcargo->user_fullname( $shipment_data ); } ?><td><?php echo $shipment_data; ?></td><?php } } ?> </tr> <?php $counter++; endforeach; ?></tbody> </table><?php endif; ?> </div> <?php do_action( 'wpcsc_pdf_before_footer_manifest', $containerID ); ?> <div id="wpcsc-manifest-footer"> <?php echo $footer_data; ?> </div> </div>