product description on delivery note/packing_slip
-
Hi, i was trying to use
add_action( 'wpo_wcpdf_after_item_meta', 'wpo_wcpdf_show_product_description', 10, 3 );
function wpo_wcpdf_show_product_description ( $template_type, $item, $order ) {
if (empty($item['product'])) return;
if ( $template_type == 'packing_slip') {
$_product = $item['product']->is_type( 'variation' ) ? wc_get_product( $item['product']->get_parent_id() ) : $item['product'];
if ( method_exists( $_product, 'get_short_description' ) ) {
$description = $_product->get_short_description();
printf('<br><div class="product-description" style="font-size: 9px;">%s</div>', $description );
}
}
}to show product descriptions on the delivery note (first question: what is your translation of the german “Lieferschein”? packing_slip or delivery_note?) Without the restriction the code is working fine. On packing_slips/delivery_note and invoices. With the restriction no description on the packing_slip/delivery_note. I was trying packing_slip and delivery_note in the code.
In german there is Packliste (packing_slip?) and Lieferschein (delivery_note?). Please pardon my confusion.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.