remove page break for waybill
// Remove Bulk Print page Break
remove_action( 'wpcfe_after_bulkprint_template', 'wpcfe_after_bulkprint_template_callback', 10 );
add_action( 'wpcfe_after_bulkprint_template', function( $counter, $shipment_num, $print_type ){
if( $print_type == 'waybill' ){
return false;
}
if( $counter != $shipment_num ){
?><div class="page_break"></div><?php
}
}, 10, 3 );
In waybill template use modulo operator (%) and ternary statement to set conditions
<?php if( isset( $shipment_ids ) ): ?>
<?php echo $counter % 3 === 1 || $counter % 3 === 2 || $counter % 3 === 0 ? '<table cellpadding:"0" cellspacing:"0"; style="width:100%; border: 1px solid #fff !important; border-collapse: collapse; margin:20px 10px 0 10px !important; page-break-inside: avoid !important; overflow:hidden !important;" >' : '' ; ?>
<!-- Row 1 -->
<?php echo $counter % 3 === 1 || $counter % 3 === 2 || $counter % 3 === 0 ? '<tr style="border: 1px solid #fff !important; width:100%;">' : '' ; ?>
<td style="border: transparent !important; width:100% !important; <?php echo $counter % 3 === 1 || $counter % 3 === 2 ? 'padding-left: 10px !important;line-height: normal !important;' : ''; ?>">
<?php echo $counter % 3 === 1 || $counter % 3 === 2 || $counter % 3 === 0 ? '<table style="width:100%; margin-top: 9px !important; border: transparent !important; border-collapse: collapse !important;overflow:hidden !important; margin-bottom: 20px !important;" >' : '' ; ?>
//your additional template codes here...</pre>
</pre>
</table></td>
<?php echo $counter % 3 === 0 ? '</tr>' : '' ; ?>
<tr></tr>
<?php echo $counter % 3 === 0 ? '</table>' : '' ; ?>
<pre><?php else: ?>
//your codes here for else
<?php endif; ?>