Additional pdf print

Add this in your functions.php

add_action( 'wpcfe_print_html_head', 'track_result_printer_style' );
function  track_result_printer_style(){
	?>
<link rel="stylesheet" id="wpcargo-styles-css" href="<?php echo WPCARGO_PLUGIN_URL . 'assets/css/wpcargo-style.css';?>" media="all">
<link rel="stylesheet" id="wpcargo-custom-bootstrap-styles-css" href="<?php echo WPCARGO_PLUGIN_URL . 'assets/css/main.min.css'; ?>" media="all">

<?php 	
}
	

add_action( 'wp_head', 'remove_print_button_class_action' );
function remove_print_button_class_action() {
	global $wpcargo_print;
	remove_action( 'wpcargo_print_btn', array($wpcargo_print, 'wpcargo_print_results') );
}


add_action( 'wpcargo_print_btn', 'custom_wpcargo_print_results' );

function  custom_wpcargo_print_results(){
	?>
	<div class="wpcargo-print-btn print-shipment">
				<a class=" shipment-checkout button button-primary" data-id="<?php echo wpcfe_shipment_id( $_POST['wpcargo_tracking_number'] ); ?>" type="button" data-type="track" ><span class="dashicons dashicons-media-spreadsheet" style="vertical-align: sub;"></span> <?php echo apply_filters( 'wpcargo_print_invoice_label', esc_html__( 'Print Track Result', 'wpcargo') ); ?></a>
			</div>
<?php 	
}


add_filter( 'wpcfe_print_paper_size', '_custom_wpcfe_print_paper_size', 1 );
function _custom_wpcfe_print_paper_size( $sizes ){
  // custom-scripts - is your enqueued script handle
  $track=array(
            'size' => 'A4',
            'orient' => 'portrait'
        
      );
	
$sizes["track"] = $track;
	
	return $sizes;
}

Create a file name track.php and add it in your current theme / wpcargo directory add the code below

<div class="card">
	<div class="card-body">
		<div id="wpcargo-result-wrapper" class="wpcargo-wrap-details wpcargo-container mb-5">
		    <style>
    		    #wpcargo-result{
    		        font-size:14px!important;
    		    }
    		    #wpcargo-result .header-title {
                    border-bottom: 1px solid #858b89;
                    font-size: 1.2rem;
                }

                .wpcargo-col-md-6 {
                    flex: 0 0 50%;
                    max-width: 48%;
                    float: left;
                }
                .wpcargo-col-md-4 {
    
    	            margin: 1% 0 1% 0%;
                    float: none!important;
                    max-width: 26%!important;
                    width: 26%!important;
                    flex:none!important;
                    height:30px;
                    display: inline-block!important;
    
                }
                #shipment_info, 
                #wpcargo-history-section{ margin-top:15px;}
    
                #shipment_info .wpcargo-label {
                    font-size: 14px!important;
                    display: block;
                }
                p.wpcargo-label{
                       margin-top: 0;
                    margin-bottom: 0.2em; 
                }
                p {
                    margin-block-start: 0;
                    margin-block-end: 0.5rem;
                    
                    margin-top: 0;
                    margin-bottom: 0.5em;
                     font-size: 14px!important;
                }
                p.header-title{
                    font-size:16px!important;
                }
                .wpcargo-table thead th {
                    color: #fff;
                    background-color: #00A924;
                    border-color: #00A924;
                    border: 1px solid #eeeeee;
                }
                .wpcargo-row::after {
                  content: "";
                  clear: both;
                  display: table;
                }
                
                #shmap-wrapper{ display:none;}
                #shipment-history{ font-size:13px!important;}
                .wpcargo-table td, .wpcargo-table th {
                    padding: 0.75rem;
                    vertical-align: top;
                    border-top: 1px solid #dee2e6;
                }
            </style>
		    <?php
		    
		    
            $shipment 				= new stdClass;
			$shipment->ID 			= (int)esc_html( $shipment_id );
			$shipment->post_title 	= esc_html( get_the_title( $shipment->ID) );
			$shipment_status = esc_html( get_post_meta( $shipment->ID, 'wpcargo_status', true ) );
			
			
		    do_action('wpcargo_before_track_details', $shipment );
		    do_action('wpcargo_track_header_details', $shipment );
		    do_action('wpcargo_track_after_header_details', $shipment );
		    do_action('wpcargo_track_shipper_details', $shipment );
		    do_action('wpcargo_before_shipment_details', $shipment );
		    do_action('wpcargo_track_shipment_details', $shipment );
		    do_action('wpcargo_after_package_details', $shipment );
		    do_action('wpcargo_after_package_totals', $shipment );
			do_action('wpcargo_after_track_details', $shipment );
		 
		   ?>
		</div>
	</div>
</div>
0
    0
    Your Cart
    Your cart is emptyReturn to Shop