• Resolved btkfr

    (@btkfr)


    Hi there. Brilliant Plugin, thank you so much! We’re running a multi-vendor marketplace based on WooCommerce Product Vendors. We need to display the vendor name and the vendor notes per product on our documents. Can you help us? Thanks a lot!

    Best, Phil

    WooCommerce Version 3.2.3
    WooCommerce Product Vendors Version 2.1.2
    WooCommerce PDF Invoices & Packing Slips Version 2.0.15

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • 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

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Displaying Vendor Data’ is closed to new replies.