Hello Priya,
This is definitely possible with some logic inside your template, but it won’t exactly be an invoice or packing slip.
You could do something like this in your invoice.php template:
<?php global $wpo_wcpdf;
$items = $wpo_wcpdf->get_order_items();
if( sizeof( $items ) > 0 ) {
$product_id = $item['product_id'];
$variation_id = $item['variation_id'];
if (!empty($variation_id)) {
// switch product_id for variation_id if set
$product_id = $variation_id;
}
switch ( $product_id ) {
case '123':
include ( $wpo_wcpdf->export->template_path . '/123.php')
break;
case '999':
include ( $wpo_wcpdf->export->template_path . '/999.php')
break;
default:
include ( $wpo_wcpdf->export->template_path . '/default.php')
break;
}
}
?>
This code loops through the order items and includes the template belonging to each product or variation ID.
I haven’t tested the above code (as it is beyond the scope of support for this free plugin) so it might need some adjustments, but it should give you a good idea on where to start!