Plugin Contributor
Ewout
(@pomegranate)
Hi! You can use the wpo_wcpdf_after_item_meta to add extra data to the PDF. I don’t know about vendor notes, but here’s a code snippet I created some time ago for another client – this shows the vendor name below the item.
add_action( 'wpo_wcpdf_after_item_meta', 'wpo_wcpdf_show_product_vendor', 10, 3 );
function wpo_wcpdf_show_product_vendor ( $template_type, $item, $order ) {
if ( ! empty( $item['product_id'] ) && WC_Product_Vendors_Utils::is_vendor_product( $item['product_id'] ) ) {
$sold_by = WC_Product_Vendors_Utils::get_sold_by_link( $item['product_id'] );
$sold_by_text = apply_filters( 'wcpv_sold_by_text', esc_html__( 'Sold By:', 'woocommerce-product-vendors' ) );
$link = esc_url( $sold_by['link'] );
$title = esc_attr( $sold_by['name'] );
$name = $sold_by['name'];
printf('<br /><em class="wcpv-sold-by-order-details">%s <a href="%s" title="%s">%s</a></em>', $sold_by_text, $link, $title, $name );
}
}
If you haven’t worked with code snippets (actions/filters) or functions.php before, read this guide: How to use filters.
Hope that helps!
Ewout
Thread Starter
btkfr
(@btkfr)
Thanks a lot Ewout! It’s working flawlessly.
Best, Phil
Plugin Contributor
Ewout
(@pomegranate)
Great, glad to hear that helps!
Ewout