Viewing 4 replies - 1 through 4 (of 4 total)
  • Same issue. I also need this.

    Solved, you have to look for wc order fees.
    if you can find the order id, then just use WC_Order class:

    $order = new WC_Order( $order_id );
    $order_fees = $order->get_fees();

    you will see the fees you want to add in the invoice inside $order_fees, just do a var_dump($order_fees);

    if you look just for basic datas, here you are,
    the following code will print fees inside your invoice template file:

    if( sizeof( $order_fees ) > 0 ) {
    	foreach( $order_fees as $fee_key => $fee_data ) {
    		echo 'Fee Name: ' .$fee_data['name'];
    		echo ' - Fee Total: ' .$fee_data['line_total'];
    		echo ' - Fee Taxes: ' .$fee_data['line_tax'];
    		echo '<br />';
    	}
    }

    Improvements to this answer will be welcome, maybe there’s a way to get some more processed data, this looks quite raw…

    Thread Starter domstic

    (@domstic)

    thanks bluantinoo
    this looks great!

    I’m having trouble implementing this to my code. Can someone help me out with a little assistance?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘show payment fees on pdf invoice’ is closed to new replies.